Skip to content

Commit 09979f2

Browse files
authored
When doing something with gradle, don't reuse any caches (#15398)
* Don't use gradle caches for gradle upgrade workflow checks. * coerce from string. * Don't use cache for gradle-wrapper.
1 parent 4e73f5b commit 09979f2

File tree

2 files changed

+8
-0
lines changed

2 files changed

+8
-0
lines changed

.github/actions/prepare-for-build/action.yml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,11 @@ inputs:
1515
default: "temurin"
1616
description: "The default JDK distribution type"
1717

18+
use-cache:
19+
required: false
20+
default: true
21+
description: "Use setup-gradle for dependency caching"
22+
1823
runs:
1924
using: "composite"
2025
steps:
@@ -26,13 +31,15 @@ runs:
2631
java-package: jdk
2732

2833
- name: Cache gradle-wrapper.jar
34+
if: ${{ fromJSON(inputs.use-cache) }}
2935
uses: actions/cache@5a3ec84eff668545956fd18022155c47e93e2684 # v4.2.3
3036
with:
3137
path: gradle/wrapper/gradle-wrapper.jar
3238
key: gradle-wrapper-${{ hashFiles('gradle/wrapper/gradle-wrapper.jar.sha256') }}
3339

3440
# This includes "smart" caching of gradle dependencies.
3541
- name: Set up Gradle
42+
if: ${{ fromJSON(inputs.use-cache) }}
3643
uses: gradle/actions/setup-gradle@ac638b010cf58a27ee6c972d7336334ccaf61c96 # v4.4.1
3744
with:
3845
# increase expiry time for the temp. develocity token.

.github/workflows/run-checks-gradle-upgrade.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,7 @@ jobs:
4949
- uses: ./.github/actions/prepare-for-build
5050
with:
5151
java-version: ${{ matrix.java-version }}
52+
use-cache: false
5253

5354
- name: Set up RUNTIME_JAVA_HOME variable
5455
if: ${{ matrix.uses-alt-java }}

0 commit comments

Comments
 (0)