Skip to content

Commit 87575a4

Browse files
Update CI Action versions and Artifact Names
1 parent b1a52a9 commit 87575a4

File tree

3 files changed

+166
-160
lines changed

3 files changed

+166
-160
lines changed
Lines changed: 76 additions & 76 deletions
Original file line numberDiff line numberDiff line change
@@ -1,53 +1,53 @@
1-
name : 'Set up Gradle and some task(s) with caching'
2-
description : 'This action performs common steps for a Gradle task.'
1+
name: 'Set up Gradle and some task(s) with caching'
2+
description: 'This action performs common steps for a Gradle task.'
33

4-
inputs :
5-
task :
6-
description : 'Gradle command line arguments (supports multi-line input)'
7-
required : true
8-
build-root-directory :
9-
description : 'Path to the root directory of the build'
10-
required : false
11-
java-version :
12-
description : 'The Java version to set up.'
13-
default : '17'
14-
distribution :
15-
description : 'The JDK distribution to use.'
16-
default : 'zulu'
17-
restore-cache-key :
18-
description : 'The unique identifier for the associated cache. Any other consumers or producers for this cache must use the same name.'
19-
default : 'null'
20-
write-cache-key :
21-
description : 'The unique identifier for the associated cache. Any other consumers or producers for this cache must use the same name.'
22-
default : 'null'
4+
inputs:
5+
task:
6+
description: 'Gradle command line arguments (supports multi-line input)'
7+
required: true
8+
build-root-directory:
9+
description: 'Path to the root directory of the build'
10+
required: false
11+
java-version:
12+
description: 'The Java version to set up.'
13+
default: '17'
14+
distribution:
15+
description: 'The JDK distribution to use.'
16+
default: 'zulu'
17+
restore-cache-key:
18+
description: 'The unique identifier for the associated cache. Any other consumers or producers for this cache must use the same name.'
19+
default: 'null'
20+
write-cache-key:
21+
description: 'The unique identifier for the associated cache. Any other consumers or producers for this cache must use the same name.'
22+
default: 'null'
2323

24-
runs :
25-
using : 'composite'
26-
steps :
24+
runs:
25+
using: 'composite'
26+
steps:
2727

28-
- name : Set up JDK
29-
uses : actions/setup-java@387ac29b308b003ca37ba93a6cab5eb57c8f5f93 # v4
30-
with :
31-
distribution : ${{inputs.distribution}}
32-
java-version : ${{inputs.java-version}}
28+
- name: Set up JDK
29+
uses: actions/setup-java@387ac29b308b003ca37ba93a6cab5eb57c8f5f93 # v4
30+
with:
31+
distribution: ${{inputs.distribution}}
32+
java-version: ${{inputs.java-version}}
3333

34-
- name : Set Gradle Args for runner OS
35-
id : gradle-args
36-
uses : ./.github/actions/gradle-args
34+
- name: Set Gradle Args for runner OS
35+
id: gradle-args
36+
uses: ./.github/actions/gradle-args
3737

38-
- name : Gradle build action
39-
uses : gradle/gradle-build-action@29c0906b64b8fc82467890bfb7a0a7ef34bda89e # v3
40-
with :
41-
cache-read-only : false
42-
gradle-home-cache-cleanup : true
38+
- name: Gradle build action
39+
uses: gradle/gradle-build-action@29c0906b64b8fc82467890bfb7a0a7ef34bda89e # v3
40+
with:
41+
cache-read-only: false
42+
gradle-home-cache-cleanup: true
4343

4444
# Calculate all the hashes for keys just one time.
4545
# These should only be referenced before the actual task action, since that action
4646
# may generate changes and we want the final cache key to reflect its current state.
47-
- name : Calculate hashes
48-
id : hashes
47+
- name: Calculate hashes
48+
id: hashes
4949
shell: bash
50-
run : |
50+
run: |
5151
echo "lib_versions=${{ hashFiles('**/libs.versions.toml') }}" >> $GITHUB_OUTPUT
5252
echo "gradle_props=${{ hashFiles('**/gradle.properties') }}" >> $GITHUB_OUTPUT
5353
echo "gradle_kts=${{ hashFiles('**/*.gradle.kts') }}" >> $GITHUB_OUTPUT
@@ -56,74 +56,74 @@ runs :
5656
# Attempt to restore from the write-cache-key, or fall back to a partial match for the write key.
5757
# Skipped if the write-cache-key wasn't set.
5858
# This step's "cache_hit" output will only be true if an exact match was found.
59-
- name : restore cache for ${{inputs.write-cache-key}}
60-
id : restore-write-cache
61-
if : inputs.write-cache-key != 'null'
62-
uses : actions/cache/restore@13aacd865c20de90d75de3b17ebe84f7a17d57d2 # v4
63-
with :
64-
path : |
59+
- name: restore cache for ${{inputs.write-cache-key}}
60+
id: restore-write-cache
61+
if: inputs.write-cache-key != 'null'
62+
uses: actions/cache/restore@13aacd865c20de90d75de3b17ebe84f7a17d57d2 # v4
63+
with:
64+
path: |
6565
~/.gradle/caches/build-cache-1
6666
~/.konan
6767
./**/build/**/!(*.dex)
6868
./**/.gradle
69-
key : ${{runner.os}}-${{inputs.write-cache-key}}-${{steps.hashes.outputs.lib_versions}}-${{steps.hashes.outputs.gradle_props}}-${{steps.hashes.outputs.gradle_kts}}-${{steps.hashes.outputs.src_kt}}
70-
restore-keys : |
69+
key: ${{runner.os}}-${{inputs.write-cache-key}}-${{steps.hashes.outputs.lib_versions}}-${{steps.hashes.outputs.gradle_props}}-${{steps.hashes.outputs.gradle_kts}}-${{steps.hashes.outputs.src_kt}}
70+
restore-keys: |
7171
${{runner.os}}-${{inputs.write-cache-key}}-${{steps.hashes.outputs.lib_versions}}-${{steps.hashes.outputs.gradle_props}}-${{steps.hashes.outputs.gradle_kts}}
7272
${{runner.os}}-${{inputs.write-cache-key}}-${{steps.hashes.outputs.lib_versions}}-${{steps.hashes.outputs.gradle_props}}
7373
${{runner.os}}-${{inputs.write-cache-key}}-${{steps.hashes.outputs.lib_versions}}
7474
${{runner.os}}-${{inputs.write-cache-key}}
7575
7676
# Attempt to restore from the restore-cache-key, or fall back to a partial match for the restore key.
7777
# Skipped if the restore-cache-key wasn't set, or if the write-cache-key restore had an exact match.
78-
- name : restore cache for ${{inputs.restore-cache-key}}
79-
if : inputs.restore-cache-key != 'null' && steps.restore-write-cache.outputs.cache-hit != 'true'
80-
uses : actions/cache/restore@13aacd865c20de90d75de3b17ebe84f7a17d57d2 # v4
81-
with :
82-
path : |
78+
- name: restore cache for ${{inputs.restore-cache-key}}
79+
if: inputs.restore-cache-key != 'null' && steps.restore-write-cache.outputs.cache-hit != 'true'
80+
uses: actions/cache/restore@13aacd865c20de90d75de3b17ebe84f7a17d57d2 # v4
81+
with:
82+
path: |
8383
~/.gradle/caches/build-cache-1
8484
~/.konan
8585
./**/build/**/!(*.dex)
8686
./**/.gradle
87-
key : ${{runner.os}}-${{inputs.restore-cache-key}}-${{steps.hashes.outputs.lib_versions}}-${{steps.hashes.outputs.gradle_props}}-${{steps.hashes.outputs.gradle_kts}}-${{steps.hashes.outputs.src_kt}}
88-
restore-keys : |
87+
key: ${{runner.os}}-${{inputs.restore-cache-key}}-${{steps.hashes.outputs.lib_versions}}-${{steps.hashes.outputs.gradle_props}}-${{steps.hashes.outputs.gradle_kts}}-${{steps.hashes.outputs.src_kt}}
88+
restore-keys: |
8989
${{runner.os}}-${{inputs.restore-cache-key}}-${{steps.hashes.outputs.lib_versions}}-${{steps.hashes.outputs.gradle_props}}-${{steps.hashes.outputs.gradle_kts}}
9090
${{runner.os}}-${{inputs.restore-cache-key}}-${{steps.hashes.outputs.lib_versions}}-${{steps.hashes.outputs.gradle_props}}
9191
${{runner.os}}-${{inputs.restore-cache-key}}-${{steps.hashes.outputs.lib_versions}}
9292
${{runner.os}}-${{inputs.restore-cache-key}}
9393
94-
- uses : gradle/wrapper-validation-action@699bb18358f12c5b78b37bb0111d3a0e2276e0e2 # v2
94+
- uses: gradle/wrapper-validation-action@699bb18358f12c5b78b37bb0111d3a0e2276e0e2 # v2
9595

9696
# Run the actual task. Note that this still uses gradle-build-action for more fine-grained caching.
97-
- name : Run ${{inputs.task}}
98-
uses : gradle/gradle-build-action@29c0906b64b8fc82467890bfb7a0a7ef34bda89e # v3
99-
with :
97+
- name: Run ${{inputs.task}}
98+
uses: gradle/gradle-build-action@29c0906b64b8fc82467890bfb7a0a7ef34bda89e # v3
99+
with:
100100
# These arguments need to be on a single line. If they're defined with wrapping (using `|`),
101101
# something along the way to the actual CLI invocation gets confused and the jvmargs list
102102
# winds up getting parsed as a single argument.
103-
arguments : ${{steps.gradle-args.outputs.gradle-property-args}} ${{inputs.task}} '-Dorg.gradle.jvmargs=${{steps.gradle-args.outputs.gradle-jvm-args}}'
104-
cache-read-only : false
105-
build-root-directory : ${{inputs.build-root-directory}}
106-
gradle-home-cache-cleanup : true
103+
arguments: ${{steps.gradle-args.outputs.gradle-property-args}} ${{inputs.task}} '-Dorg.gradle.jvmargs=${{steps.gradle-args.outputs.gradle-jvm-args}}'
104+
cache-read-only: false
105+
build-root-directory: ${{inputs.build-root-directory}}
106+
gradle-home-cache-cleanup: true
107107

108108
# Save the build cache to `write-cache-key`.
109109
# Skip if we already had an exact match, or if the key is not set, or if this is a Windows runner.
110110
# Windows runners are welcome to *read* the cross-OS cache, but the directories get weird if
111111
# they try to write to it.
112-
- name : save the '${{inputs.write-cache-key}}' cache
113-
uses : actions/cache/save@13aacd865c20de90d75de3b17ebe84f7a17d57d2 # v4
114-
id : save-write-cache-key
115-
if : inputs.write-cache-key != 'null' && steps.restore-write-cache.outputs.cache-hit != 'true'
116-
with :
117-
path : |
112+
- name: save the '${{inputs.write-cache-key}}' cache
113+
uses: actions/cache/save@13aacd865c20de90d75de3b17ebe84f7a17d57d2 # v4
114+
id: save-write-cache-key
115+
if: inputs.write-cache-key != 'null' && steps.restore-write-cache.outputs.cache-hit != 'true'
116+
with:
117+
path: |
118118
~/.gradle/caches/build-cache-1
119119
~/.konan
120120
./**/build/**/!(*.dex)
121121
./**/.gradle
122-
key : ${{runner.os}}-${{inputs.write-cache-key}}-${{hashFiles('**/libs.versions.toml')}}-${{hashFiles('**/gradle.properties')}}-${{hashFiles('**/*.gradle.kts')}}-${{hashFiles('**/src/**/*.kt')}}
122+
key: ${{runner.os}}-${{inputs.write-cache-key}}-${{hashFiles('**/libs.versions.toml')}}-${{hashFiles('**/gradle.properties')}}-${{hashFiles('**/*.gradle.kts')}}-${{hashFiles('**/src/**/*.kt')}}
123123

124-
- name : Upload heap dump
125-
if : failure()
126-
uses : actions/upload-artifact@a8a3f3ad30e3422c9c7b888a15615d19a852ae32 # v3
127-
with :
128-
name : heap-dump
129-
path : ${{github.workspace}}/**/*{.hprof,.log}
124+
- name: Upload heap dump
125+
if: failure()
126+
uses: actions/upload-artifact@v4
127+
with:
128+
name: heap-dump
129+
path: ${{github.workspace}}/**/*{.hprof,.log}

0 commit comments

Comments
 (0)