mirror of
https://github.com/gradle/gradle-build-action.git
synced 2025-05-04 21:58:35 +02:00
Add experimental support for 'cache-write-only'
There may be cases where it a "fresh" cache entry would be beneficial, for example if the Gradle User Home cache entry grows over time. This setting would run the build as if no prior cache entry exists.
This commit is contained in:
parent
0a5ede19a9
commit
08d5b40ca5
6 changed files with 69 additions and 19 deletions
39
.github/workflows/integTest-caching-config.yml
vendored
39
.github/workflows/integTest-caching-config.yml
vendored
|
@ -101,3 +101,42 @@ jobs:
|
|||
with:
|
||||
script: |
|
||||
core.setFailed('No build scan detected')
|
||||
|
||||
# Test seed the cache with cache-write-only and verify with cache-read-only
|
||||
seed-build-write-only:
|
||||
env:
|
||||
GRADLE_BUILD_ACTION_CACHE_KEY_PREFIX: ${{github.workflow}}#${{github.run_number}}:${{github.run_attempt}}-write-only-
|
||||
strategy:
|
||||
matrix:
|
||||
os: [ubuntu-latest, windows-latest]
|
||||
runs-on: ${{ matrix.os }}
|
||||
steps:
|
||||
- name: Checkout sources
|
||||
uses: actions/checkout@v2
|
||||
- name: Setup Gradle
|
||||
uses: ./
|
||||
with:
|
||||
cache-write-only: true
|
||||
- name: Build using Gradle wrapper
|
||||
working-directory: __tests__/samples/groovy-dsl
|
||||
run: ./gradlew test
|
||||
|
||||
verify-write-only-build:
|
||||
env:
|
||||
GRADLE_BUILD_ACTION_CACHE_KEY_PREFIX: ${{github.workflow}}#${{github.run_number}}:${{github.run_attempt}}-write-only-
|
||||
needs: seed-build-write-only
|
||||
strategy:
|
||||
matrix:
|
||||
os: [ubuntu-latest, windows-latest]
|
||||
runs-on: ${{ matrix.os }}
|
||||
steps:
|
||||
- name: Checkout sources
|
||||
uses: actions/checkout@v2
|
||||
- name: Setup Gradle
|
||||
uses: ./
|
||||
with:
|
||||
cache-read-only: true
|
||||
- name: Execute Gradle build with --offline
|
||||
working-directory: __tests__/samples/groovy-dsl
|
||||
run: ./gradlew test --offline
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue