Skip to content

Commit 34de3e1

Browse files
CI: don't cache sbt state so tests actually run every time
sbt 2.x's `test` is incremental (delegates to testQuick) and its 'already succeeded' record survives `clean` and was being restored by setup-java's cache:sbt -> CI skipped the whole suite ('No tests to run') on any run that didn't change sources. Cache only the dependency artifacts (~/.ivy2/cache, ~/.cache/coursier); don't restore sbt's global state, so every CI run executes the full test suite cold.
1 parent 5db3765 commit 34de3e1

1 file changed

Lines changed: 10 additions & 1 deletion

File tree

.github/workflows/ci.yml

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,16 @@ jobs:
1717
with:
1818
distribution: temurin
1919
java-version: '17'
20-
cache: sbt
20+
# Cache only dependency artifacts - NOT sbt's global state. sbt 2.x's `test` is incremental (testQuick) and its
21+
# "already succeeded" record survives `clean`; caching sbt state would make CI skip tests on unchanged sources
22+
# ("No tests to run"), so we deliberately don't restore it and let every CI run execute the full suite.
23+
- uses: actions/cache@v4
24+
with:
25+
path: |
26+
~/.ivy2/cache
27+
~/.cache/coursier
28+
key: sbt-deps-${{ hashFiles('**/*.sbt', 'project/**') }}
29+
restore-keys: sbt-deps-
2130
- uses: sbt/setup-sbt@v1
2231
- uses: extractions/setup-just@v4
2332
- name: Start Docker images used in IT tests

0 commit comments

Comments
 (0)