name: Smoke test restore Gradle Home on: workflow_call: inputs: cache-key-prefix: type: string default: '0' runner-os: type: string default: '["ubuntu-latest"]' skip-dist: type: boolean default: false env: SKIP_DIST: ${{ inputs.skip-dist }} # Distinct from the keys used by integ-test-restore-gradle-home.yml, which seeds an equivalent # cache entry. Both suites run concurrently, so they must not write to the same cache key. GRADLE_BUILD_ACTION_CACHE_KEY_PREFIX: smoke-test-restore-gradle-home-${{ inputs.cache-key-prefix }} GRADLE_BUILD_ACTION_CACHE_KEY_JOB: smoke-test-restore-gradle-home permissions: contents: read jobs: restore-gradle-home-seed-build: strategy: max-parallel: 1 fail-fast: false matrix: os: ${{fromJSON(inputs.runner-os)}} runs-on: ${{ matrix.os }} steps: - name: Checkout sources uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6.0.3 - name: Initialize integ-test uses: ./.github/actions/init-integ-test - name: Setup Gradle uses: ./setup-gradle with: cache-read-only: false # For testing, allow writing cache entries on non-default branches - name: Build using Gradle wrapper working-directory: .github/workflow-samples/groovy-dsl run: ./gradlew test # Test that the gradle-user-home cache will cache dependencies, by running build with --offline restore-gradle-home-dependencies-cache: needs: restore-gradle-home-seed-build strategy: max-parallel: 1 fail-fast: false matrix: os: ${{fromJSON(inputs.runner-os)}} runs-on: ${{ matrix.os }} steps: - name: Checkout sources uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6.0.3 - name: Initialize integ-test uses: ./.github/actions/init-integ-test - name: Setup Gradle uses: ./setup-gradle with: cache-read-only: true - name: Execute Gradle build with --offline working-directory: .github/workflow-samples/groovy-dsl run: ./gradlew test --offline