8000 Migrate to sbt 2.0.8, Scala 3.9.0; webpack → vite by rleibman · Pull Request #10 · rleibman/chuti · GitHub
[go: up one dir, main page]

Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
35 changes: 30 additions & 5 deletions .github/workflows/scala.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@ on:

permissions:
contents: read
# Needed to resolve zio-auth from GitHub Packages.
packages: read

jobs:
build:
Expand All @@ -27,12 +29,35 @@ jobs:
java-version: '21'
distribution: 'temurin'
cache: 'sbt'
# setup-java's cache: 'sbt' only caches sbt's directories; it does not install sbt, and the runner images
# no longer ship it. Without this the job died with exit 127 (command not found) after ~10s -- which is why
# this workflow had been red on main since February.
- name: Setup sbt
uses: sbt/setup-sbt@v1
- name: Cache npm dependencies (vite)
uses: actions/cache@v4
with:
path: web/node_modules
key: ${{ runner.os }}-npm-vite-${{ hashFiles('web/package-lock.json') }}
restore-keys: |
${{ runner.os }}-npm-vite-
# webDebugDist, not debugDist: sbt-native-packager owns the `dist` name under sbt 2, so ours were renamed.
- name: Run tests
run:
cd stLib;
sbt publishLocal;
cd ..;
sbt compile debugDist;
# zio-auth resolves from GitHub Packages, which requires auth even for public packages. build.sbt reads
# these two via sys.env; without them the credentials are empty and resolution fails with
# "Error downloading net.leibman:zio-auth_3".
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
GITHUB_ACTOR: ${{ github.actor }}
run: |
cd stLib
sbt publishLocal
cd ..
# ONE argument with a semicolon, not two arguments. CI runs sbt through the thin client (sbtn), which
# joins multiple argv entries into a single command string -- `sbt compile web/webDebugDist` is parsed
# as one command and fails with "Expected whitespace character / Expected '/'". The plain `sbt` script
# does not do this, which is why it only ever failed on CI. Reproduced locally with sbtn.
sbt "compile; web/webDebugDist"
# Optional: This step uploads information to the GitHub dependency graph and unblocking Dependabot alerts for the repository
# - name: Upload dependency graph
# uses: scalacenter/sbt-dependency-submission@ab086b50c947c9774b70f39fc7f6e20ca2706c91
6 changes: 4 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -52,10 +52,9 @@ debugDist
dist
/.env
/.deploy-config
/.bloop/
.bloop/
/.metals/
/project/metals.sbt
/project/.bloop/

/tree.txt
/chuti-stLib
Expand All @@ -65,3 +64,6 @@ dist
*.deb
/stLib/node_modules/.yarn-integrity
/landing/build/

# npm project for the vite frontend build
web/node_modules/
2 changes: 1 addition & 1 deletion CLAUDE.md
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ sbt --error web/dist
sbt --error scalafmt

# Build Debian package
sbt --error server/debian:packageBin
sbt --error server/Debian/packageBin
```

### First-Time Setup
Expand Down
Loading
Loading
0