Skip to content

Commit c620312

Browse files
committed
Replace gradle-cache-action by setup-gradle action
1 parent 3df3aea commit c620312

File tree

4 files changed

+58
-37
lines changed

4 files changed

+58
-37
lines changed

.github/workflows/check-dependency-versions.main.kts

Lines changed: 20 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -25,12 +25,14 @@
2525
@file:Repository("https://bindings.krzeminski.it/")
2626
@file:DependsOn("actions:checkout___major:[v4,v5-alpha)")
2727
@file:DependsOn("actions:setup-java___major:[v4,v5-alpha)")
28-
@file:DependsOn("burrunan:gradle-cache-action___major:[v1,v2-alpha)")
28+
@file:DependsOn("gradle:actions__setup-gradle___major:[v4,v5-alpha)")
2929

3030
import io.github.typesafegithub.workflows.actions.actions.Checkout
3131
import io.github.typesafegithub.workflows.actions.actions.SetupJava
3232
import io.github.typesafegithub.workflows.actions.actions.SetupJava.Distribution.Temurin
33-
import io.github.typesafegithub.workflows.actions.burrunan.GradleCacheAction
33+
import io.github.typesafegithub.workflows.actions.gradle.ActionsSetupGradle
34+
import io.github.typesafegithub.workflows.actions.gradle.ActionsSetupGradle.BuildScanTermsOfUseAgree.Yes
35+
import io.github.typesafegithub.workflows.actions.gradle.ActionsSetupGradle.BuildScanTermsOfUseUrl.HttpsGradleComHelpLegalTermsOfUse
3436
import io.github.typesafegithub.workflows.domain.RunnerType.WindowsLatest
3537
import io.github.typesafegithub.workflows.domain.triggers.Cron
3638
import io.github.typesafegithub.workflows.domain.triggers.Schedule
@@ -79,12 +81,23 @@ workflowWithCopyright(
7981
)
8082
)
8183
uses(
82-
name = "Check Dependency Versions",
83-
action = GradleCacheAction(
84-
arguments = listOf("--show-version", "dependencyUpdates"),
85-
debug = false,
86-
concurrent = true
84+
name = "Setup Gradle",
85+
action = ActionsSetupGradle(
86+
validateWrappers = false,
87+
buildScanPublish = true,
88+
buildScanTermsOfUseUrl = HttpsGradleComHelpLegalTermsOfUse,
89+
buildScanTermsOfUseAgree = Yes
8790
)
8891
)
92+
run(
93+
name = "Check Dependency Versions",
94+
command = listOf(
95+
"./gradlew",
96+
"--info",
97+
"--stacktrace",
98+
"--show-version",
99+
"dependencyUpdates"
100+
).joinToString(" ")
101+
)
89102
}
90103
}

.github/workflows/check-dependency-versions.yaml

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -56,11 +56,13 @@ jobs:
5656
java-version: '11'
5757
distribution: 'temurin'
5858
- id: 'step-3'
59-
name: 'Check Dependency Versions'
60-
uses: 'burrunan/gradle-cache-action@v1'
59+
name: 'Setup Gradle'
60+
uses: 'gradle/actions/setup-gradle@v4'
6161
with:
62-
debug: 'false'
63-
concurrent: 'true'
64-
arguments: |-
65-
--show-version
66-
dependencyUpdates
62+
build-scan-publish: 'true'
63+
build-scan-terms-of-use-url: 'https://gradle.com/help/legal-terms-of-use'
64+
build-scan-terms-of-use-agree: 'yes'
65+
validate-wrappers: 'false'
66+
- id: 'step-4'
67+
name: 'Check Dependency Versions'
68+
run: './gradlew --info --stacktrace --show-version dependencyUpdates'

.github/workflows/test.main.kts

Lines changed: 20 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -27,15 +27,17 @@
2727
@file:DependsOn("actions:cache__save___major:[v4,v5-alpha)")
2828
@file:DependsOn("actions:checkout___major:[v4,v5-alpha)")
2929
@file:DependsOn("actions:setup-java___major:[v4,v5-alpha)")
30-
@file:DependsOn("burrunan:gradle-cache-action___major:[v1,v2-alpha)")
30+
@file:DependsOn("gradle:actions__setup-gradle___major:[v4,v5-alpha)")
3131
@file:DependsOn("Vampire:setup-wsl:RELEASE")
3232

3333
import io.github.typesafegithub.workflows.actions.actions.CacheRestore
3434
import io.github.typesafegithub.workflows.actions.actions.CacheSave
3535
import io.github.typesafegithub.workflows.actions.actions.Checkout
3636
import io.github.typesafegithub.workflows.actions.actions.SetupJava
3737
import io.github.typesafegithub.workflows.actions.actions.SetupJava.Distribution.Temurin
38-
import io.github.typesafegithub.workflows.actions.burrunan.GradleCacheAction
38+
import io.github.typesafegithub.workflows.actions.gradle.ActionsSetupGradle
39+
import io.github.typesafegithub.workflows.actions.gradle.ActionsSetupGradle.BuildScanTermsOfUseAgree.Yes
40+
import io.github.typesafegithub.workflows.actions.gradle.ActionsSetupGradle.BuildScanTermsOfUseUrl.HttpsGradleComHelpLegalTermsOfUse
3941
import io.github.typesafegithub.workflows.actions.vampire.SetupWsl
4042
import io.github.typesafegithub.workflows.actions.vampire.SetupWsl.Distribution.Debian
4143
import io.github.typesafegithub.workflows.actions.vampire.SetupWsl.Distribution.Ubuntu1604
@@ -194,19 +196,24 @@ workflowWithCopyright(
194196
)
195197
)
196198
uses(
197-
name = "Build",
198-
action = GradleCacheAction(
199-
arguments = listOf(
200-
"--show-version",
201-
"build",
202-
"--info",
203-
"--stacktrace",
204-
"--scan"
205-
),
206-
debug = false,
207-
concurrent = true
199+
name = "Setup Gradle",
200+
action = ActionsSetupGradle(
201+
validateWrappers = false,
202+
buildScanPublish = true,
203+
buildScanTermsOfUseUrl = HttpsGradleComHelpLegalTermsOfUse,
204+
buildScanTermsOfUseAgree = Yes
208205
)
209206
)
207+
run(
208+
name = "Build",
209+
command = listOf(
210+
"./gradlew",
211+
"--info",
212+
"--stacktrace",
213+
"--show-version",
214+
"build"
215+
).joinToString(" ")
216+
)
210217
uses(
211218
name = "Save built artifacts to cache",
212219
action = CacheSave(

.github/workflows/test.yaml

Lines changed: 9 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -58,18 +58,17 @@ jobs:
5858
java-version: '11'
5959
distribution: 'temurin'
6060
- id: 'step-3'
61-
name: 'Build'
62-
uses: 'burrunan/gradle-cache-action@v1'
61+
name: 'Setup Gradle'
62+
uses: 'gradle/actions/setup-gradle@v4'
6363
with:
64-
debug: 'false'
65-
concurrent: 'true'
66-
arguments: |-
67-
--show-version
68-
build
69-
--info
70-
--stacktrace
71-
--scan
64+
build-scan-publish: 'true'
65+
build-scan-terms-of-use-url: 'https://gradle.com/help/legal-terms-of-use'
66+
build-scan-terms-of-use-agree: 'yes'
67+
validate-wrappers: 'false'
7268
- id: 'step-4'
69+
name: 'Build'
70+
run: './gradlew --info --stacktrace --show-version build'
71+
- id: 'step-5'
7372
name: 'Save built artifacts to cache'
7473
uses: 'actions/cache/save@v4'
7574
with:

0 commit comments

Comments
 (0)