Run pre-existing-gradle-home smoke test on Linux only

This job pre-creates ~/.gradle, which is exactly what stops setup-gradle
relocating the Gradle User Home to D:\a\.gradle on Windows. The seed build
saves its cache entry rooted at D:\a\.gradle, and cache entries are
identified by key *and* by a version derived from the cache paths, so the
relocated Gradle User Home never matches: the job requests a byte-identical
key and still gets "no match found", then fails the --offline build.

The other Windows jobs in this workflow are unaffected, and the ubuntu leg
passes because Linux has no equivalent relocation.

Testing Gradle User Home relocation semantics is integration-level rather
than smoke-level behaviour, so run this job on Linux only.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
This commit is contained in:
Daz DeBoer
2026-08-01 18:34:34 -06:00
co-authored by Claude Opus 5
parent 4318659b28
commit 3711048846
@@ -114,15 +114,16 @@ jobs:
working-directory: .github/workflow-samples/groovy-dsl
run: ./gradlew test
# Test that a pre-existing gradle-user-home can be overwritten by the restored cache
# Test that a pre-existing gradle-user-home can be overwritten by the restored cache.
#
# Deliberately not run against the 'runner-os' matrix: creating ~/.gradle up-front is precisely
# what stops setup-gradle relocating the Gradle User Home to D:\a\.gradle on Windows, so this job
# would look for a cache entry rooted at a different path than the one the seed build saved.
# Cache entries are identified by key *and* by a version derived from the cache paths, so that
# never matches. This is integration-level behaviour rather than a smoke test, so run it on Linux.
restore-gradle-home-pre-existing-gradle-home:
needs: restore-gradle-home-seed-build
strategy:
max-parallel: 1
fail-fast: false
matrix:
os: ${{fromJSON(inputs.runner-os)}}
runs-on: ${{ matrix.os }}
runs-on: ubuntu-latest
steps:
- name: Checkout sources
uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6.0.3