Skip to content

Commit

Permalink
CI: adjust Gradle cache storage parameters for non-ci.yml workflows (
Browse files Browse the repository at this point in the history
…#6521)

* Do not let the snapshot-publish workflow use any cache (always build from scratch), the release-publish workflow never restored its local Gradle cache
* Let other "background" workflows _read_ the caches created by `ci.yml`
  • Loading branch information
snazy authored Apr 11, 2023
1 parent 0eec6ac commit f432bb9
Show file tree
Hide file tree
Showing 5 changed files with 22 additions and 1 deletion.
5 changes: 5 additions & 0 deletions .github/workflows/bump-version.yml
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,11 @@ jobs:

- name: Bump to version
uses: gradle/gradle-build-action@v2
env:
# Same as for ci.yml
GRADLE_BUILD_ACTION_CACHE_KEY_ENVIRONMENT: java-11
GRADLE_BUILD_ACTION_CACHE_KEY_JOB: nessie-ci
GRADLE_BUILD_ACTION_CACHE_KEY_JOB_INSTANCE: ci
with:
cache-read-only: true
arguments: :bumpVersion --bumpType ${{ env.BUMP_TYPE }}
Expand Down
5 changes: 5 additions & 0 deletions .github/workflows/ci-mac.yml
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,11 @@ jobs:

- name: Gradle / compile
uses: gradle/gradle-build-action@v2
env:
# Same as for ci.yml
GRADLE_BUILD_ACTION_CACHE_KEY_ENVIRONMENT: java-11
GRADLE_BUILD_ACTION_CACHE_KEY_JOB: nessie-ci
GRADLE_BUILD_ACTION_CACHE_KEY_JOB_INSTANCE: ci
with:
cache-read-only: true
arguments: assemble --scan
Expand Down
5 changes: 5 additions & 0 deletions .github/workflows/ci-win.yml
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,11 @@ jobs:

- name: Gradle / compile
uses: gradle/gradle-build-action@v2
env:
# Same as for ci.yml
GRADLE_BUILD_ACTION_CACHE_KEY_ENVIRONMENT: java-11
GRADLE_BUILD_ACTION_CACHE_KEY_JOB: nessie-ci
GRADLE_BUILD_ACTION_CACHE_KEY_JOB_INSTANCE: ci
with:
cache-read-only: true
arguments: assemble --scan
Expand Down
6 changes: 6 additions & 0 deletions .github/workflows/newer-java.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,13 @@ jobs:
uses: ./.github/actions/setup-runner
- name: Setup Java, Gradle
uses: ./.github/actions/dev-tool-java
env:
# Same as for ci.yml
GRADLE_BUILD_ACTION_CACHE_KEY_ENVIRONMENT: java-11
GRADLE_BUILD_ACTION_CACHE_KEY_JOB: nessie-ci
GRADLE_BUILD_ACTION_CACHE_KEY_JOB_INSTANCE: ci
with:
cache-read-only: true
java-version: ${{ matrix.java-version }}

- name: Gradle / compile
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/snapshot-publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ jobs:
ORG_GRADLE_PROJECT_sonatypePassword: ${{ secrets.OSSRH_TOKEN }}
uses: gradle/gradle-build-action@v2
with:
cache-read-only: true
cache-disabled: true
arguments: |
publishToSonatype closeAndReleaseSonatypeStagingRepository
-Prelease -Puber-jar
Expand Down

0 comments on commit f432bb9

Please sign in to comment.