mirror of
https://github.com/gradle/actions.git
synced 2025-11-26 17:09:10 +08:00
Compare commits
224 Commits
v4.0.0-bet
...
v4.3.0
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
94baf225fe | ||
|
|
6f10c21ec5 | ||
|
|
0b492c475f | ||
|
|
79bad900c0 | ||
|
|
986922f6a6 | ||
|
|
65a3beb941 | ||
|
|
0e67f6d83b | ||
|
|
b6ac71fd86 | ||
|
|
9053a599ae | ||
|
|
7560c304a6 | ||
|
|
dcf3ce7005 | ||
|
|
31f6205373 | ||
|
|
bcc275ce62 | ||
|
|
b693646f93 | ||
|
|
9a0c3c9368 | ||
|
|
6bef8ef2a9 | ||
|
|
91619fae90 | ||
|
|
7569aee516 | ||
|
|
b4009b3946 | ||
|
|
d068148857 | ||
|
|
b426ffebae | ||
|
|
c6e631b4a7 | ||
|
|
edf9e3c8c7 | ||
|
|
ec4681f7f5 | ||
|
|
24aa9155d9 | ||
|
|
74f9fa840c | ||
|
|
8790d96bb8 | ||
|
|
3bfa1140fc | ||
|
|
7749a316b1 | ||
|
|
245c8a24de | ||
|
|
28ab4dff3a | ||
|
|
74628b9f13 | ||
|
|
e4f356955f | ||
|
|
ec1d1bfd5f | ||
|
|
52d4223bcd | ||
|
|
2dec22cf71 | ||
|
|
faf1d7ca7a | ||
|
|
392620bad1 | ||
|
|
e6f332ecb1 | ||
|
|
c9dc8a7709 | ||
|
|
b1155b846e | ||
|
|
8c3e41f260 | ||
|
|
8646c701a9 | ||
|
|
c21133a289 | ||
|
|
bccddaec22 | ||
|
|
7ba6b1c820 | ||
|
|
04f1562da5 | ||
|
|
468d2a43e0 | ||
|
|
d318bd4811 | ||
|
|
c6309b1241 | ||
|
|
fc255bb09d | ||
|
|
0bdd871935 | ||
|
|
34d6b69184 | ||
|
|
21ecf4fc5b | ||
|
|
d9b1f176ee | ||
|
|
5c7e362ae3 | ||
|
|
4213e7826a | ||
|
|
59d7e81070 | ||
|
|
bc78598590 | ||
|
|
9934046c6d | ||
|
|
3839b20885 | ||
|
|
b8ed6d0a14 | ||
|
|
eda5a3331f | ||
|
|
e0281833fa | ||
|
|
b8d9a58677 | ||
|
|
ec885c4918 | ||
|
|
8be3454330 | ||
|
|
f25f0d469f | ||
|
|
69215f1c52 | ||
|
|
df34468a37 | ||
|
|
f984dd99ad | ||
|
|
aef30aae52 | ||
|
|
4c8d89b23d | ||
|
|
088ea2ca03 | ||
|
|
94bb6cf7ce | ||
|
|
ed3e5e5c8a | ||
|
|
ef2fae3749 | ||
|
|
97d952f5cd | ||
|
|
c4b167c4e2 | ||
|
|
7e2474009a | ||
|
|
d0ca1a2b26 | ||
|
|
37bb14cb36 | ||
|
|
06e95bfb12 | ||
|
|
6089ee95bf | ||
|
|
b80eee1bc3 | ||
|
|
51109c9e9e | ||
|
|
bb85ec9597 | ||
|
|
e9e94d8112 | ||
|
|
686515ed83 | ||
|
|
fc2804f7b6 | ||
|
|
ce25fde741 | ||
|
|
1c71d2134f | ||
|
|
35af9b8791 | ||
|
|
375738a38b | ||
|
|
00781cbaae | ||
|
|
2894ab49ef | ||
|
|
4ba34e96c5 | ||
|
|
e29bc6725a | ||
|
|
cc4fc85e6b | ||
|
|
e6a814661a | ||
|
|
e55599fc4d | ||
|
|
d85b0068a7 | ||
|
|
a09a3104fe | ||
|
|
333e9d9750 | ||
|
|
2aa49bf6a9 | ||
|
|
9ab6ee6757 | ||
|
|
fb5165dcd4 | ||
|
|
0e27ea7e6c | ||
|
|
f4845d289c | ||
|
|
094f2191c5 | ||
|
|
83709b49fe | ||
|
|
5f21a9bb99 | ||
|
|
52ee405746 | ||
|
|
7f20d0bf71 | ||
|
|
b6bc8c2f17 | ||
|
|
b12c3a65f2 | ||
|
|
d191577859 | ||
|
|
e726a12472 | ||
|
|
d30cc9ecf2 | ||
|
|
d0efa7b0e7 | ||
|
|
8422a6a674 | ||
|
|
19ff74e0a6 | ||
|
|
e03a1f068e | ||
|
|
084b95f65a | ||
|
|
1e2142185e | ||
|
|
07e0f1c008 | ||
|
|
af45dcfe3c | ||
|
|
d8b3a9fb11 | ||
|
|
9e8f2bcf56 | ||
|
|
5ac3e361a2 | ||
|
|
4a0951b3dc | ||
|
|
48353a25ca | ||
|
|
473878a77f | ||
|
|
f22ac61fd1 | ||
|
|
4ec844e551 | ||
|
|
24ca383271 | ||
|
|
4ca2d5d749 | ||
|
|
f31476bde2 | ||
|
|
c345cfbe93 | ||
|
|
b526f6673b | ||
|
|
93415e6645 | ||
|
|
6bc218d5d0 | ||
|
|
9d68e8b435 | ||
|
|
707359876a | ||
|
|
4103f31d4d | ||
|
|
15020cf347 | ||
|
|
ed43923279 | ||
|
|
6dafcf2d22 | ||
|
|
2ca30c9a83 | ||
|
|
bb0c460cbf | ||
|
|
0674891af5 | ||
|
|
1b7e89588d | ||
|
|
b0cc090202 | ||
|
|
872d6b954c | ||
|
|
61e4a25782 | ||
|
|
f4e0ea0cdd | ||
|
|
9f70748719 | ||
|
|
ff4a71656f | ||
|
|
b5e8e5f396 | ||
|
|
7605d180a5 | ||
|
|
d32c4bdc08 | ||
|
|
0d30c9111c | ||
|
|
cf8c435260 | ||
|
|
b4c01c399c | ||
|
|
340f8b64e0 | ||
|
|
36455cb5f4 | ||
|
|
e5c1381176 | ||
|
|
d156388eb1 | ||
|
|
2e93f415f7 | ||
|
|
ee8dc905e6 | ||
|
|
5fe9264c08 | ||
|
|
29d4d80ef6 | ||
|
|
478782dbb4 | ||
|
|
e6215edc51 | ||
|
|
765a73447c | ||
|
|
a122cf5aa7 | ||
|
|
5baa1ded34 | ||
|
|
7e0f050645 | ||
|
|
9291ac6ca5 | ||
|
|
6da85a08fb | ||
|
|
c3c8a18b22 | ||
|
|
9498413fd8 | ||
|
|
16bf8bc8fe | ||
|
|
faf4eeacd5 | ||
|
|
4b7cc6e174 | ||
|
|
0873530e60 | ||
|
|
f67327f0c8 | ||
|
|
d32a10b3ae | ||
|
|
e598a32529 | ||
|
|
d6c8cf816c | ||
|
|
79ea5b8f3e | ||
|
|
d77a030aaf | ||
|
|
a8a2fd2323 | ||
|
|
089bfb1063 | ||
|
|
ca7f3fa2f5 | ||
|
|
1c29763ff7 | ||
|
|
1bc1a6c922 | ||
|
|
b51fcf4d6c | ||
|
|
82758ea0fa | ||
|
|
835367424c | ||
|
|
1ac097f44e | ||
|
|
60851f5fb2 | ||
|
|
e7551dc2a9 | ||
|
|
e482045599 | ||
|
|
631bcacd15 | ||
|
|
d724da5563 | ||
|
|
228ce9b15b | ||
|
|
64869b1757 | ||
|
|
0b404a7148 | ||
|
|
4cb1dc0963 | ||
|
|
1eb9607ae7 | ||
|
|
a5a9e731f3 | ||
|
|
add58192d1 | ||
|
|
9edf610422 | ||
|
|
b1833c4c90 | ||
|
|
895252588e | ||
|
|
af1da67850 | ||
|
|
f8ba43cf0a | ||
|
|
bcd07e6643 | ||
|
|
d74ee73e9f | ||
|
|
fb2e6938b6 | ||
|
|
07190022f8 | ||
|
|
ac3aebda93 | ||
|
|
d473db0899 |
4
.github/actions/build-dist/action.yml
vendored
4
.github/actions/build-dist/action.yml
vendored
@@ -3,7 +3,7 @@ name: 'Build and upload distribution'
|
||||
runs:
|
||||
using: "composite"
|
||||
steps:
|
||||
- uses: actions/setup-node@v4
|
||||
- uses: actions/setup-node@1d0ff469b7ec7b3cb9d8673fde0c81c44821de2a # v4.2.0
|
||||
with:
|
||||
node-version: 20
|
||||
cache: npm
|
||||
@@ -23,7 +23,7 @@ runs:
|
||||
cp -r sources/dist .
|
||||
|
||||
- name: Upload distribution
|
||||
uses: actions/upload-artifact@v4
|
||||
uses: actions/upload-artifact@65c4c4a1ddee5b72f698fdd19549f0f0fb45cf08 # v4.6.0
|
||||
with:
|
||||
name: dist
|
||||
path: dist/
|
||||
|
||||
4
.github/actions/init-integ-test/action.yml
vendored
4
.github/actions/init-integ-test/action.yml
vendored
@@ -4,7 +4,7 @@ runs:
|
||||
using: "composite"
|
||||
steps:
|
||||
- name: Setup Java
|
||||
uses: actions/setup-java@v4
|
||||
uses: actions/setup-java@7a6d8a8234af8eb26422e24e3006232cccaa061b # v4.6.0
|
||||
with:
|
||||
distribution: 'temurin'
|
||||
java-version: 11
|
||||
@@ -17,7 +17,7 @@ runs:
|
||||
# Downloads a 'dist' directory artifact that was uploaded in an earlier 'build-dist' step
|
||||
- name: Download dist
|
||||
if: ${{ env.SKIP_DIST != 'true' && !env.ACT }}
|
||||
uses: actions/download-artifact@v4
|
||||
uses: actions/download-artifact@fa0a91b85d4f404e444e00e005971372dc801d16 # v4.1.8
|
||||
with:
|
||||
name: dist
|
||||
path: dist/
|
||||
|
||||
77
.github/dependabot.yml
vendored
77
.github/dependabot.yml
vendored
@@ -5,6 +5,7 @@ registries:
|
||||
url: https://plugins.gradle.org/m2
|
||||
username: dummy # Required by dependabot
|
||||
password: dummy # Required by dependabot
|
||||
|
||||
updates:
|
||||
- package-ecosystem: "npm"
|
||||
directory: "/sources"
|
||||
@@ -16,25 +17,12 @@ updates:
|
||||
- "*"
|
||||
|
||||
- package-ecosystem: "github-actions"
|
||||
directory: "/"
|
||||
schedule:
|
||||
interval: "weekly"
|
||||
groups:
|
||||
github-actions:
|
||||
patterns:
|
||||
- "*"
|
||||
# github-actions with directory: "/" only monitors .github/workflows
|
||||
# https://github.com/dependabot/dependabot-core/issues/6345
|
||||
- package-ecosystem: "github-actions"
|
||||
directory: "/.github/actions/build-dist"
|
||||
schedule:
|
||||
interval: "weekly"
|
||||
groups:
|
||||
github-actions:
|
||||
patterns:
|
||||
- "*"
|
||||
- package-ecosystem: "github-actions"
|
||||
directory: "/.github/actions/init-integ-test"
|
||||
# github-actions with directory: "/" only monitors .github/workflows
|
||||
# https://github.com/dependabot/dependabot-core/issues/6345
|
||||
directories:
|
||||
- "/"
|
||||
- "/.github/actions/build-dist"
|
||||
- "/.github/actions/init-integ-test"
|
||||
schedule:
|
||||
interval: "weekly"
|
||||
groups:
|
||||
@@ -43,44 +31,19 @@ updates:
|
||||
- "*"
|
||||
|
||||
- package-ecosystem: "gradle"
|
||||
directory: ".github/workflow-samples/gradle-plugin"
|
||||
directories:
|
||||
- ".github/workflow-samples/gradle-plugin"
|
||||
- ".github/workflow-samples/groovy-dsl"
|
||||
- ".github/workflow-samples/java-toolchain"
|
||||
- ".github/workflow-samples/kotlin-dsl"
|
||||
- ".github/workflow-samples/no-wrapper"
|
||||
- ".github/workflow-samples/no-wrapper-gradle-5"
|
||||
- "sources/test/init-scripts"
|
||||
registries:
|
||||
- gradle-plugin-portal
|
||||
schedule:
|
||||
interval: "daily"
|
||||
- package-ecosystem: "gradle"
|
||||
directory: ".github/workflow-samples/groovy-dsl"
|
||||
registries:
|
||||
- gradle-plugin-portal
|
||||
schedule:
|
||||
interval: "daily"
|
||||
- package-ecosystem: "gradle"
|
||||
directory: ".github/workflow-samples/java-toolchain"
|
||||
registries:
|
||||
- gradle-plugin-portal
|
||||
schedule:
|
||||
interval: "daily"
|
||||
- package-ecosystem: "gradle"
|
||||
directory: ".github/workflow-samples/kotlin-dsl"
|
||||
registries:
|
||||
- gradle-plugin-portal
|
||||
schedule:
|
||||
interval: "daily"
|
||||
- package-ecosystem: "gradle"
|
||||
directory: ".github/workflow-samples/no-wrapper"
|
||||
registries:
|
||||
- gradle-plugin-portal
|
||||
schedule:
|
||||
interval: "daily"
|
||||
- package-ecosystem: "gradle"
|
||||
directory: ".github/workflow-samples/no-wrapper-gradle-5"
|
||||
registries:
|
||||
- gradle-plugin-portal
|
||||
schedule:
|
||||
interval: "daily"
|
||||
- package-ecosystem: "gradle"
|
||||
directory: "sources/test/init-scripts"
|
||||
registries:
|
||||
- gradle-plugin-portal
|
||||
schedule:
|
||||
interval: "daily"
|
||||
interval: "weekly"
|
||||
groups:
|
||||
gradle:
|
||||
patterns:
|
||||
- "*"
|
||||
|
||||
Binary file not shown.
@@ -1,7 +1,7 @@
|
||||
distributionBase=GRADLE_USER_HOME
|
||||
distributionPath=wrapper/dists
|
||||
distributionSha256Sum=d725d707bfabd4dfdc958c624003b3c80accc03f7037b5122c4b1d0ef15cecab
|
||||
distributionUrl=https\://services.gradle.org/distributions/gradle-8.9-bin.zip
|
||||
distributionSha256Sum=8d97a97984f6cbd2b85fe4c60a743440a347544bf18818048e611f5288d46c94
|
||||
distributionUrl=https\://services.gradle.org/distributions/gradle-8.12.1-bin.zip
|
||||
networkTimeout=10000
|
||||
validateDistributionUrl=true
|
||||
zipStoreBase=GRADLE_USER_HOME
|
||||
|
||||
@@ -86,8 +86,7 @@ done
|
||||
# shellcheck disable=SC2034
|
||||
APP_BASE_NAME=${0##*/}
|
||||
# Discard cd standard output in case $CDPATH is set (https://github.com/gradle/gradle/issues/25036)
|
||||
APP_HOME=$( cd -P "${APP_HOME:-./}" > /dev/null && printf '%s
|
||||
' "$PWD" ) || exit
|
||||
APP_HOME=$( cd -P "${APP_HOME:-./}" > /dev/null && printf '%s\n' "$PWD" ) || exit
|
||||
|
||||
# Use the maximum available, or set MAX_FD != -1 to use that value.
|
||||
MAX_FD=maximum
|
||||
|
||||
Binary file not shown.
@@ -1,7 +1,7 @@
|
||||
distributionBase=GRADLE_USER_HOME
|
||||
distributionPath=wrapper/dists
|
||||
distributionSha256Sum=d725d707bfabd4dfdc958c624003b3c80accc03f7037b5122c4b1d0ef15cecab
|
||||
distributionUrl=https\://services.gradle.org/distributions/gradle-8.9-bin.zip
|
||||
distributionSha256Sum=8d97a97984f6cbd2b85fe4c60a743440a347544bf18818048e611f5288d46c94
|
||||
distributionUrl=https\://services.gradle.org/distributions/gradle-8.12.1-bin.zip
|
||||
networkTimeout=10000
|
||||
validateDistributionUrl=true
|
||||
zipStoreBase=GRADLE_USER_HOME
|
||||
|
||||
3
.github/workflow-samples/groovy-dsl/gradlew
vendored
3
.github/workflow-samples/groovy-dsl/gradlew
vendored
@@ -86,8 +86,7 @@ done
|
||||
# shellcheck disable=SC2034
|
||||
APP_BASE_NAME=${0##*/}
|
||||
# Discard cd standard output in case $CDPATH is set (https://github.com/gradle/gradle/issues/25036)
|
||||
APP_HOME=$( cd -P "${APP_HOME:-./}" > /dev/null && printf '%s
|
||||
' "$PWD" ) || exit
|
||||
APP_HOME=$( cd -P "${APP_HOME:-./}" > /dev/null && printf '%s\n' "$PWD" ) || exit
|
||||
|
||||
# Use the maximum available, or set MAX_FD != -1 to use that value.
|
||||
MAX_FD=maximum
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
plugins {
|
||||
id "com.gradle.develocity" version "3.17.6"
|
||||
id "com.gradle.common-custom-user-data-gradle-plugin" version "2.0.1"
|
||||
id "com.gradle.develocity" version "3.19.1"
|
||||
id "com.gradle.common-custom-user-data-gradle-plugin" version "2.1"
|
||||
}
|
||||
|
||||
develocity {
|
||||
|
||||
Binary file not shown.
@@ -1,7 +1,7 @@
|
||||
distributionBase=GRADLE_USER_HOME
|
||||
distributionPath=wrapper/dists
|
||||
distributionSha256Sum=d725d707bfabd4dfdc958c624003b3c80accc03f7037b5122c4b1d0ef15cecab
|
||||
distributionUrl=https\://services.gradle.org/distributions/gradle-8.9-bin.zip
|
||||
distributionSha256Sum=8d97a97984f6cbd2b85fe4c60a743440a347544bf18818048e611f5288d46c94
|
||||
distributionUrl=https\://services.gradle.org/distributions/gradle-8.12.1-bin.zip
|
||||
networkTimeout=10000
|
||||
validateDistributionUrl=true
|
||||
zipStoreBase=GRADLE_USER_HOME
|
||||
|
||||
@@ -86,8 +86,7 @@ done
|
||||
# shellcheck disable=SC2034
|
||||
APP_BASE_NAME=${0##*/}
|
||||
# Discard cd standard output in case $CDPATH is set (https://github.com/gradle/gradle/issues/25036)
|
||||
APP_HOME=$( cd -P "${APP_HOME:-./}" > /dev/null && printf '%s
|
||||
' "$PWD" ) || exit
|
||||
APP_HOME=$( cd -P "${APP_HOME:-./}" > /dev/null && printf '%s\n' "$PWD" ) || exit
|
||||
|
||||
# Use the maximum available, or set MAX_FD != -1 to use that value.
|
||||
MAX_FD=maximum
|
||||
|
||||
@@ -8,9 +8,9 @@ repositories {
|
||||
|
||||
dependencies {
|
||||
api("org.apache.commons:commons-math3:3.6.1")
|
||||
implementation("com.google.guava:guava:33.2.1-jre")
|
||||
implementation("com.google.guava:guava:33.4.0-jre")
|
||||
|
||||
testImplementation("org.junit.jupiter:junit-jupiter:5.10.3")
|
||||
testImplementation("org.junit.jupiter:junit-jupiter:5.11.4")
|
||||
}
|
||||
|
||||
tasks.test {
|
||||
|
||||
Binary file not shown.
@@ -1,7 +1,7 @@
|
||||
distributionBase=GRADLE_USER_HOME
|
||||
distributionPath=wrapper/dists
|
||||
distributionSha256Sum=d725d707bfabd4dfdc958c624003b3c80accc03f7037b5122c4b1d0ef15cecab
|
||||
distributionUrl=https\://services.gradle.org/distributions/gradle-8.9-bin.zip
|
||||
distributionSha256Sum=8d97a97984f6cbd2b85fe4c60a743440a347544bf18818048e611f5288d46c94
|
||||
distributionUrl=https\://services.gradle.org/distributions/gradle-8.12.1-bin.zip
|
||||
networkTimeout=10000
|
||||
validateDistributionUrl=true
|
||||
zipStoreBase=GRADLE_USER_HOME
|
||||
|
||||
3
.github/workflow-samples/kotlin-dsl/gradlew
vendored
3
.github/workflow-samples/kotlin-dsl/gradlew
vendored
@@ -86,8 +86,7 @@ done
|
||||
# shellcheck disable=SC2034
|
||||
APP_BASE_NAME=${0##*/}
|
||||
# Discard cd standard output in case $CDPATH is set (https://github.com/gradle/gradle/issues/25036)
|
||||
APP_HOME=$( cd -P "${APP_HOME:-./}" > /dev/null && printf '%s
|
||||
' "$PWD" ) || exit
|
||||
APP_HOME=$( cd -P "${APP_HOME:-./}" > /dev/null && printf '%s\n' "$PWD" ) || exit
|
||||
|
||||
# Use the maximum available, or set MAX_FD != -1 to use that value.
|
||||
MAX_FD=maximum
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
plugins {
|
||||
id("com.gradle.develocity") version "3.17.6"
|
||||
id("com.gradle.common-custom-user-data-gradle-plugin") version "2.0.1"
|
||||
id("com.gradle.develocity") version "3.19.1"
|
||||
id("com.gradle.common-custom-user-data-gradle-plugin") version "2.1"
|
||||
}
|
||||
|
||||
develocity {
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
plugins {
|
||||
id "com.gradle.develocity" version "3.17.6"
|
||||
id "com.gradle.develocity" version "3.19.1"
|
||||
}
|
||||
|
||||
develocity {
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
plugins {
|
||||
id "com.gradle.develocity" version "3.17.6"
|
||||
id "com.gradle.develocity" version "3.19.1"
|
||||
}
|
||||
|
||||
develocity {
|
||||
|
||||
Binary file not shown.
@@ -1,7 +1,7 @@
|
||||
distributionBase=GRADLE_USER_HOME
|
||||
distributionPath=wrapper/dists
|
||||
distributionSha256Sum=d725d707bfabd4dfdc958c624003b3c80accc03f7037b5122c4b1d0ef15cecab
|
||||
distributionUrl=https\://services.gradle.org/distributions/gradle-8.9-bin.zip
|
||||
distributionSha256Sum=57dafb5c2622c6cc08b993c85b7c06956a2f53536432a30ead46166dbca0f1e9
|
||||
distributionUrl=https\://services.gradle.org/distributions/gradle-8.11-bin.zip
|
||||
networkTimeout=10000
|
||||
validateDistributionUrl=true
|
||||
zipStoreBase=GRADLE_USER_HOME
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
plugins {
|
||||
id "com.gradle.develocity" version "3.17.6"
|
||||
id "com.gradle.develocity" version "3.19.1"
|
||||
}
|
||||
|
||||
develocity {
|
||||
|
||||
27
.github/workflows/ci-check-and-unit-test.yml
vendored
27
.github/workflows/ci-check-and-unit-test.yml
vendored
@@ -15,22 +15,43 @@ permissions:
|
||||
jobs:
|
||||
check-format-and-unit-test:
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
steps:
|
||||
- name: Checkout sources
|
||||
uses: actions/checkout@v4
|
||||
- uses: actions/setup-node@v4
|
||||
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
|
||||
- uses: actions/setup-node@1d0ff469b7ec7b3cb9d8673fde0c81c44821de2a # v4.2.0
|
||||
with:
|
||||
node-version: 20
|
||||
cache: npm
|
||||
cache-dependency-path: sources/package-lock.json
|
||||
- name: Setup Gradle
|
||||
# Use a released version to avoid breakages
|
||||
uses: gradle/actions/setup-gradle@0bdd871935719febd78681f197cd39af5b6e16a6 # v4.2.2
|
||||
env:
|
||||
ALLOWED_GRADLE_WRAPPER_CHECKSUMS: e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855 # Invalid wrapper jar used for testing
|
||||
with:
|
||||
gradle-version: "8.12.1"
|
||||
|
||||
- name: Install npm dependencies
|
||||
run: |
|
||||
npm clean-install
|
||||
working-directory: sources
|
||||
|
||||
- name: Check formatting and compile
|
||||
run: |
|
||||
npm install
|
||||
npm run check
|
||||
npm run compile
|
||||
working-directory: sources
|
||||
env:
|
||||
NODE_OPTIONS: '-r @gradle/develocity-agent/preload'
|
||||
DEVELOCITY_URL: 'https://ge.solutions-team.gradle.com'
|
||||
DEVELOCITY_ACCESS_KEY: '${{ secrets.DV_SOLUTIONS_ACCESS_KEY }}'
|
||||
|
||||
- name: Run unit tests
|
||||
run: |
|
||||
npm test
|
||||
working-directory: sources
|
||||
env:
|
||||
NODE_OPTIONS: '-r @gradle/develocity-agent/preload'
|
||||
DEVELOCITY_URL: 'https://ge.solutions-team.gradle.com'
|
||||
DEVELOCITY_ACCESS_KEY: '${{ secrets.DV_SOLUTIONS_ACCESS_KEY }}'
|
||||
|
||||
@@ -15,13 +15,13 @@ jobs:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Checkout sources
|
||||
uses: actions/checkout@v4
|
||||
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
|
||||
with:
|
||||
fetch-depth: 0
|
||||
|
||||
- name: Get changed files
|
||||
id: changed-files
|
||||
uses: tj-actions/changed-files@v44
|
||||
uses: tj-actions/changed-files@d6e91a2266cdb9d62096cebf1e8546899c6aa18f # v45.0.6
|
||||
with:
|
||||
files: |
|
||||
dist/**
|
||||
|
||||
13
.github/workflows/ci-codeql.yml
vendored
13
.github/workflows/ci-codeql.yml
vendored
@@ -6,16 +6,15 @@ on:
|
||||
- 'main'
|
||||
- 'release/**'
|
||||
- 'dev/**' # Allow running Code QL on dev branches without a PR
|
||||
paths-ignore:
|
||||
- 'dist/**'
|
||||
pull_request:
|
||||
branches:
|
||||
- 'main'
|
||||
paths-ignore:
|
||||
- 'dist/**'
|
||||
schedule:
|
||||
- cron: '25 23 * * 2'
|
||||
|
||||
permissions:
|
||||
contents: read
|
||||
|
||||
jobs:
|
||||
analyze:
|
||||
name: Analyze
|
||||
@@ -32,11 +31,11 @@ jobs:
|
||||
|
||||
steps:
|
||||
- name: Checkout repository
|
||||
uses: actions/checkout@v4
|
||||
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
|
||||
|
||||
# Initializes the CodeQL tools for scanning.
|
||||
- name: Initialize CodeQL
|
||||
uses: github/codeql-action/init@v3
|
||||
uses: github/codeql-action/init@17a820bf2e43b47be2c72b39cc905417bc1ab6d0 # v3.28.6
|
||||
with:
|
||||
languages: ${{ matrix.language }}
|
||||
config: |
|
||||
@@ -44,4 +43,4 @@ jobs:
|
||||
- sources/src
|
||||
|
||||
- name: Perform CodeQL Analysis
|
||||
uses: github/codeql-action/analyze@v3
|
||||
uses: github/codeql-action/analyze@17a820bf2e43b47be2c72b39cc905417bc1ab6d0 # v3.28.6
|
||||
|
||||
24
.github/workflows/ci-combine-bot-prs.yml
vendored
Normal file
24
.github/workflows/ci-combine-bot-prs.yml
vendored
Normal file
@@ -0,0 +1,24 @@
|
||||
name: Combine Bot PRs
|
||||
|
||||
on:
|
||||
workflow_dispatch:
|
||||
|
||||
permissions:
|
||||
contents: read
|
||||
|
||||
jobs:
|
||||
combine-wrapperbot-prs:
|
||||
permissions:
|
||||
contents: write
|
||||
pull-requests: write
|
||||
checks: read
|
||||
if: github.repository == 'gradle/actions'
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: combine-wrapperbot-prs
|
||||
uses: github/combine-prs@2909f404763c3177a456e052bdb7f2e85d3a7cb3 # v5.2.0
|
||||
with:
|
||||
branch_prefix: wrapperbot
|
||||
combine_branch_name: wrapperbot/combined-wrapper-updates
|
||||
pr_title: 'Bump Gradle Wrappers'
|
||||
ci_required: "false"
|
||||
12
.github/workflows/ci-init-script-check.yml
vendored
12
.github/workflows/ci-init-script-check.yml
vendored
@@ -14,19 +14,25 @@ on:
|
||||
- 'sources/test/init-scripts/**'
|
||||
workflow_dispatch:
|
||||
|
||||
permissions:
|
||||
contents: read
|
||||
|
||||
jobs:
|
||||
test-init-scripts:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Checkout sources
|
||||
uses: actions/checkout@v4
|
||||
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
|
||||
- name: Setup Java
|
||||
uses: actions/setup-java@v4
|
||||
uses: actions/setup-java@7a6d8a8234af8eb26422e24e3006232cccaa061b # v4.6.0
|
||||
with:
|
||||
distribution: temurin
|
||||
java-version: 11
|
||||
- name: Setup Gradle
|
||||
uses: gradle/actions/setup-gradle@v3 # Use a released version to avoid breakages
|
||||
# Use a released version to avoid breakages
|
||||
uses: gradle/actions/setup-gradle@0bdd871935719febd78681f197cd39af5b6e16a6 # v4.2.2
|
||||
env:
|
||||
ALLOWED_GRADLE_WRAPPER_CHECKSUMS: e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855 # Invalid wrapper jar used for testing
|
||||
- name: Run integration tests
|
||||
working-directory: sources/test/init-scripts
|
||||
run: ./gradlew check
|
||||
|
||||
39
.github/workflows/ci-integ-test-full.yml
vendored
Normal file
39
.github/workflows/ci-integ-test-full.yml
vendored
Normal file
@@ -0,0 +1,39 @@
|
||||
name: CI-integ-test-full
|
||||
|
||||
on:
|
||||
workflow_dispatch:
|
||||
push:
|
||||
branches:
|
||||
- 'main'
|
||||
paths:
|
||||
- 'dist/**'
|
||||
|
||||
concurrency:
|
||||
group: integ-test
|
||||
cancel-in-progress: false
|
||||
|
||||
permissions:
|
||||
contents: read
|
||||
|
||||
jobs:
|
||||
caching-integ-tests:
|
||||
uses: ./.github/workflows/suite-integ-test-caching.yml
|
||||
concurrency:
|
||||
group: CI-integ-test-full
|
||||
cancel-in-progress: false
|
||||
with:
|
||||
runner-os: '["ubuntu-latest", "windows-latest", "macos-latest"]'
|
||||
skip-dist: true
|
||||
secrets: inherit
|
||||
|
||||
other-integ-tests:
|
||||
permissions:
|
||||
contents: write
|
||||
uses: ./.github/workflows/suite-integ-test-other.yml
|
||||
concurrency:
|
||||
group: CI-integ-test-full
|
||||
cancel-in-progress: false
|
||||
with:
|
||||
runner-os: '["ubuntu-latest", "windows-latest", "macos-latest"]'
|
||||
skip-dist: true
|
||||
secrets: inherit
|
||||
191
.github/workflows/ci-integ-test.yml
vendored
191
.github/workflows/ci-integ-test.yml
vendored
@@ -8,195 +8,38 @@ on:
|
||||
- 'main'
|
||||
- 'release/**'
|
||||
- 'dev/**' # Allow running tests on dev branches without a PR
|
||||
paths-ignore:
|
||||
- 'dist/**'
|
||||
|
||||
concurrency:
|
||||
group: integ-tests-${{ github.ref }}
|
||||
group: integ-test
|
||||
cancel-in-progress: false
|
||||
|
||||
permissions:
|
||||
contents: read
|
||||
|
||||
jobs:
|
||||
determine-suite:
|
||||
runs-on: ubuntu-latest
|
||||
outputs:
|
||||
runner-os: ${{ steps.determine-suite.outputs.suite == 'quick' && '["ubuntu-latest"]' || '["ubuntu-latest", "windows-latest", "macos-latest"]' }}
|
||||
cache-key-prefix: '0' # TODO DAZ Try this again ${{ steps.determine-suite.outputs.suite == 'quick' && '0' || github.run_number }}
|
||||
suite: ${{ steps.determine-suite.outputs.suite }}
|
||||
steps:
|
||||
- name: Determine suite to run
|
||||
id: determine-suite
|
||||
run: |
|
||||
# Always run quick suite if we are not in the core `gradle/actions` repository
|
||||
# This reduces the load for developers working on 'main' on forks
|
||||
if [ "${{ github.repository }}" != "gradle/actions" ]; then
|
||||
echo "Not in core repository: suite=quick"
|
||||
echo "suite=quick" >> "$GITHUB_OUTPUT"
|
||||
exit 0
|
||||
fi
|
||||
|
||||
# Run full suite for push trigger with "[bot] Update dist directory" commit message
|
||||
if [ "${{ github.event.head_commit.message }}" == "[bot] Update dist directory" ]; then
|
||||
echo "Bot commit to main branch: suite=full"
|
||||
echo "suite=full" >> "$GITHUB_OUTPUT"
|
||||
exit 0
|
||||
fi
|
||||
|
||||
# Run quick suite for everything else
|
||||
echo "Everything else: suite=quick"
|
||||
echo "suite=quick" >> "$GITHUB_OUTPUT"
|
||||
|
||||
build-distribution:
|
||||
needs: [determine-suite]
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Checkout sources
|
||||
uses: actions/checkout@v4
|
||||
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
|
||||
- name: Build and upload distribution
|
||||
if: ${{ needs.determine-suite.outputs.suite != 'full' }}
|
||||
uses: ./.github/actions/build-dist
|
||||
|
||||
build-scan-publish:
|
||||
needs: [determine-suite, build-distribution]
|
||||
uses: ./.github/workflows/integ-test-build-scan-publish.yml
|
||||
caching-integ-tests:
|
||||
needs: build-distribution
|
||||
uses: ./.github/workflows/suite-integ-test-caching.yml
|
||||
with:
|
||||
runner-os: '${{ needs.determine-suite.outputs.runner-os }}'
|
||||
cache-key-prefix: '${{ needs.determine-suite.outputs.cache-key-prefix }}-'
|
||||
skip-dist: ${{ needs.determine-suite.outputs.suite == 'full' }}
|
||||
skip-dist: false
|
||||
secrets: inherit
|
||||
|
||||
cache-cleanup:
|
||||
needs: [determine-suite, build-distribution]
|
||||
uses: ./.github/workflows/integ-test-cache-cleanup.yml
|
||||
with:
|
||||
runner-os: '${{ needs.determine-suite.outputs.runner-os }}'
|
||||
cache-key-prefix: '${{ needs.determine-suite.outputs.suite}}-${{github.run_number}}-' # Requires a fresh cache entry each run
|
||||
skip-dist: ${{ needs.determine-suite.outputs.suite == 'full' }}
|
||||
|
||||
caching-config:
|
||||
needs: [determine-suite, build-distribution]
|
||||
uses: ./.github/workflows/integ-test-caching-config.yml
|
||||
with:
|
||||
runner-os: '${{ needs.determine-suite.outputs.runner-os }}'
|
||||
cache-key-prefix: '${{ needs.determine-suite.outputs.cache-key-prefix }}-'
|
||||
skip-dist: ${{ needs.determine-suite.outputs.suite == 'full' }}
|
||||
|
||||
dependency-graph:
|
||||
if: ${{ ! github.event.pull_request.head.repo.fork }}
|
||||
needs: [determine-suite, build-distribution]
|
||||
uses: ./.github/workflows/integ-test-dependency-graph.yml
|
||||
other-integ-tests:
|
||||
permissions:
|
||||
contents: write
|
||||
needs: build-distribution
|
||||
uses: ./.github/workflows/suite-integ-test-other.yml
|
||||
with:
|
||||
runner-os: '${{ needs.determine-suite.outputs.runner-os }}'
|
||||
cache-key-prefix: '${{ needs.determine-suite.outputs.cache-key-prefix }}-'
|
||||
skip-dist: ${{ needs.determine-suite.outputs.suite == 'full' }}
|
||||
|
||||
dependency-submission:
|
||||
if: ${{ ! github.event.pull_request.head.repo.fork }}
|
||||
needs: [determine-suite, build-distribution]
|
||||
uses: ./.github/workflows/integ-test-dependency-submission.yml
|
||||
permissions:
|
||||
contents: write
|
||||
with:
|
||||
runner-os: '${{ needs.determine-suite.outputs.runner-os }}'
|
||||
cache-key-prefix: '${{ needs.determine-suite.outputs.cache-key-prefix }}-'
|
||||
skip-dist: ${{ needs.determine-suite.outputs.suite == 'full' }}
|
||||
|
||||
dependency-submission-failures:
|
||||
if: ${{ ! github.event.pull_request.head.repo.fork }}
|
||||
needs: [determine-suite, build-distribution]
|
||||
uses: ./.github/workflows/integ-test-dependency-submission-failures.yml
|
||||
permissions:
|
||||
contents: write
|
||||
with:
|
||||
runner-os: '${{ needs.determine-suite.outputs.runner-os }}'
|
||||
cache-key-prefix: '${{ needs.determine-suite.outputs.cache-key-prefix }}-'
|
||||
skip-dist: ${{ needs.determine-suite.outputs.suite == 'full' }}
|
||||
|
||||
develocity-injection:
|
||||
if: ${{ ! github.event.pull_request.head.repo.fork }}
|
||||
needs: [determine-suite, build-distribution]
|
||||
uses: ./.github/workflows/integ-test-inject-develocity.yml
|
||||
with:
|
||||
runner-os: '["ubuntu-latest"]'
|
||||
cache-key-prefix: '${{ needs.determine-suite.outputs.cache-key-prefix }}-'
|
||||
skip-dist: ${{ needs.determine-suite.outputs.suite == 'full' }}
|
||||
secrets:
|
||||
DEVELOCITY_ACCESS_KEY: ${{ secrets.DV_SOLUTIONS_ACCESS_KEY }}
|
||||
|
||||
provision-gradle-versions:
|
||||
needs: [determine-suite, build-distribution]
|
||||
uses: ./.github/workflows/integ-test-provision-gradle-versions.yml
|
||||
with:
|
||||
runner-os: '["ubuntu-latest"]'
|
||||
cache-key-prefix: '${{ needs.determine-suite.outputs.cache-key-prefix }}-'
|
||||
skip-dist: ${{ needs.determine-suite.outputs.suite == 'full' }}
|
||||
|
||||
restore-configuration-cache:
|
||||
if: ${{ ! github.event.pull_request.head.repo.fork }}
|
||||
needs: [determine-suite, build-distribution]
|
||||
uses: ./.github/workflows/integ-test-restore-configuration-cache.yml
|
||||
with:
|
||||
runner-os: '["ubuntu-latest"]'
|
||||
cache-key-prefix: '${{ needs.determine-suite.outputs.cache-key-prefix }}-'
|
||||
skip-dist: ${{ needs.determine-suite.outputs.suite == 'full' }}
|
||||
secrets:
|
||||
GRADLE_ENCRYPTION_KEY: ${{ secrets.GRADLE_ENCRYPTION_KEY }}
|
||||
|
||||
restore-containerized-gradle-home:
|
||||
needs: [determine-suite, build-distribution]
|
||||
uses: ./.github/workflows/integ-test-restore-containerized-gradle-home.yml
|
||||
with:
|
||||
cache-key-prefix: '${{ needs.determine-suite.outputs.cache-key-prefix }}-'
|
||||
skip-dist: ${{ needs.determine-suite.outputs.suite == 'full' }}
|
||||
|
||||
restore-custom-gradle-home:
|
||||
needs: [determine-suite, build-distribution]
|
||||
uses: ./.github/workflows/integ-test-restore-custom-gradle-home.yml
|
||||
with:
|
||||
cache-key-prefix: '${{ needs.determine-suite.outputs.cache-key-prefix }}-'
|
||||
skip-dist: ${{ needs.determine-suite.outputs.suite == 'full' }}
|
||||
|
||||
restore-gradle-home:
|
||||
needs: [determine-suite, build-distribution]
|
||||
uses: ./.github/workflows/integ-test-restore-gradle-home.yml
|
||||
with:
|
||||
runner-os: '["ubuntu-latest"]'
|
||||
cache-key-prefix: '${{ needs.determine-suite.outputs.cache-key-prefix }}-'
|
||||
skip-dist: ${{ needs.determine-suite.outputs.suite == 'full' }}
|
||||
|
||||
restore-java-toolchain:
|
||||
needs: [determine-suite, build-distribution]
|
||||
uses: ./.github/workflows/integ-test-restore-java-toolchain.yml
|
||||
with:
|
||||
runner-os: '["ubuntu-latest"]'
|
||||
cache-key-prefix: '${{ needs.determine-suite.outputs.cache-key-prefix }}-'
|
||||
skip-dist: ${{ needs.determine-suite.outputs.suite == 'full' }}
|
||||
|
||||
sample-kotlin-dsl:
|
||||
needs: [determine-suite, build-distribution]
|
||||
uses: ./.github/workflows/integ-test-sample-kotlin-dsl.yml
|
||||
with:
|
||||
runner-os: '["ubuntu-latest"]'
|
||||
cache-key-prefix: '${{ needs.determine-suite.outputs.cache-key-prefix }}-'
|
||||
skip-dist: ${{ needs.determine-suite.outputs.suite == 'full' }}
|
||||
|
||||
sample-gradle-plugin:
|
||||
needs: [determine-suite, build-distribution]
|
||||
uses: ./.github/workflows/integ-test-sample-gradle-plugin.yml
|
||||
with:
|
||||
runner-os: '["ubuntu-latest"]'
|
||||
cache-key-prefix: '${{ needs.determine-suite.outputs.cache-key-prefix }}-'
|
||||
skip-dist: ${{ needs.determine-suite.outputs.suite == 'full' }}
|
||||
|
||||
toolchain-detection:
|
||||
needs: [determine-suite, build-distribution]
|
||||
uses: ./.github/workflows/integ-test-detect-java-toolchains.yml
|
||||
with:
|
||||
runner-os: '["ubuntu-latest"]'
|
||||
cache-key-prefix: '${{ needs.determine-suite.outputs.cache-key-prefix }}-'
|
||||
skip-dist: ${{ needs.determine-suite.outputs.suite == 'full' }}
|
||||
|
||||
wrapper-validation:
|
||||
needs: [determine-suite, build-distribution]
|
||||
uses: ./.github/workflows/integ-test-wrapper-validation.yml
|
||||
with:
|
||||
runner-os: '["ubuntu-latest"]'
|
||||
skip-dist: ${{ needs.determine-suite.outputs.suite == 'full' }}
|
||||
skip-dist: false
|
||||
secrets: inherit
|
||||
|
||||
57
.github/workflows/ci-ossf-scorecard.yml
vendored
Normal file
57
.github/workflows/ci-ossf-scorecard.yml
vendored
Normal file
@@ -0,0 +1,57 @@
|
||||
name: CI-ossf-scorecard
|
||||
on:
|
||||
schedule:
|
||||
- cron: '0 5 * * 1'
|
||||
push:
|
||||
branches:
|
||||
- main
|
||||
|
||||
permissions:
|
||||
contents: read
|
||||
|
||||
jobs:
|
||||
analysis:
|
||||
name: Scorecard analysis
|
||||
runs-on: ubuntu-latest
|
||||
permissions:
|
||||
# Needed to upload the results to code-scanning dashboard.
|
||||
security-events: write
|
||||
# Needed to publish results and get a badge (see publish_results below).
|
||||
id-token: write
|
||||
|
||||
steps:
|
||||
- name: 'Checkout code'
|
||||
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
|
||||
with:
|
||||
persist-credentials: false
|
||||
show-progress: false
|
||||
|
||||
- name: 'Run analysis'
|
||||
uses: ossf/scorecard-action@62b2cac7ed8198b15735ed49ab1e5cf35480ba46 # v2.4.0
|
||||
with:
|
||||
results_file: results.sarif
|
||||
results_format: sarif
|
||||
|
||||
# Public repositories:
|
||||
# - Publish results to OpenSSF REST API for easy access by consumers
|
||||
# - Allows the repository to include the Scorecard badge.
|
||||
# - See https://github.com/ossf/scorecard-action#publishing-results.
|
||||
# For private repositories:
|
||||
# - `publish_results` will always be set to `false`, regardless
|
||||
# of the value entered here.
|
||||
publish_results: true
|
||||
|
||||
# Upload the results as artifacts (optional). Commenting out will disable uploads of run results in SARIF
|
||||
# format to the repository Actions tab.
|
||||
- name: 'Upload artifact'
|
||||
uses: actions/upload-artifact@65c4c4a1ddee5b72f698fdd19549f0f0fb45cf08 # v4.6.0
|
||||
with:
|
||||
name: SARIF file
|
||||
path: results.sarif
|
||||
retention-days: 5
|
||||
|
||||
# Upload the results to GitHub's code scanning dashboard.
|
||||
- name: 'Upload to code-scanning'
|
||||
uses: github/codeql-action/upload-sarif@17a820bf2e43b47be2c72b39cc905417bc1ab6d0 # v3.28.6
|
||||
with:
|
||||
sarif_file: results.sarif
|
||||
29
.github/workflows/ci-update-dist.yml
vendored
29
.github/workflows/ci-update-dist.yml
vendored
@@ -5,36 +5,50 @@ on:
|
||||
push:
|
||||
branches:
|
||||
- 'main'
|
||||
- 'prerelease/**'
|
||||
- 'release/**'
|
||||
paths-ignore:
|
||||
- 'dist/**'
|
||||
|
||||
permissions:
|
||||
contents: write
|
||||
contents: read
|
||||
|
||||
jobs:
|
||||
update-dist:
|
||||
# Only run for the Gradle repository; otherwise when users create pull requests from their `main` branch
|
||||
# it would erroneously update `dist` on their branch (and the pull request)
|
||||
if: github.repository == 'gradle/actions'
|
||||
permissions:
|
||||
contents: write
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
|
||||
with:
|
||||
token: ${{ secrets.BOT_GITHUB_TOKEN }}
|
||||
|
||||
- name: Set up Node.js
|
||||
uses: actions/setup-node@v4
|
||||
uses: actions/setup-node@1d0ff469b7ec7b3cb9d8673fde0c81c44821de2a # v4.2.0
|
||||
with:
|
||||
node-version: 20
|
||||
cache: npm
|
||||
cache-dependency-path: sources/package-lock.json
|
||||
|
||||
- name: Build distribution
|
||||
- name: Install npm dependencies
|
||||
run: |
|
||||
npm clean-install
|
||||
working-directory: sources
|
||||
|
||||
- name: Build distribution
|
||||
run: |
|
||||
npm run check
|
||||
npm run compile
|
||||
working-directory: sources
|
||||
|
||||
env:
|
||||
NODE_OPTIONS: '-r @gradle/develocity-agent/preload'
|
||||
DEVELOCITY_URL: 'https://ge.solutions-team.gradle.com'
|
||||
DEVELOCITY_ACCESS_KEY: '${{ secrets.DV_SOLUTIONS_ACCESS_KEY }}'
|
||||
|
||||
- name: Copy the generated sources/dist directory to the top-level dist
|
||||
run: |
|
||||
cp -r sources/dist .
|
||||
@@ -43,10 +57,7 @@ jobs:
|
||||
# Important: The push event will not trigger any other workflows, see
|
||||
# https://github.com/stefanzweifel/git-auto-commit-action?tab=readme-ov-file#commits-made-by-this-action-do-not-trigger-new-workflow-runs
|
||||
- name: Commit & push changes
|
||||
# Only run for the Gradle repository; otherwise when users create pull requests from their `main` branch
|
||||
# it would erroneously update `dist` on their branch (and the pull request)
|
||||
if: github.repository == 'gradle/actions'
|
||||
uses: stefanzweifel/git-auto-commit-action@v5
|
||||
uses: stefanzweifel/git-auto-commit-action@e348103e9026cc0eee72ae06630dbe30c8bf7a79 # v5.1.0
|
||||
with:
|
||||
commit_message: '[bot] Update dist directory'
|
||||
file_pattern: dist
|
||||
|
||||
17
.github/workflows/ci-validate-wrappers.yml
vendored
Normal file
17
.github/workflows/ci-validate-wrappers.yml
vendored
Normal file
@@ -0,0 +1,17 @@
|
||||
name: CI-validate-wrappers
|
||||
|
||||
on:
|
||||
push:
|
||||
pull_request:
|
||||
|
||||
permissions:
|
||||
contents: read
|
||||
|
||||
jobs:
|
||||
validation:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
|
||||
- uses: gradle/actions/wrapper-validation@0bdd871935719febd78681f197cd39af5b6e16a6 # v4.2.2
|
||||
with:
|
||||
allow-checksums: e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855
|
||||
28
.github/workflows/demo-job-summary.yml
vendored
28
.github/workflows/demo-job-summary.yml
vendored
@@ -3,12 +3,15 @@ name: Demo Job Summary, for Gradle builds
|
||||
on:
|
||||
workflow_dispatch:
|
||||
|
||||
permissions:
|
||||
contents: read
|
||||
|
||||
jobs:
|
||||
build-distribution:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Checkout sources
|
||||
uses: actions/checkout@v4
|
||||
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
|
||||
- name: Build and upload distribution
|
||||
uses: ./.github/actions/build-dist
|
||||
|
||||
@@ -17,7 +20,7 @@ jobs:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Checkout sources
|
||||
uses: actions/checkout@v4
|
||||
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
|
||||
- name: Initialize integ-test
|
||||
uses: ./.github/actions/init-integ-test
|
||||
|
||||
@@ -59,7 +62,7 @@ jobs:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Checkout sources
|
||||
uses: actions/checkout@v4
|
||||
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
|
||||
- name: Initialize integ-test
|
||||
uses: ./.github/actions/init-integ-test
|
||||
|
||||
@@ -79,7 +82,7 @@ jobs:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Checkout sources
|
||||
uses: actions/checkout@v4
|
||||
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
|
||||
- name: Initialize integ-test
|
||||
uses: ./.github/actions/init-integ-test
|
||||
|
||||
@@ -94,3 +97,20 @@ jobs:
|
||||
- name: Run build
|
||||
working-directory: .github/workflow-samples/groovy-dsl
|
||||
run: ./gradlew assemble
|
||||
|
||||
cache-read-only:
|
||||
needs: build-distribution
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Checkout sources
|
||||
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
|
||||
- name: Initialize integ-test
|
||||
uses: ./.github/actions/init-integ-test
|
||||
|
||||
- name: Setup Gradle
|
||||
uses: ./setup-gradle
|
||||
with:
|
||||
cache-read-only: true
|
||||
- name: Build kotlin-dsl project
|
||||
working-directory: .github/workflow-samples/kotlin-dsl
|
||||
run: ./gradlew assemble
|
||||
|
||||
16
.github/workflows/demo-pr-build-scan-comment.yml
vendored
16
.github/workflows/demo-pr-build-scan-comment.yml
vendored
@@ -4,23 +4,25 @@ on:
|
||||
types: [assigned, review_requested]
|
||||
|
||||
permissions:
|
||||
pull-requests: write
|
||||
contents: read
|
||||
|
||||
jobs:
|
||||
build-distribution:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Checkout sources
|
||||
uses: actions/checkout@v4
|
||||
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
|
||||
- name: Build and upload distribution
|
||||
uses: ./.github/actions/build-dist
|
||||
|
||||
successful-build-with-always-comment:
|
||||
permissions:
|
||||
pull-requests: write
|
||||
needs: build-distribution
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Checkout sources
|
||||
uses: actions/checkout@v4
|
||||
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
|
||||
- name: Initialize integ-test
|
||||
uses: ./.github/actions/init-integ-test
|
||||
|
||||
@@ -34,11 +36,13 @@ jobs:
|
||||
run: ./gradlew build --scan
|
||||
|
||||
successful-build-with-comment-on-failure:
|
||||
permissions:
|
||||
pull-requests: write
|
||||
needs: build-distribution
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Checkout sources
|
||||
uses: actions/checkout@v4
|
||||
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
|
||||
- name: Initialize integ-test
|
||||
uses: ./.github/actions/init-integ-test
|
||||
|
||||
@@ -52,11 +56,13 @@ jobs:
|
||||
run: ./gradlew build --scan
|
||||
|
||||
failing-build-with-comment-on-failure:
|
||||
permissions:
|
||||
pull-requests: write
|
||||
needs: build-distribution
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Checkout sources
|
||||
uses: actions/checkout@v4
|
||||
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
|
||||
- name: Initialize integ-test
|
||||
uses: ./.github/actions/init-integ-test
|
||||
|
||||
|
||||
@@ -5,9 +5,10 @@ on:
|
||||
inputs:
|
||||
cache-key-prefix:
|
||||
type: string
|
||||
default: '0'
|
||||
runner-os:
|
||||
type: string
|
||||
default: '["ubuntu-latest", "windows-latest", "macos-latest"]'
|
||||
default: '["ubuntu-latest"]'
|
||||
skip-dist:
|
||||
type: boolean
|
||||
default: false
|
||||
@@ -16,6 +17,9 @@ env:
|
||||
SKIP_DIST: ${{ inputs.skip-dist }}
|
||||
GRADLE_BUILD_ACTION_CACHE_KEY_PREFIX: build-scan-publish-${{ inputs.cache-key-prefix }}
|
||||
|
||||
permissions:
|
||||
contents: read
|
||||
|
||||
jobs:
|
||||
build-scan-publish:
|
||||
strategy:
|
||||
@@ -26,15 +30,10 @@ jobs:
|
||||
runs-on: ${{ matrix.os }}
|
||||
steps:
|
||||
- name: Checkout sources
|
||||
uses: actions/checkout@v4
|
||||
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
|
||||
- name: Initialize integ-test
|
||||
uses: ./.github/actions/init-integ-test
|
||||
|
||||
- name: Setup Java
|
||||
uses: actions/setup-java@v4
|
||||
with:
|
||||
distribution: temurin
|
||||
java-version: 11
|
||||
- name: Setup Gradle
|
||||
id: setup-gradle
|
||||
uses: ./setup-gradle
|
||||
@@ -50,7 +49,7 @@ jobs:
|
||||
run: gradle help
|
||||
- name: Check Build Scan url
|
||||
if: ${{ !steps.gradle.outputs.build-scan-url }}
|
||||
uses: actions/github-script@v7
|
||||
uses: actions/github-script@60a0d83039c74a4aee543508d2ffcb1c3799cdea # v7.0.1
|
||||
with:
|
||||
script: |
|
||||
core.setFailed('No Build Scan detected')
|
||||
|
||||
28
.github/workflows/integ-test-cache-cleanup.yml
vendored
28
.github/workflows/integ-test-cache-cleanup.yml
vendored
@@ -5,27 +5,33 @@ on:
|
||||
inputs:
|
||||
cache-key-prefix:
|
||||
type: string
|
||||
default: '0'
|
||||
runner-os:
|
||||
type: string
|
||||
default: '["ubuntu-latest", "windows-latest", "macos-latest"]'
|
||||
default: '["ubuntu-latest"]'
|
||||
skip-dist:
|
||||
type: boolean
|
||||
default: false
|
||||
|
||||
env:
|
||||
SKIP_DIST: ${{ inputs.skip-dist }}
|
||||
GRADLE_BUILD_ACTION_CACHE_KEY_PREFIX: cache-cleanup-${{ inputs.cache-key-prefix }}
|
||||
# Requires a fresh cache entry each run
|
||||
GRADLE_BUILD_ACTION_CACHE_KEY_PREFIX: cache-cleanup-${{ inputs.cache-key-prefix }}-${{github.run_number}}
|
||||
|
||||
permissions:
|
||||
contents: read
|
||||
|
||||
jobs:
|
||||
full-build:
|
||||
cache-cleanup-full-build:
|
||||
strategy:
|
||||
max-parallel: 1
|
||||
fail-fast: false
|
||||
matrix:
|
||||
os: ${{fromJSON(inputs.runner-os)}}
|
||||
runs-on: ${{ matrix.os }}
|
||||
steps:
|
||||
- name: Checkout sources
|
||||
uses: actions/checkout@v4
|
||||
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
|
||||
- name: Initialize integ-test
|
||||
uses: ./.github/actions/init-integ-test
|
||||
|
||||
@@ -38,16 +44,17 @@ jobs:
|
||||
run: ./gradlew --no-daemon --build-cache -Dcommons_math3_version="3.1" build
|
||||
|
||||
# Second build will use the cache from the first build, but cleanup should remove unused artifacts
|
||||
assemble-build:
|
||||
needs: full-build
|
||||
cache-cleanup-assemble-build:
|
||||
needs: cache-cleanup-full-build
|
||||
strategy:
|
||||
max-parallel: 1
|
||||
fail-fast: false
|
||||
matrix:
|
||||
os: ${{fromJSON(inputs.runner-os)}}
|
||||
runs-on: ${{ matrix.os }}
|
||||
steps:
|
||||
- name: Checkout sources
|
||||
uses: actions/checkout@v4
|
||||
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
|
||||
- name: Initialize integ-test
|
||||
uses: ./.github/actions/init-integ-test
|
||||
|
||||
@@ -60,16 +67,17 @@ jobs:
|
||||
working-directory: sources/test/jest/resources/cache-cleanup
|
||||
run: ./gradlew --no-daemon --build-cache -Dcommons_math3_version="3.1.1" build
|
||||
|
||||
check-clean-cache:
|
||||
needs: assemble-build
|
||||
cache-cleanup-check-clean-cache:
|
||||
needs: cache-cleanup-assemble-build
|
||||
strategy:
|
||||
max-parallel: 1
|
||||
fail-fast: false
|
||||
matrix:
|
||||
os: ${{fromJSON(inputs.runner-os)}}
|
||||
runs-on: ${{ matrix.os }}
|
||||
steps:
|
||||
- name: Checkout sources
|
||||
uses: actions/checkout@v4
|
||||
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
|
||||
- name: Initialize integ-test
|
||||
uses: ./.github/actions/init-integ-test
|
||||
|
||||
|
||||
47
.github/workflows/integ-test-caching-config.yml
vendored
47
.github/workflows/integ-test-caching-config.yml
vendored
@@ -5,9 +5,10 @@ on:
|
||||
inputs:
|
||||
cache-key-prefix:
|
||||
type: string
|
||||
default: '0'
|
||||
runner-os:
|
||||
type: string
|
||||
default: '["ubuntu-latest", "windows-latest", "macos-latest"]'
|
||||
default: '["ubuntu-latest"]'
|
||||
skip-dist:
|
||||
type: boolean
|
||||
default: false
|
||||
@@ -16,16 +17,20 @@ env:
|
||||
SKIP_DIST: ${{ inputs.skip-dist }}
|
||||
GRADLE_BUILD_ACTION_CACHE_KEY_PREFIX: caching-config-${{ inputs.cache-key-prefix }}
|
||||
|
||||
permissions:
|
||||
contents: read
|
||||
|
||||
jobs:
|
||||
seed-build:
|
||||
caching-config-seed-build:
|
||||
strategy:
|
||||
max-parallel: 1
|
||||
fail-fast: false
|
||||
matrix:
|
||||
os: ${{fromJSON(inputs.runner-os)}}
|
||||
runs-on: ${{ matrix.os }}
|
||||
steps:
|
||||
- name: Checkout sources
|
||||
uses: actions/checkout@v4
|
||||
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
|
||||
- name: Initialize integ-test
|
||||
uses: ./.github/actions/init-integ-test
|
||||
|
||||
@@ -46,16 +51,17 @@ jobs:
|
||||
run: ./gradlew test
|
||||
|
||||
# Test that the gradle-user-home cache will cache dependencies, by running build with --offline
|
||||
verify-build:
|
||||
needs: seed-build
|
||||
caching-config-verify-build:
|
||||
needs: caching-config-seed-build
|
||||
strategy:
|
||||
max-parallel: 1
|
||||
fail-fast: false
|
||||
matrix:
|
||||
os: ${{fromJSON(inputs.runner-os)}}
|
||||
runs-on: ${{ matrix.os }}
|
||||
steps:
|
||||
- name: Checkout sources
|
||||
uses: actions/checkout@v4
|
||||
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
|
||||
- name: Initialize integ-test
|
||||
uses: ./.github/actions/init-integ-test
|
||||
|
||||
@@ -75,15 +81,16 @@ jobs:
|
||||
run: ./gradlew test --offline
|
||||
|
||||
# Test that build scans are captured when caching is explicitly disabled
|
||||
cache-disabled:
|
||||
caching-config-cache-disabled:
|
||||
strategy:
|
||||
max-parallel: 1
|
||||
fail-fast: false
|
||||
matrix:
|
||||
os: ${{fromJSON(inputs.runner-os)}}
|
||||
runs-on: ${{ matrix.os }}
|
||||
steps:
|
||||
- name: Checkout sources
|
||||
uses: actions/checkout@v4
|
||||
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
|
||||
- name: Initialize integ-test
|
||||
uses: ./.github/actions/init-integ-test
|
||||
|
||||
@@ -97,17 +104,17 @@ jobs:
|
||||
run: ./gradlew help
|
||||
- name: Check Build Scan url is captured
|
||||
if: ${{ !steps.gradle.outputs.build-scan-url }}
|
||||
uses: actions/github-script@v7
|
||||
uses: actions/github-script@60a0d83039c74a4aee543508d2ffcb1c3799cdea # v7.0.1
|
||||
with:
|
||||
script: |
|
||||
core.setFailed('No Build Scan detected')
|
||||
|
||||
# Test that build scans are captured when caching is disabled because Gradle User Home already exists
|
||||
cache-disabled-pre-existing-gradle-home:
|
||||
caching-config-cache-disabled-pre-existing-gradle-home:
|
||||
runs-on: ubuntu-latest # This test only runs on Ubuntu
|
||||
steps:
|
||||
- name: Checkout sources
|
||||
uses: actions/checkout@v4
|
||||
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
|
||||
- name: Initialize integ-test
|
||||
uses: ./.github/actions/init-integ-test
|
||||
|
||||
@@ -121,23 +128,24 @@ jobs:
|
||||
run: ./gradlew help
|
||||
- name: Check Build Scan url is captured
|
||||
if: ${{ !steps.gradle.outputs.build-scan-url }}
|
||||
uses: actions/github-script@v7
|
||||
uses: actions/github-script@60a0d83039c74a4aee543508d2ffcb1c3799cdea # v7.0.1
|
||||
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:
|
||||
caching-config-seed-write-only:
|
||||
env:
|
||||
GRADLE_BUILD_ACTION_CACHE_KEY_PREFIX: ${{ inputs.cache-key-prefix }}-write-only-
|
||||
GRADLE_BUILD_ACTION_CACHE_KEY_PREFIX: caching-config-write-only-${{ inputs.cache-key-prefix }}
|
||||
strategy:
|
||||
max-parallel: 1
|
||||
fail-fast: false
|
||||
matrix:
|
||||
os: ${{fromJSON(inputs.runner-os)}}
|
||||
runs-on: ${{ matrix.os }}
|
||||
steps:
|
||||
- name: Checkout sources
|
||||
uses: actions/checkout@v4
|
||||
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
|
||||
- name: Initialize integ-test
|
||||
uses: ./.github/actions/init-integ-test
|
||||
|
||||
@@ -149,18 +157,19 @@ jobs:
|
||||
working-directory: .github/workflow-samples/groovy-dsl
|
||||
run: ./gradlew test
|
||||
|
||||
verify-write-only-build:
|
||||
caching-config-verify-write-only:
|
||||
env:
|
||||
GRADLE_BUILD_ACTION_CACHE_KEY_PREFIX: ${{ inputs.cache-key-prefix }}-write-only-
|
||||
needs: seed-build-write-only
|
||||
GRADLE_BUILD_ACTION_CACHE_KEY_PREFIX: caching-config-write-only-${{ inputs.cache-key-prefix }}
|
||||
needs: caching-config-seed-write-only
|
||||
strategy:
|
||||
max-parallel: 1
|
||||
fail-fast: false
|
||||
matrix:
|
||||
os: ${{fromJSON(inputs.runner-os)}}
|
||||
runs-on: ${{ matrix.os }}
|
||||
steps:
|
||||
- name: Checkout sources
|
||||
uses: actions/checkout@v4
|
||||
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
|
||||
- name: Initialize integ-test
|
||||
uses: ./.github/actions/init-integ-test
|
||||
|
||||
|
||||
@@ -5,31 +5,28 @@ on:
|
||||
inputs:
|
||||
cache-key-prefix:
|
||||
type: string
|
||||
default: '0'
|
||||
runner-os:
|
||||
type: string
|
||||
default: '["ubuntu-latest", "windows-latest", "macos-latest"]'
|
||||
default: '["ubuntu-latest"]'
|
||||
skip-dist:
|
||||
type: boolean
|
||||
default: false
|
||||
|
||||
permissions:
|
||||
contents: write
|
||||
|
||||
env:
|
||||
SKIP_DIST: ${{ inputs.skip-dist }}
|
||||
GRADLE_BUILD_ACTION_CACHE_KEY_PREFIX: dependency-graph-${{ inputs.cache-key-prefix }}
|
||||
GITHUB_DEPENDENCY_GRAPH_REF: 'refs/tags/v0.0.1' # Use a different ref to avoid updating the real dependency graph for the repository
|
||||
|
||||
permissions:
|
||||
contents: read
|
||||
|
||||
jobs:
|
||||
groovy-upload:
|
||||
strategy:
|
||||
fail-fast: false
|
||||
matrix:
|
||||
os: ${{fromJSON(inputs.runner-os)}}
|
||||
runs-on: ${{ matrix.os }}
|
||||
dependency-graph-groovy-upload:
|
||||
runs-on: "ubuntu-latest"
|
||||
steps:
|
||||
- name: Checkout sources
|
||||
uses: actions/checkout@v4
|
||||
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
|
||||
- name: Initialize integ-test
|
||||
uses: ./.github/actions/init-integ-test
|
||||
|
||||
@@ -41,12 +38,14 @@ jobs:
|
||||
run: ./gradlew build
|
||||
working-directory: .github/workflow-samples/groovy-dsl
|
||||
|
||||
groovy-submit:
|
||||
needs: [groovy-upload]
|
||||
dependency-graph-groovy-submit:
|
||||
permissions:
|
||||
contents: write
|
||||
needs: [dependency-graph-groovy-upload]
|
||||
runs-on: "ubuntu-latest"
|
||||
steps:
|
||||
- name: Checkout sources
|
||||
uses: actions/checkout@v4
|
||||
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
|
||||
- name: Initialize integ-test
|
||||
uses: ./.github/actions/init-integ-test
|
||||
|
||||
@@ -57,15 +56,13 @@ jobs:
|
||||
env:
|
||||
DEPENDENCY_GRAPH_DOWNLOAD_ARTIFACT_NAME: groovy-upload
|
||||
|
||||
kotlin-generate-and-submit:
|
||||
strategy:
|
||||
fail-fast: false
|
||||
matrix:
|
||||
os: ${{fromJSON(inputs.runner-os)}}
|
||||
runs-on: ${{ matrix.os }}
|
||||
dependency-graph-kotlin-generate-and-submit:
|
||||
permissions:
|
||||
contents: write
|
||||
runs-on: "ubuntu-latest"
|
||||
steps:
|
||||
- name: Checkout sources
|
||||
uses: actions/checkout@v4
|
||||
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
|
||||
- name: Initialize integ-test
|
||||
uses: ./.github/actions/init-integ-test
|
||||
|
||||
@@ -77,15 +74,13 @@ jobs:
|
||||
run: ./gradlew build
|
||||
working-directory: .github/workflow-samples/kotlin-dsl
|
||||
|
||||
multiple-builds:
|
||||
strategy:
|
||||
fail-fast: false
|
||||
matrix:
|
||||
os: ${{fromJSON(inputs.runner-os)}}
|
||||
runs-on: ${{ matrix.os }}
|
||||
dependency-graph-multiple-builds:
|
||||
permissions:
|
||||
contents: write
|
||||
runs-on: "ubuntu-latest"
|
||||
steps:
|
||||
- name: Checkout sources
|
||||
uses: actions/checkout@v4
|
||||
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
|
||||
- name: Initialize integ-test
|
||||
uses: ./.github/actions/init-integ-test
|
||||
|
||||
@@ -122,11 +117,13 @@ jobs:
|
||||
exit 1
|
||||
fi
|
||||
|
||||
config-cache:
|
||||
dependency-graph-config-cache:
|
||||
permissions:
|
||||
contents: write
|
||||
runs-on: ubuntu-latest # Test is not compatible with Windows
|
||||
steps:
|
||||
- name: Checkout sources
|
||||
uses: actions/checkout@v4
|
||||
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
|
||||
- name: Initialize integ-test
|
||||
uses: ./.github/actions/init-integ-test
|
||||
|
||||
@@ -156,3 +153,40 @@ jobs:
|
||||
ls -l dependency-graph-reports
|
||||
exit 1
|
||||
fi
|
||||
|
||||
dependency-graph-generate-submit-and-upload:
|
||||
permissions:
|
||||
contents: write
|
||||
runs-on: "ubuntu-latest"
|
||||
steps:
|
||||
- name: Checkout sources
|
||||
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
|
||||
- name: Initialize integ-test
|
||||
uses: ./.github/actions/init-integ-test
|
||||
|
||||
- name: Setup Gradle for dependency-graph generate
|
||||
uses: ./setup-gradle
|
||||
with:
|
||||
dependency-graph: generate-submit-and-upload
|
||||
- name: Run gradle build
|
||||
id: gradle-build
|
||||
run: ./gradlew build
|
||||
working-directory: .github/workflow-samples/groovy-dsl
|
||||
|
||||
dependency-graph-generate-submit-and-upload-check:
|
||||
needs: [dependency-graph-generate-submit-and-upload]
|
||||
runs-on: "ubuntu-latest"
|
||||
steps:
|
||||
- name: Download dependency-graph artifact
|
||||
uses: actions/download-artifact@v4
|
||||
with:
|
||||
path: downloaded-dependency-graphs
|
||||
pattern: dependency-graph_*dependency-graph-generate-submit-and-upload.json
|
||||
- name: Check for downloaded dependency graphs
|
||||
shell: bash
|
||||
run: |
|
||||
ls -A "${{ github.workspace }}/downloaded-dependency-graphs"
|
||||
if [ -z "$(ls -A "${{ github.workspace }}/downloaded-dependency-graphs")" ]; then
|
||||
echo "No dependency graph files found"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
@@ -5,6 +5,7 @@ on:
|
||||
inputs:
|
||||
cache-key-prefix:
|
||||
type: string
|
||||
default: '0'
|
||||
runner-os:
|
||||
type: string
|
||||
default: '["ubuntu-latest"]'
|
||||
@@ -17,12 +18,15 @@ env:
|
||||
GRADLE_BUILD_ACTION_CACHE_KEY_PREFIX: dependency-submission-failures-${{ inputs.cache-key-prefix }}
|
||||
GITHUB_DEPENDENCY_GRAPH_REF: 'refs/tags/v0.0.1' # Use a different ref to avoid updating the real dependency graph for the repository
|
||||
|
||||
permissions:
|
||||
contents: read
|
||||
|
||||
jobs:
|
||||
failing-build:
|
||||
dependency-submission-failures-failing-build:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Checkout sources
|
||||
uses: actions/checkout@v4
|
||||
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
|
||||
- name: Initialize integ-test
|
||||
uses: ./.github/actions/init-integ-test
|
||||
|
||||
@@ -47,11 +51,11 @@ jobs:
|
||||
exit 1
|
||||
fi
|
||||
|
||||
unsupported-gradle-version:
|
||||
dependency-submission-failures-unsupported-gradle-version:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Checkout sources
|
||||
uses: actions/checkout@v4
|
||||
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
|
||||
- name: Initialize integ-test
|
||||
uses: ./.github/actions/init-integ-test
|
||||
|
||||
@@ -76,13 +80,13 @@ jobs:
|
||||
exit 1
|
||||
fi
|
||||
|
||||
insufficient-permissions:
|
||||
dependency-submission-failures-insufficient-permissions:
|
||||
runs-on: ubuntu-latest
|
||||
permissions:
|
||||
contents: read
|
||||
steps:
|
||||
- name: Checkout sources
|
||||
uses: actions/checkout@v4
|
||||
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
|
||||
- name: Initialize integ-test
|
||||
uses: ./.github/actions/init-integ-test
|
||||
|
||||
|
||||
@@ -5,31 +5,35 @@ on:
|
||||
inputs:
|
||||
cache-key-prefix:
|
||||
type: string
|
||||
default: '0'
|
||||
runner-os:
|
||||
type: string
|
||||
default: '["ubuntu-latest", "windows-latest", "macos-latest"]'
|
||||
default: '["ubuntu-latest"]'
|
||||
skip-dist:
|
||||
type: boolean
|
||||
default: false
|
||||
|
||||
permissions:
|
||||
contents: write
|
||||
|
||||
env:
|
||||
SKIP_DIST: ${{ inputs.skip-dist }}
|
||||
GRADLE_BUILD_ACTION_CACHE_KEY_PREFIX: dependency-submission-${{ inputs.cache-key-prefix }}
|
||||
GITHUB_DEPENDENCY_GRAPH_REF: 'refs/tags/v0.0.1' # Use a different ref to avoid updating the real dependency graph for the repository
|
||||
|
||||
permissions:
|
||||
contents: read
|
||||
|
||||
jobs:
|
||||
groovy-generate-and-upload:
|
||||
dependency-submission-groovy-generate-and-upload:
|
||||
permissions:
|
||||
contents: write
|
||||
strategy:
|
||||
max-parallel: 1
|
||||
fail-fast: false
|
||||
matrix:
|
||||
os: ${{fromJSON(inputs.runner-os)}}
|
||||
runs-on: ${{ matrix.os }}
|
||||
steps:
|
||||
- name: Checkout sources
|
||||
uses: actions/checkout@v4
|
||||
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
|
||||
- name: Initialize integ-test
|
||||
uses: ./.github/actions/init-integ-test
|
||||
|
||||
@@ -42,16 +46,19 @@ jobs:
|
||||
env:
|
||||
GRADLE_BUILD_ACTION_CACHE_KEY_JOB: groovy-dependency-submission
|
||||
|
||||
groovy-restore-cache:
|
||||
needs: [groovy-generate-and-upload]
|
||||
dependency-submission-groovy-restore-cache:
|
||||
permissions:
|
||||
contents: write
|
||||
needs: [dependency-submission-groovy-generate-and-upload]
|
||||
strategy:
|
||||
max-parallel: 1
|
||||
fail-fast: false
|
||||
matrix:
|
||||
os: ${{fromJSON(inputs.runner-os)}}
|
||||
runs-on: ${{ matrix.os }}
|
||||
steps:
|
||||
- name: Checkout sources
|
||||
uses: actions/checkout@v4
|
||||
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
|
||||
- name: Initialize integ-test
|
||||
uses: ./.github/actions/init-integ-test
|
||||
|
||||
@@ -63,16 +70,19 @@ jobs:
|
||||
env:
|
||||
GRADLE_BUILD_ACTION_CACHE_KEY_JOB: groovy-dependency-submission
|
||||
|
||||
groovy-download-and-submit:
|
||||
needs: [groovy-generate-and-upload]
|
||||
dependency-submission-groovy-download-and-submit:
|
||||
permissions:
|
||||
contents: write
|
||||
needs: [dependency-submission-groovy-generate-and-upload]
|
||||
strategy:
|
||||
max-parallel: 1
|
||||
fail-fast: false
|
||||
matrix:
|
||||
os: ${{fromJSON(inputs.runner-os)}}
|
||||
runs-on: ${{ matrix.os }}
|
||||
steps:
|
||||
- name: Checkout sources
|
||||
uses: actions/checkout@v4
|
||||
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
|
||||
- name: Initialize integ-test
|
||||
uses: ./.github/actions/init-integ-test
|
||||
|
||||
@@ -83,15 +93,18 @@ jobs:
|
||||
env:
|
||||
DEPENDENCY_GRAPH_DOWNLOAD_ARTIFACT_NAME: groovy-generate-and-upload-${{ matrix.os }}
|
||||
|
||||
kotlin-generate-and-submit:
|
||||
dependency-submission-kotlin-generate-and-submit:
|
||||
permissions:
|
||||
contents: write
|
||||
strategy:
|
||||
max-parallel: 1
|
||||
fail-fast: false
|
||||
matrix:
|
||||
os: ${{fromJSON(inputs.runner-os)}}
|
||||
runs-on: ${{ matrix.os }}
|
||||
steps:
|
||||
- name: Checkout sources
|
||||
uses: actions/checkout@v4
|
||||
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
|
||||
- name: Initialize integ-test
|
||||
uses: ./.github/actions/init-integ-test
|
||||
|
||||
@@ -100,15 +113,18 @@ jobs:
|
||||
with:
|
||||
build-root-directory: .github/workflow-samples/kotlin-dsl
|
||||
|
||||
multiple-builds:
|
||||
dependency-submission-multiple-builds:
|
||||
permissions:
|
||||
contents: write
|
||||
strategy:
|
||||
max-parallel: 1
|
||||
fail-fast: false
|
||||
matrix:
|
||||
os: ${{fromJSON(inputs.runner-os)}}
|
||||
runs-on: ${{ matrix.os }}
|
||||
steps:
|
||||
- name: Checkout sources
|
||||
uses: actions/checkout@v4
|
||||
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
|
||||
- name: Initialize integ-test
|
||||
uses: ./.github/actions/init-integ-test
|
||||
|
||||
@@ -145,15 +161,18 @@ jobs:
|
||||
exit 1
|
||||
fi
|
||||
|
||||
multiple-builds-upload:
|
||||
dependency-submission-multiple-builds-upload:
|
||||
permissions:
|
||||
contents: write
|
||||
strategy:
|
||||
max-parallel: 1
|
||||
fail-fast: false
|
||||
matrix:
|
||||
os: ${{fromJSON(inputs.runner-os)}}
|
||||
runs-on: ${{ matrix.os }}
|
||||
steps:
|
||||
- name: Checkout sources
|
||||
uses: actions/checkout@v4
|
||||
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
|
||||
- name: Initialize integ-test
|
||||
uses: ./.github/actions/init-integ-test
|
||||
|
||||
@@ -168,11 +187,13 @@ jobs:
|
||||
dependency-graph: generate-and-upload
|
||||
build-root-directory: .github/workflow-samples/groovy-dsl
|
||||
|
||||
config-cache:
|
||||
dependency-submission-config-cache:
|
||||
permissions:
|
||||
contents: write
|
||||
runs-on: ubuntu-latest # Test is not compatible with Windows
|
||||
steps:
|
||||
- name: Checkout sources
|
||||
uses: actions/checkout@v4
|
||||
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
|
||||
- name: Initialize integ-test
|
||||
uses: ./.github/actions/init-integ-test
|
||||
|
||||
@@ -203,7 +224,9 @@ jobs:
|
||||
exit 1
|
||||
fi
|
||||
|
||||
gradle-versions:
|
||||
dependency-submission-gradle-versions:
|
||||
permissions:
|
||||
contents: write
|
||||
strategy:
|
||||
fail-fast: false
|
||||
matrix:
|
||||
@@ -217,7 +240,7 @@ jobs:
|
||||
runs-on: ${{ matrix.os }}
|
||||
steps:
|
||||
- name: Checkout sources
|
||||
uses: actions/checkout@v4
|
||||
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
|
||||
- name: Initialize integ-test
|
||||
uses: ./.github/actions/init-integ-test
|
||||
|
||||
@@ -227,11 +250,13 @@ jobs:
|
||||
gradle-version: ${{ matrix.gradle }}
|
||||
build-root-directory: .github/workflow-samples/no-wrapper${{ matrix.build-root-suffix }}
|
||||
|
||||
with-setup-gradle:
|
||||
dependency-submission-with-setup-gradle:
|
||||
permissions:
|
||||
contents: write
|
||||
runs-on: ubuntu-latest # Test is not compatible with Windows
|
||||
steps:
|
||||
- name: Checkout sources
|
||||
uses: actions/checkout@v4
|
||||
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
|
||||
- name: Initialize integ-test
|
||||
uses: ./.github/actions/init-integ-test
|
||||
|
||||
@@ -262,11 +287,13 @@ jobs:
|
||||
exit 1
|
||||
fi
|
||||
|
||||
with-includes-and-excludes:
|
||||
dependency-submission-with-includes-and-excludes:
|
||||
permissions:
|
||||
contents: write
|
||||
runs-on: ubuntu-latest # Test is not compatible with Windows
|
||||
steps:
|
||||
- name: Checkout sources
|
||||
uses: actions/checkout@v4
|
||||
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
|
||||
- name: Initialize integ-test
|
||||
uses: ./.github/actions/init-integ-test
|
||||
|
||||
@@ -296,15 +323,18 @@ jobs:
|
||||
fi
|
||||
|
||||
|
||||
custom-report-dir-submit:
|
||||
dependency-submission-custom-report-dir-submit:
|
||||
permissions:
|
||||
contents: write
|
||||
strategy:
|
||||
max-parallel: 1
|
||||
fail-fast: false
|
||||
matrix:
|
||||
os: ${{fromJSON(inputs.runner-os)}}
|
||||
runs-on: ${{ matrix.os }}
|
||||
steps:
|
||||
- name: Checkout sources
|
||||
uses: actions/checkout@v4
|
||||
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
|
||||
- name: Initialize integ-test
|
||||
uses: ./.github/actions/init-integ-test
|
||||
|
||||
@@ -330,11 +360,13 @@ jobs:
|
||||
exit 1
|
||||
fi
|
||||
|
||||
custom-report-dir-upload:
|
||||
dependency-submission-custom-report-dir-upload:
|
||||
permissions:
|
||||
contents: write
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Checkout sources
|
||||
uses: actions/checkout@v4
|
||||
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
|
||||
- name: Initialize integ-test
|
||||
uses: ./.github/actions/init-integ-test
|
||||
|
||||
@@ -347,11 +379,13 @@ jobs:
|
||||
build-root-directory: .github/workflow-samples/groovy-dsl
|
||||
|
||||
custom-report-dir-download-and-submit:
|
||||
needs: custom-report-dir-upload
|
||||
permissions:
|
||||
contents: write
|
||||
needs: [dependency-submission-custom-report-dir-upload]
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Checkout sources
|
||||
uses: actions/checkout@v4
|
||||
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
|
||||
- name: Initialize integ-test
|
||||
uses: ./.github/actions/init-integ-test
|
||||
|
||||
|
||||
@@ -5,9 +5,10 @@ on:
|
||||
inputs:
|
||||
cache-key-prefix:
|
||||
type: string
|
||||
default: '0'
|
||||
runner-os:
|
||||
type: string
|
||||
default: '["ubuntu-latest", "windows-latest", "macos-latest"]'
|
||||
default: '["ubuntu-latest"]'
|
||||
skip-dist:
|
||||
type: boolean
|
||||
default: false
|
||||
@@ -16,9 +17,12 @@ env:
|
||||
SKIP_DIST: ${{ inputs.skip-dist }}
|
||||
GRADLE_BUILD_ACTION_CACHE_KEY_PREFIX: detect-java-toolchain-${{ inputs.cache-key-prefix }}
|
||||
|
||||
permissions:
|
||||
contents: read
|
||||
|
||||
jobs:
|
||||
# Test that pre-installed runner JDKs are detected
|
||||
pre-installed-toolchains:
|
||||
detect-toolchains-pre-installed-jdks:
|
||||
strategy:
|
||||
fail-fast: false
|
||||
matrix:
|
||||
@@ -26,7 +30,7 @@ jobs:
|
||||
runs-on: ${{ matrix.os }}
|
||||
steps:
|
||||
- name: Checkout sources
|
||||
uses: actions/checkout@v4
|
||||
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
|
||||
- name: Initialize integ-test
|
||||
uses: ./.github/actions/init-integ-test
|
||||
|
||||
@@ -48,7 +52,7 @@ jobs:
|
||||
grep -q 'Eclipse Temurin JDK 21' output.txt || (echo "::error::Did not detect preinstalled JDK 21" && exit 1)
|
||||
|
||||
# Test that JDKs provisioned by setup-java are detected
|
||||
setup-java-installed-toolchain:
|
||||
detect-toolchains-setup-java-jdks:
|
||||
strategy:
|
||||
fail-fast: false
|
||||
matrix:
|
||||
@@ -56,17 +60,17 @@ jobs:
|
||||
runs-on: ${{ matrix.os }}
|
||||
steps:
|
||||
- name: Checkout sources
|
||||
uses: actions/checkout@v4
|
||||
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
|
||||
- name: Initialize integ-test
|
||||
uses: ./.github/actions/init-integ-test
|
||||
|
||||
- name: Setup Java 20
|
||||
uses: actions/setup-java@v4
|
||||
uses: actions/setup-java@7a6d8a8234af8eb26422e24e3006232cccaa061b # v4.6.0
|
||||
with:
|
||||
distribution: 'temurin'
|
||||
java-version: 20
|
||||
- name: Setup Java 16
|
||||
uses: actions/setup-java@v4
|
||||
uses: actions/setup-java@7a6d8a8234af8eb26422e24e3006232cccaa061b # v4.6.0
|
||||
with:
|
||||
distribution: 'temurin'
|
||||
java-version: 16
|
||||
@@ -5,9 +5,10 @@ on:
|
||||
inputs:
|
||||
cache-key-prefix:
|
||||
type: string
|
||||
default: '0'
|
||||
runner-os:
|
||||
type: string
|
||||
default: '["ubuntu-latest", "windows-latest", "macos-latest"]'
|
||||
default: '["ubuntu-latest"]'
|
||||
skip-dist:
|
||||
type: boolean
|
||||
default: false
|
||||
@@ -19,38 +20,36 @@ env:
|
||||
SKIP_DIST: ${{ inputs.skip-dist }}
|
||||
GRADLE_BUILD_ACTION_CACHE_KEY_PREFIX: inject-develocity-${{ inputs.cache-key-prefix }}
|
||||
|
||||
permissions:
|
||||
contents: read
|
||||
|
||||
jobs:
|
||||
inject-develocity:
|
||||
env:
|
||||
DEVELOCITY_INJECTION_ENABLED: true
|
||||
DEVELOCITY_URL: https://ge.solutions-team.gradle.com
|
||||
DEVELOCITY_PLUGIN_VERSION: ${{ matrix.plugin-version }}
|
||||
DEVELOCITY_CCUD_PLUGIN_VERSION: '2.0'
|
||||
DEVELOCITY_CCUD_PLUGIN_VERSION: '2.1'
|
||||
${{matrix.accessKeyEnv}}: ${{ secrets.DEVELOCITY_ACCESS_KEY }}
|
||||
strategy:
|
||||
fail-fast: false
|
||||
matrix:
|
||||
gradle: [current, 7.6.2, 6.9.4, 5.6.4]
|
||||
os: ${{fromJSON(inputs.runner-os)}}
|
||||
plugin-version: [3.16.2, 3.17.6]
|
||||
plugin-version: [3.16.2, 3.19.1]
|
||||
include:
|
||||
- plugin-version: 3.16.2
|
||||
accessKeyEnv: GRADLE_ENTERPRISE_ACCESS_KEY
|
||||
- plugin-version: 3.17.6
|
||||
- plugin-version: 3.19.1
|
||||
accessKeyEnv: DEVELOCITY_ACCESS_KEY
|
||||
|
||||
runs-on: ${{ matrix.os }}
|
||||
steps:
|
||||
- name: Checkout sources
|
||||
uses: actions/checkout@v4
|
||||
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
|
||||
- name: Initialize integ-test
|
||||
uses: ./.github/actions/init-integ-test
|
||||
|
||||
- name: Setup Java
|
||||
uses: actions/setup-java@v4
|
||||
with:
|
||||
distribution: temurin
|
||||
java-version: 11
|
||||
- name: Setup Gradle
|
||||
id: setup-gradle
|
||||
uses: ./setup-gradle
|
||||
@@ -63,7 +62,7 @@ jobs:
|
||||
run: gradle help
|
||||
- name: Check Build Scan url
|
||||
if: ${{ !steps.gradle.outputs.build-scan-url }}
|
||||
uses: actions/github-script@v7
|
||||
uses: actions/github-script@60a0d83039c74a4aee543508d2ffcb1c3799cdea # v7.0.1
|
||||
with:
|
||||
script: |
|
||||
core.setFailed('No Build Scan detected')
|
||||
@@ -77,24 +76,19 @@ jobs:
|
||||
DEVELOCITY_INJECTION_ENABLED: true
|
||||
DEVELOCITY_URL: 'https://ge.solutions-team.gradle.com'
|
||||
DEVELOCITY_PLUGIN_VERSION: ${{ matrix.plugin-version }}
|
||||
DEVELOCITY_CCUD_PLUGIN_VERSION: '2.0'
|
||||
DEVELOCITY_CCUD_PLUGIN_VERSION: '2.1'
|
||||
strategy:
|
||||
fail-fast: false
|
||||
matrix:
|
||||
gradle: [current, 7.6.2, 6.9.4, 5.6.4]
|
||||
os: ${{fromJSON(inputs.runner-os)}}
|
||||
plugin-version: [3.16.2, 3.17.6]
|
||||
plugin-version: [3.16.2, 3.19.1]
|
||||
runs-on: ${{ matrix.os }}
|
||||
steps:
|
||||
- name: Checkout sources
|
||||
uses: actions/checkout@v4
|
||||
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
|
||||
- name: Initialize integ-test
|
||||
uses: ./.github/actions/init-integ-test
|
||||
- name: Setup Java
|
||||
uses: actions/setup-java@v4
|
||||
with:
|
||||
distribution: temurin
|
||||
java-version: 8
|
||||
- name: Setup Gradle
|
||||
id: setup-gradle
|
||||
uses: ./setup-gradle
|
||||
@@ -113,7 +107,7 @@ jobs:
|
||||
run: "[ ${#GRADLE_ENTERPRISE_ACCESS_KEY} -gt 500 ] || (echo 'GRADLE_ENTERPRISE_ACCESS_KEY does not look like a short lived token'; exit 1)"
|
||||
- name: Check Build Scan url
|
||||
if: ${{ !steps.gradle.outputs.build-scan-url }}
|
||||
uses: actions/github-script@v7
|
||||
uses: actions/github-script@60a0d83039c74a4aee543508d2ffcb1c3799cdea # v7.0.1
|
||||
with:
|
||||
script: |
|
||||
core.setFailed('No Build Scan detected')
|
||||
@@ -123,7 +117,7 @@ jobs:
|
||||
DEVELOCITY_INJECTION_ENABLED: true
|
||||
DEVELOCITY_URL: 'https://localhost:3333/'
|
||||
DEVELOCITY_PLUGIN_VERSION: ${{ matrix.plugin-version }}
|
||||
DEVELOCITY_CCUD_PLUGIN_VERSION: '2.0'
|
||||
DEVELOCITY_CCUD_PLUGIN_VERSION: '2.1'
|
||||
# Access key also set as an env var, we want to check it does not leak
|
||||
GRADLE_ENTERPRISE_ACCESS_KEY: ${{ secrets.DEVELOCITY_ACCESS_KEY }}
|
||||
DEVELOCITY_ACCESS_KEY: ${{ secrets.DEVELOCITY_ACCESS_KEY }}
|
||||
@@ -132,19 +126,14 @@ jobs:
|
||||
matrix:
|
||||
gradle: [ current, 7.6.2, 6.9.4, 5.6.4 ]
|
||||
os: ${{fromJSON(inputs.runner-os)}}
|
||||
plugin-version: [ 3.16.2, 3.17.6 ]
|
||||
plugin-version: [ 3.16.2, 3.19.1 ]
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Checkout sources
|
||||
uses: actions/checkout@v4
|
||||
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
|
||||
- name: Initialize integ-test
|
||||
uses: ./.github/actions/init-integ-test
|
||||
|
||||
- name: Setup Java
|
||||
uses: actions/setup-java@v4
|
||||
with:
|
||||
distribution: temurin
|
||||
java-version: 8
|
||||
- name: Setup Gradle
|
||||
id: setup-gradle
|
||||
uses: ./setup-gradle
|
||||
@@ -168,18 +157,13 @@ jobs:
|
||||
matrix:
|
||||
gradle: [ current, 7.6.2, 6.9.4, 5.6.4 ]
|
||||
os: ${{fromJSON(inputs.runner-os)}}
|
||||
plugin-version: [ 3.16.2, 3.17.6 ]
|
||||
plugin-version: [ 3.16.2, 3.19.1 ]
|
||||
runs-on: ${{ matrix.os }}
|
||||
steps:
|
||||
- name: Checkout sources
|
||||
uses: actions/checkout@v4
|
||||
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
|
||||
- name: Initialize integ-test
|
||||
uses: ./.github/actions/init-integ-test
|
||||
- name: Setup Java
|
||||
uses: actions/setup-java@v4
|
||||
with:
|
||||
distribution: temurin
|
||||
java-version: 8
|
||||
- name: Setup Gradle
|
||||
id: setup-gradle
|
||||
uses: ./setup-gradle
|
||||
@@ -195,7 +179,7 @@ jobs:
|
||||
run: gradle help
|
||||
- name: Check Build Scan url
|
||||
if: ${{ !steps.gradle.outputs.build-scan-url }}
|
||||
uses: actions/github-script@v7
|
||||
uses: actions/github-script@60a0d83039c74a4aee543508d2ffcb1c3799cdea # v7.0.1
|
||||
with:
|
||||
script: |
|
||||
core.setFailed('No Build Scan detected')
|
||||
|
||||
@@ -5,9 +5,10 @@ on:
|
||||
inputs:
|
||||
cache-key-prefix:
|
||||
type: string
|
||||
default: '0'
|
||||
runner-os:
|
||||
type: string
|
||||
default: '["ubuntu-latest", "windows-latest", "macos-latest"]'
|
||||
default: '["ubuntu-latest"]'
|
||||
skip-dist:
|
||||
type: boolean
|
||||
default: false
|
||||
@@ -17,18 +18,22 @@ env:
|
||||
GRADLE_BUILD_ACTION_CACHE_KEY_PREFIX: provision-gradle-versions-${{ inputs.cache-key-prefix }}
|
||||
GRADLE_BUILD_ACTION_CACHE_DEBUG_ENABLED: true
|
||||
|
||||
permissions:
|
||||
contents: read
|
||||
|
||||
jobs:
|
||||
# Tests for executing with different Gradle versions.
|
||||
# Each build verifies that it is executed with the expected Gradle version.
|
||||
provision-gradle:
|
||||
strategy:
|
||||
max-parallel: 1
|
||||
fail-fast: false
|
||||
matrix:
|
||||
os: ${{fromJSON(inputs.runner-os)}}
|
||||
runs-on: ${{ matrix.os }}
|
||||
steps:
|
||||
- name: Checkout sources
|
||||
uses: actions/checkout@v4
|
||||
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
|
||||
- name: Initialize integ-test
|
||||
uses: ./.github/actions/init-integ-test
|
||||
|
||||
@@ -64,16 +69,16 @@ jobs:
|
||||
run: gradle help
|
||||
- name: Check current version output parameter
|
||||
if: ${{ !startsWith(steps.gradle-current.outputs.gradle-version , '8.') }}
|
||||
uses: actions/github-script@v7
|
||||
uses: actions/github-script@60a0d83039c74a4aee543508d2ffcb1c3799cdea # v7.0.1
|
||||
with:
|
||||
script: |
|
||||
core.setFailed('Gradle version parameter not set correctly: value was "${{ steps.gradle-current.outputs.gradle-version }}"')
|
||||
|
||||
gradle-versions:
|
||||
provision-gradle-version:
|
||||
strategy:
|
||||
fail-fast: false
|
||||
matrix:
|
||||
gradle: [8.9, 8.8, 7.6.4, 6.9.4, 5.6.4, 4.10.3, 3.5.1] # 8.8 is the latest installed on windows runners
|
||||
gradle: ["8.13-milestone-2", "8.12", "8.12-rc-1", 8.9, 8.1, 7.6.4, 6.9.4, 5.6.4, 4.10.3, 3.5.1]
|
||||
os: ${{fromJSON(inputs.runner-os)}}
|
||||
include:
|
||||
- java-version: 11
|
||||
@@ -90,12 +95,12 @@ jobs:
|
||||
runs-on: ${{ matrix.os }}
|
||||
steps:
|
||||
- name: Checkout sources
|
||||
uses: actions/checkout@v4
|
||||
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
|
||||
- name: Initialize integ-test
|
||||
uses: ./.github/actions/init-integ-test
|
||||
|
||||
- name: Setup Java
|
||||
uses: actions/setup-java@v4
|
||||
uses: actions/setup-java@7a6d8a8234af8eb26422e24e3006232cccaa061b # v4.6.0
|
||||
with:
|
||||
distribution: temurin
|
||||
java-version: ${{ matrix.java-version }}
|
||||
@@ -107,7 +112,7 @@ jobs:
|
||||
gradle-version: ${{ matrix.gradle }}
|
||||
- name: Check output parameter
|
||||
if: ${{ steps.setup-gradle.outputs.gradle-version != matrix.gradle }}
|
||||
uses: actions/github-script@v7
|
||||
uses: actions/github-script@60a0d83039c74a4aee543508d2ffcb1c3799cdea # v7.0.1
|
||||
with:
|
||||
script: |
|
||||
core.setFailed('Gradle version parameter not set correctly: value was "${{ steps.setup-gradle.outputs.gradle-version }}"')
|
||||
@@ -117,7 +122,7 @@ jobs:
|
||||
run: gradle help "-DgradleVersionCheck=${{matrix.gradle}}"
|
||||
- name: Check Build Scan url
|
||||
if: ${{ !steps.gradle.outputs.build-scan-url }}
|
||||
uses: actions/github-script@v7
|
||||
uses: actions/github-script@60a0d83039c74a4aee543508d2ffcb1c3799cdea # v7.0.1
|
||||
with:
|
||||
script: |
|
||||
core.setFailed('No Build Scan detected')
|
||||
|
||||
@@ -5,9 +5,10 @@ on:
|
||||
inputs:
|
||||
cache-key-prefix:
|
||||
type: string
|
||||
default: '0'
|
||||
runner-os:
|
||||
type: string
|
||||
default: '["ubuntu-latest", "windows-latest", "macos-latest"]'
|
||||
default: '["ubuntu-latest"]'
|
||||
skip-dist:
|
||||
type: boolean
|
||||
default: false
|
||||
@@ -19,65 +20,58 @@ env:
|
||||
SKIP_DIST: ${{ inputs.skip-dist }}
|
||||
GRADLE_BUILD_ACTION_CACHE_KEY_PREFIX: restore-configuration-cache-${{ inputs.cache-key-prefix }}
|
||||
|
||||
permissions:
|
||||
contents: read
|
||||
|
||||
jobs:
|
||||
seed-build-groovy:
|
||||
restore-cc-seed-build-groovy:
|
||||
env:
|
||||
GRADLE_BUILD_ACTION_CACHE_KEY_JOB: restore-cc-groovy
|
||||
strategy:
|
||||
max-parallel: 1
|
||||
fail-fast: false
|
||||
matrix:
|
||||
os: ${{fromJSON(inputs.runner-os)}}
|
||||
runs-on: ${{ matrix.os }}
|
||||
steps:
|
||||
- name: Checkout sources
|
||||
uses: actions/checkout@v4
|
||||
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
|
||||
- name: Initialize integ-test
|
||||
uses: ./.github/actions/init-integ-test
|
||||
|
||||
- name: Setup Java to ensure consistency
|
||||
uses: actions/setup-java@v4
|
||||
with:
|
||||
distribution: 'liberica'
|
||||
java-version: 17
|
||||
- name: Setup Gradle
|
||||
uses: ./setup-gradle
|
||||
with:
|
||||
cache-read-only: false # For testing, allow writing cache entries on non-default branches
|
||||
cache-write-only: true # Ensure we start with a clean cache entry
|
||||
cache-encryption-key: ${{ secrets.GRADLE_ENCRYPTION_KEY }}
|
||||
gradle-version: 8.6
|
||||
- name: Groovy build with configuration-cache enabled
|
||||
working-directory: .github/workflow-samples/groovy-dsl
|
||||
run: gradle test --configuration-cache
|
||||
|
||||
verify-build-groovy:
|
||||
restore-cc-verify-build-groovy:
|
||||
env:
|
||||
GRADLE_BUILD_ACTION_CACHE_KEY_JOB: restore-cc-groovy
|
||||
GRADLE_BUILD_ACTION_CACHE_KEY_JOB_EXECUTION: ${{github.sha}}_1
|
||||
needs: seed-build-groovy
|
||||
needs: restore-cc-seed-build-groovy
|
||||
strategy:
|
||||
max-parallel: 1
|
||||
fail-fast: false
|
||||
matrix:
|
||||
os: ${{fromJSON(inputs.runner-os)}}
|
||||
runs-on: ${{ matrix.os }}
|
||||
steps:
|
||||
- name: Checkout sources
|
||||
uses: actions/checkout@v4
|
||||
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
|
||||
- name: Initialize integ-test
|
||||
uses: ./.github/actions/init-integ-test
|
||||
|
||||
- name: Setup Java to ensure consistency
|
||||
uses: actions/setup-java@v4
|
||||
with:
|
||||
distribution: 'liberica'
|
||||
java-version: 17
|
||||
- name: Setup Gradle
|
||||
uses: ./setup-gradle
|
||||
with:
|
||||
cache-read-only: false
|
||||
cache-cleanup: on-success
|
||||
cache-encryption-key: ${{ secrets.GRADLE_ENCRYPTION_KEY }}
|
||||
gradle-version: 8.6
|
||||
- name: Groovy build with configuration-cache enabled
|
||||
id: execute
|
||||
working-directory: .github/workflow-samples/groovy-dsl
|
||||
@@ -91,33 +85,28 @@ jobs:
|
||||
fi
|
||||
|
||||
# Ensure that cache-cleanup doesn't remove all necessary files
|
||||
verify-no-cache-cleanup-groovy:
|
||||
restore-cc-verify-no-cache-cleanup-groovy:
|
||||
env:
|
||||
GRADLE_BUILD_ACTION_CACHE_KEY_JOB: restore-cc-groovy
|
||||
GRADLE_BUILD_ACTION_CACHE_KEY_JOB_EXECUTION: ${{github.sha}}_2
|
||||
needs: verify-build-groovy
|
||||
needs: restore-cc-verify-build-groovy
|
||||
strategy:
|
||||
max-parallel: 1
|
||||
fail-fast: false
|
||||
matrix:
|
||||
os: ${{fromJSON(inputs.runner-os)}}
|
||||
runs-on: ${{ matrix.os }}
|
||||
steps:
|
||||
- name: Checkout sources
|
||||
uses: actions/checkout@v4
|
||||
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
|
||||
- name: Initialize integ-test
|
||||
uses: ./.github/actions/init-integ-test
|
||||
|
||||
- name: Setup Java to ensure consistency
|
||||
uses: actions/setup-java@v4
|
||||
with:
|
||||
distribution: 'liberica'
|
||||
java-version: 17
|
||||
- name: Setup Gradle
|
||||
uses: ./setup-gradle
|
||||
with:
|
||||
cache-read-only: true
|
||||
cache-encryption-key: ${{ secrets.GRADLE_ENCRYPTION_KEY }}
|
||||
gradle-version: 8.6
|
||||
- name: Groovy build with configuration-cache enabled
|
||||
id: execute
|
||||
working-directory: .github/workflow-samples/groovy-dsl
|
||||
@@ -131,27 +120,23 @@ jobs:
|
||||
fi
|
||||
|
||||
# Check that the build can run when no extracted cache entries are restored
|
||||
gradle-user-home-not-fully-restored:
|
||||
restore-cc-gradle-user-home-not-fully-restored:
|
||||
env:
|
||||
GRADLE_BUILD_ACTION_CACHE_KEY_JOB: restore-cc-groovy
|
||||
GRADLE_BUILD_ACTION_CACHE_KEY_JOB_EXECUTION: ${{github.sha}}_x
|
||||
needs: seed-build-groovy
|
||||
needs: restore-cc-seed-build-groovy
|
||||
strategy:
|
||||
max-parallel: 1
|
||||
fail-fast: false
|
||||
matrix:
|
||||
os: ${{fromJSON(inputs.runner-os)}}
|
||||
runs-on: ${{ matrix.os }}
|
||||
steps:
|
||||
- name: Checkout sources
|
||||
uses: actions/checkout@v4
|
||||
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
|
||||
- name: Initialize integ-test
|
||||
uses: ./.github/actions/init-integ-test
|
||||
|
||||
- name: Setup Java to ensure consistency
|
||||
uses: actions/setup-java@v4
|
||||
with:
|
||||
distribution: 'liberica'
|
||||
java-version: 17
|
||||
- name: Setup Gradle with no extracted cache entries restored
|
||||
uses: ./setup-gradle
|
||||
env:
|
||||
@@ -159,100 +144,84 @@ jobs:
|
||||
with:
|
||||
cache-read-only: true
|
||||
cache-encryption-key: ${{ secrets.GRADLE_ENCRYPTION_KEY }}
|
||||
gradle-version: 8.6
|
||||
- name: Check execute Gradle build with configuration cache enabled (but not restored)
|
||||
working-directory: .github/workflow-samples/groovy-dsl
|
||||
run: gradle test --configuration-cache
|
||||
|
||||
seed-build-kotlin:
|
||||
restore-cc-seed-build-kotlin:
|
||||
env:
|
||||
GRADLE_BUILD_ACTION_CACHE_KEY_JOB: restore-cc-kotlin
|
||||
strategy:
|
||||
max-parallel: 1
|
||||
fail-fast: false
|
||||
matrix:
|
||||
os: ${{fromJSON(inputs.runner-os)}}
|
||||
runs-on: ${{ matrix.os }}
|
||||
steps:
|
||||
- name: Checkout sources
|
||||
uses: actions/checkout@v4
|
||||
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
|
||||
- name: Initialize integ-test
|
||||
uses: ./.github/actions/init-integ-test
|
||||
|
||||
- name: Setup Java to ensure consistency
|
||||
uses: actions/setup-java@v4
|
||||
with:
|
||||
distribution: 'liberica'
|
||||
java-version: 17
|
||||
- name: Setup Gradle
|
||||
uses: ./setup-gradle
|
||||
with:
|
||||
cache-read-only: false # For testing, allow writing cache entries on non-default branches
|
||||
cache-write-only: true # Ensure we start with a clean cache entry
|
||||
cache-encryption-key: ${{ secrets.GRADLE_ENCRYPTION_KEY }}
|
||||
gradle-version: 8.6
|
||||
- name: Execute 'help' with configuration-cache enabled
|
||||
working-directory: .github/workflow-samples/kotlin-dsl
|
||||
run: gradle help --configuration-cache
|
||||
|
||||
modify-build-kotlin:
|
||||
restore-cc-modify-build-kotlin:
|
||||
env:
|
||||
GRADLE_BUILD_ACTION_CACHE_KEY_JOB: restore-cc-kotlin
|
||||
GRADLE_BUILD_ACTION_CACHE_KEY_JOB_EXECUTION: ${{github.sha}}_1
|
||||
needs: seed-build-kotlin
|
||||
needs: restore-cc-seed-build-kotlin
|
||||
strategy:
|
||||
max-parallel: 1
|
||||
fail-fast: false
|
||||
matrix:
|
||||
os: ${{fromJSON(inputs.runner-os)}}
|
||||
runs-on: ${{ matrix.os }}
|
||||
steps:
|
||||
- name: Checkout sources
|
||||
uses: actions/checkout@v4
|
||||
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
|
||||
- name: Initialize integ-test
|
||||
uses: ./.github/actions/init-integ-test
|
||||
|
||||
- name: Setup Java to ensure consistency
|
||||
uses: actions/setup-java@v4
|
||||
with:
|
||||
distribution: 'liberica'
|
||||
java-version: 17
|
||||
- name: Setup Gradle
|
||||
uses: ./setup-gradle
|
||||
with:
|
||||
cache-read-only: false # For testing, allow writing cache entries on non-default branches
|
||||
cache-encryption-key: ${{ secrets.GRADLE_ENCRYPTION_KEY }}
|
||||
gradle-version: 8.6
|
||||
- name: Execute 'test' with configuration-cache enabled
|
||||
working-directory: .github/workflow-samples/kotlin-dsl
|
||||
run: gradle test --configuration-cache
|
||||
|
||||
# Test restore configuration-cache from the third build invocation
|
||||
verify-build-kotlin:
|
||||
restore-cc-verify-build-kotlin:
|
||||
env:
|
||||
GRADLE_BUILD_ACTION_CACHE_KEY_JOB: restore-cc-kotlin
|
||||
GRADLE_BUILD_ACTION_CACHE_KEY_JOB_EXECUTION: ${{github.sha}}_2
|
||||
needs: modify-build-kotlin
|
||||
needs: restore-cc-modify-build-kotlin
|
||||
strategy:
|
||||
max-parallel: 1
|
||||
fail-fast: false
|
||||
matrix:
|
||||
os: ${{fromJSON(inputs.runner-os)}}
|
||||
runs-on: ${{ matrix.os }}
|
||||
steps:
|
||||
- name: Checkout sources
|
||||
uses: actions/checkout@v4
|
||||
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
|
||||
- name: Initialize integ-test
|
||||
uses: ./.github/actions/init-integ-test
|
||||
|
||||
- name: Setup Java to ensure consistency
|
||||
uses: actions/setup-java@v4
|
||||
with:
|
||||
distribution: 'liberica'
|
||||
java-version: 17
|
||||
- name: Setup Gradle
|
||||
uses: ./setup-gradle
|
||||
with:
|
||||
cache-read-only: true
|
||||
cache-encryption-key: ${{ secrets.GRADLE_ENCRYPTION_KEY }}
|
||||
gradle-version: 8.6
|
||||
- name: Execute 'test' again with configuration-cache enabled
|
||||
id: execute
|
||||
working-directory: .github/workflow-samples/kotlin-dsl
|
||||
|
||||
@@ -5,6 +5,7 @@ on:
|
||||
inputs:
|
||||
cache-key-prefix:
|
||||
type: string
|
||||
default: '0'
|
||||
skip-dist:
|
||||
type: boolean
|
||||
default: false
|
||||
@@ -13,13 +14,16 @@ env:
|
||||
SKIP_DIST: ${{ inputs.skip-dist }}
|
||||
GRADLE_BUILD_ACTION_CACHE_KEY_PREFIX: restore-containerized-gradle-home-${{ inputs.cache-key-prefix }}
|
||||
|
||||
permissions:
|
||||
contents: read
|
||||
|
||||
jobs:
|
||||
seed-build:
|
||||
restore-containerized-seed-build:
|
||||
runs-on: ubuntu-latest
|
||||
container: fedora:latest
|
||||
steps:
|
||||
- name: Checkout sources
|
||||
uses: actions/checkout@v4
|
||||
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
|
||||
- name: Initialize integ-test
|
||||
uses: ./.github/actions/init-integ-test
|
||||
|
||||
@@ -32,13 +36,13 @@ jobs:
|
||||
run: ./gradlew test
|
||||
|
||||
# Test that the gradle-user-home cache will cache dependencies, by running build with --offline
|
||||
dependencies-cache:
|
||||
needs: seed-build
|
||||
restore-containerized-dependencies-cache:
|
||||
needs: restore-containerized-seed-build
|
||||
runs-on: ubuntu-latest
|
||||
container: fedora:latest
|
||||
steps:
|
||||
- name: Checkout sources
|
||||
uses: actions/checkout@v4
|
||||
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
|
||||
- name: Initialize integ-test
|
||||
uses: ./.github/actions/init-integ-test
|
||||
|
||||
|
||||
@@ -5,6 +5,7 @@ on:
|
||||
inputs:
|
||||
cache-key-prefix:
|
||||
type: string
|
||||
default: '0'
|
||||
skip-dist:
|
||||
type: boolean
|
||||
default: false
|
||||
@@ -13,12 +14,15 @@ env:
|
||||
SKIP_DIST: ${{ inputs.skip-dist }}
|
||||
GRADLE_BUILD_ACTION_CACHE_KEY_PREFIX: restore-custom-gradle-home-${{ inputs.cache-key-prefix }}
|
||||
|
||||
permissions:
|
||||
contents: read
|
||||
|
||||
jobs:
|
||||
seed-build:
|
||||
restore-custom-gradle-home-seed-build:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Checkout sources
|
||||
uses: actions/checkout@v4
|
||||
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
|
||||
- name: Initialize integ-test
|
||||
uses: ./.github/actions/init-integ-test
|
||||
|
||||
@@ -35,12 +39,12 @@ jobs:
|
||||
run: ./gradlew test --info
|
||||
|
||||
# Test that the gradle-user-home cache will cache dependencies, by running build with --offline
|
||||
dependencies-cache:
|
||||
needs: seed-build
|
||||
restore-custom-gradle-home-dependencies-cache:
|
||||
needs: restore-custom-gradle-home-seed-build
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Checkout sources
|
||||
uses: actions/checkout@v4
|
||||
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
|
||||
- name: Initialize integ-test
|
||||
uses: ./.github/actions/init-integ-test
|
||||
|
||||
@@ -57,12 +61,12 @@ jobs:
|
||||
run: ./gradlew test --offline --info
|
||||
|
||||
# Test that the gradle-user-home cache will cache and restore local build-cache
|
||||
build-cache:
|
||||
needs: seed-build
|
||||
restore-custom-gradle-home-build-cache:
|
||||
needs: restore-custom-gradle-home-seed-build
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Checkout sources
|
||||
uses: actions/checkout@v4
|
||||
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
|
||||
- name: Initialize integ-test
|
||||
uses: ./.github/actions/init-integ-test
|
||||
|
||||
|
||||
@@ -5,9 +5,10 @@ on:
|
||||
inputs:
|
||||
cache-key-prefix:
|
||||
type: string
|
||||
default: '0'
|
||||
runner-os:
|
||||
type: string
|
||||
default: '["ubuntu-latest", "windows-latest", "macos-latest"]'
|
||||
default: '["ubuntu-latest"]'
|
||||
skip-dist:
|
||||
type: boolean
|
||||
default: false
|
||||
@@ -17,16 +18,20 @@ env:
|
||||
GRADLE_BUILD_ACTION_CACHE_KEY_PREFIX: restore-gradle-home-${{ inputs.cache-key-prefix }}
|
||||
GRADLE_BUILD_ACTION_CACHE_KEY_JOB: restore-gradle-home
|
||||
|
||||
permissions:
|
||||
contents: read
|
||||
|
||||
jobs:
|
||||
seed-build:
|
||||
restore-gradle-home-seed-build:
|
||||
strategy:
|
||||
max-parallel: 1
|
||||
fail-fast: false
|
||||
matrix:
|
||||
os: ${{fromJSON(inputs.runner-os)}}
|
||||
runs-on: ${{ matrix.os }}
|
||||
steps:
|
||||
- name: Checkout sources
|
||||
uses: actions/checkout@v4
|
||||
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
|
||||
- name: Initialize integ-test
|
||||
uses: ./.github/actions/init-integ-test
|
||||
|
||||
@@ -39,16 +44,17 @@ jobs:
|
||||
run: ./gradlew test
|
||||
|
||||
# Test that the gradle-user-home cache will cache dependencies, by running build with --offline
|
||||
dependencies-cache:
|
||||
needs: seed-build
|
||||
restore-gradle-home-dependencies-cache:
|
||||
needs: restore-gradle-home-seed-build
|
||||
strategy:
|
||||
max-parallel: 1
|
||||
fail-fast: false
|
||||
matrix:
|
||||
os: ${{fromJSON(inputs.runner-os)}}
|
||||
runs-on: ${{ matrix.os }}
|
||||
steps:
|
||||
- name: Checkout sources
|
||||
uses: actions/checkout@v4
|
||||
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
|
||||
- name: Initialize integ-test
|
||||
uses: ./.github/actions/init-integ-test
|
||||
|
||||
@@ -61,16 +67,17 @@ jobs:
|
||||
run: ./gradlew test --offline
|
||||
|
||||
# Test that the gradle-user-home cache will cache and restore local build-cache
|
||||
build-cache:
|
||||
needs: seed-build
|
||||
restore-gradle-home-build-cache:
|
||||
needs: restore-gradle-home-seed-build
|
||||
strategy:
|
||||
max-parallel: 1
|
||||
fail-fast: false
|
||||
matrix:
|
||||
os: ${{fromJSON(inputs.runner-os)}}
|
||||
runs-on: ${{ matrix.os }}
|
||||
steps:
|
||||
- name: Checkout sources
|
||||
uses: actions/checkout@v4
|
||||
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
|
||||
- name: Initialize integ-test
|
||||
uses: ./.github/actions/init-integ-test
|
||||
|
||||
@@ -83,16 +90,17 @@ jobs:
|
||||
run: ./gradlew test -DverifyCachedBuild=true
|
||||
|
||||
# Check that the build can run when Gradle User Home is not fully restored
|
||||
no-extracted-cache-entries-restored:
|
||||
needs: seed-build
|
||||
restore-gradle-home-no-extracted-cache-entries-restored:
|
||||
needs: restore-gradle-home-seed-build
|
||||
strategy:
|
||||
max-parallel: 1
|
||||
fail-fast: false
|
||||
matrix:
|
||||
os: ${{fromJSON(inputs.runner-os)}}
|
||||
runs-on: ${{ matrix.os }}
|
||||
steps:
|
||||
- name: Checkout sources
|
||||
uses: actions/checkout@v4
|
||||
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
|
||||
- name: Initialize integ-test
|
||||
uses: ./.github/actions/init-integ-test
|
||||
|
||||
@@ -107,16 +115,17 @@ jobs:
|
||||
run: ./gradlew test
|
||||
|
||||
# Test that a pre-existing gradle-user-home can be overwritten by the restored cache
|
||||
pre-existing-gradle-home:
|
||||
needs: seed-build
|
||||
restore-gradle-home-pre-existing-gradle-home:
|
||||
needs: restore-gradle-home-seed-build
|
||||
strategy:
|
||||
max-parallel: 1
|
||||
fail-fast: false
|
||||
matrix:
|
||||
os: ${{fromJSON(inputs.runner-os)}}
|
||||
runs-on: ${{ matrix.os }}
|
||||
steps:
|
||||
- name: Checkout sources
|
||||
uses: actions/checkout@v4
|
||||
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
|
||||
- name: Initialize integ-test
|
||||
uses: ./.github/actions/init-integ-test
|
||||
|
||||
|
||||
@@ -5,9 +5,10 @@ on:
|
||||
inputs:
|
||||
cache-key-prefix:
|
||||
type: string
|
||||
default: '0'
|
||||
runner-os:
|
||||
type: string
|
||||
default: '["ubuntu-latest", "windows-latest", "macos-latest"]'
|
||||
default: '["ubuntu-latest"]'
|
||||
skip-dist:
|
||||
type: boolean
|
||||
default: false
|
||||
@@ -16,16 +17,20 @@ env:
|
||||
SKIP_DIST: ${{ inputs.skip-dist }}
|
||||
GRADLE_BUILD_ACTION_CACHE_KEY_PREFIX: restore-java-toolchain-${{ inputs.cache-key-prefix }}
|
||||
|
||||
permissions:
|
||||
contents: read
|
||||
|
||||
jobs:
|
||||
seed-build:
|
||||
restore-java-toolchain-seed-build:
|
||||
strategy:
|
||||
max-parallel: 1
|
||||
fail-fast: false
|
||||
matrix:
|
||||
os: ${{fromJSON(inputs.runner-os)}}
|
||||
runs-on: ${{ matrix.os }}
|
||||
steps:
|
||||
- name: Checkout sources
|
||||
uses: actions/checkout@v4
|
||||
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
|
||||
- name: Initialize integ-test
|
||||
uses: ./.github/actions/init-integ-test
|
||||
|
||||
@@ -38,16 +43,17 @@ jobs:
|
||||
run: ./gradlew test --info
|
||||
|
||||
# Test that the gradle-user-home cache will cache the toolchain, by running build with --offline
|
||||
toolchain-cache:
|
||||
needs: seed-build
|
||||
restore-java-toolchain-verify-build:
|
||||
needs: restore-java-toolchain-seed-build
|
||||
strategy:
|
||||
max-parallel: 1
|
||||
fail-fast: false
|
||||
matrix:
|
||||
os: ${{fromJSON(inputs.runner-os)}}
|
||||
runs-on: ${{ matrix.os }}
|
||||
steps:
|
||||
- name: Checkout sources
|
||||
uses: actions/checkout@v4
|
||||
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
|
||||
- name: Initialize integ-test
|
||||
uses: ./.github/actions/init-integ-test
|
||||
|
||||
|
||||
@@ -5,9 +5,10 @@ on:
|
||||
inputs:
|
||||
cache-key-prefix:
|
||||
type: string
|
||||
default: '0'
|
||||
runner-os:
|
||||
type: string
|
||||
default: '["ubuntu-latest", "windows-latest", "macos-latest"]'
|
||||
default: '["ubuntu-latest"]'
|
||||
skip-dist:
|
||||
type: boolean
|
||||
default: false
|
||||
@@ -16,16 +17,20 @@ env:
|
||||
SKIP_DIST: ${{ inputs.skip-dist }}
|
||||
GRADLE_BUILD_ACTION_CACHE_KEY_PREFIX: sample-gradle-plugin-${{ inputs.cache-key-prefix }}
|
||||
|
||||
permissions:
|
||||
contents: read
|
||||
|
||||
jobs:
|
||||
seed-build:
|
||||
sample-gradle-plugin-seed-build:
|
||||
strategy:
|
||||
max-parallel: 1
|
||||
fail-fast: false
|
||||
matrix:
|
||||
os: ${{fromJSON(inputs.runner-os)}}
|
||||
runs-on: ${{ matrix.os }}
|
||||
steps:
|
||||
- name: Checkout sources
|
||||
uses: actions/checkout@v4
|
||||
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
|
||||
- name: Initialize integ-test
|
||||
uses: ./.github/actions/init-integ-test
|
||||
|
||||
@@ -37,16 +42,17 @@ jobs:
|
||||
working-directory: .github/workflow-samples/gradle-plugin
|
||||
run: ./gradlew build
|
||||
|
||||
verify-build:
|
||||
needs: seed-build
|
||||
sample-gradle-plugin-verify-build:
|
||||
needs: sample-gradle-plugin-seed-build
|
||||
strategy:
|
||||
max-parallel: 1
|
||||
fail-fast: false
|
||||
matrix:
|
||||
os: ${{fromJSON(inputs.runner-os)}}
|
||||
runs-on: ${{ matrix.os }}
|
||||
steps:
|
||||
- name: Checkout sources
|
||||
uses: actions/checkout@v4
|
||||
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
|
||||
- name: Initialize integ-test
|
||||
uses: ./.github/actions/init-integ-test
|
||||
|
||||
|
||||
@@ -5,9 +5,10 @@ on:
|
||||
inputs:
|
||||
cache-key-prefix:
|
||||
type: string
|
||||
default: '0'
|
||||
runner-os:
|
||||
type: string
|
||||
default: '["ubuntu-latest", "windows-latest", "macos-latest"]'
|
||||
default: '["ubuntu-latest"]'
|
||||
skip-dist:
|
||||
type: boolean
|
||||
default: false
|
||||
@@ -16,16 +17,20 @@ env:
|
||||
SKIP_DIST: ${{ inputs.skip-dist }}
|
||||
GRADLE_BUILD_ACTION_CACHE_KEY_PREFIX: sample-kotlin-dsl-${{ inputs.cache-key-prefix }}
|
||||
|
||||
permissions:
|
||||
contents: read
|
||||
|
||||
jobs:
|
||||
seed-build:
|
||||
sample-kotlin-dsl-seed-build:
|
||||
strategy:
|
||||
max-parallel: 1
|
||||
fail-fast: false
|
||||
matrix:
|
||||
os: ${{fromJSON(inputs.runner-os)}}
|
||||
runs-on: ${{ matrix.os }}
|
||||
steps:
|
||||
- name: Checkout sources
|
||||
uses: actions/checkout@v4
|
||||
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
|
||||
- name: Initialize integ-test
|
||||
uses: ./.github/actions/init-integ-test
|
||||
|
||||
@@ -37,16 +42,17 @@ jobs:
|
||||
working-directory: .github/workflow-samples/kotlin-dsl
|
||||
run: ./gradlew build
|
||||
|
||||
verify-build:
|
||||
needs: seed-build
|
||||
sample-kotlin-dsl-verify-build:
|
||||
needs: sample-kotlin-dsl-seed-build
|
||||
strategy:
|
||||
max-parallel: 1
|
||||
fail-fast: false
|
||||
matrix:
|
||||
os: ${{fromJSON(inputs.runner-os)}}
|
||||
runs-on: ${{ matrix.os }}
|
||||
steps:
|
||||
- name: Checkout sources
|
||||
uses: actions/checkout@v4
|
||||
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
|
||||
- name: Initialize integ-test
|
||||
uses: ./.github/actions/init-integ-test
|
||||
|
||||
|
||||
@@ -5,7 +5,7 @@ on:
|
||||
inputs:
|
||||
runner-os:
|
||||
type: string
|
||||
default: '["ubuntu-latest", "windows-latest", "macos-latest"]'
|
||||
default: '["ubuntu-latest"]'
|
||||
skip-dist:
|
||||
type: boolean
|
||||
default: false
|
||||
@@ -13,8 +13,11 @@ on:
|
||||
env:
|
||||
SKIP_DIST: ${{ inputs.skip-dist }}
|
||||
|
||||
permissions:
|
||||
contents: read
|
||||
|
||||
jobs:
|
||||
test-setup-gradle-validation:
|
||||
wrapper-validation-setup-gradle:
|
||||
strategy:
|
||||
fail-fast: false
|
||||
matrix:
|
||||
@@ -22,7 +25,7 @@ jobs:
|
||||
runs-on: ${{ matrix.os }}
|
||||
steps:
|
||||
- name: Checkout sources
|
||||
uses: actions/checkout@v4
|
||||
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
|
||||
- name: Initialize integ-test
|
||||
uses: ./.github/actions/init-integ-test
|
||||
|
||||
@@ -34,17 +37,18 @@ jobs:
|
||||
continue-on-error: true
|
||||
|
||||
- name: Check failure
|
||||
shell: bash
|
||||
run: |
|
||||
if [ "${{ steps.setup-gradle.outcome}}" != "failure" ] ; then
|
||||
echo "Expected validation to fail, but it didn't"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
test-validation-success:
|
||||
wrapper-validation-success:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Checkout sources
|
||||
uses: actions/checkout@v4
|
||||
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
|
||||
- name: Initialize integ-test
|
||||
uses: ./.github/actions/init-integ-test
|
||||
|
||||
@@ -54,6 +58,7 @@ jobs:
|
||||
with:
|
||||
# to allow the invalid wrapper jar present in test data
|
||||
allow-checksums: e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855
|
||||
min-wrapper-count: 10
|
||||
|
||||
- name: Check outcome
|
||||
env:
|
||||
@@ -61,17 +66,18 @@ jobs:
|
||||
# below to not accidentally inject code into shell script or break its syntax
|
||||
FAILED_WRAPPERS: ${{ steps.action-test.outputs.failed-wrapper }}
|
||||
FAILED_WRAPPERS_MATCHES: ${{ steps.action-test.outputs.failed-wrapper == '' }}
|
||||
shell: bash
|
||||
run: |
|
||||
if [ "$FAILED_WRAPPERS_MATCHES" != "true" ] ; then
|
||||
echo "'outputs.failed-wrapper' has unexpected content: $FAILED_WRAPPERS"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
test-validation-error:
|
||||
wrapper-validation-error:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Checkout sources
|
||||
uses: actions/checkout@v4
|
||||
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
|
||||
- name: Initialize integ-test
|
||||
uses: ./.github/actions/init-integ-test
|
||||
|
||||
@@ -88,6 +94,7 @@ jobs:
|
||||
VALIDATION_FAILED: ${{ steps.action-test.outcome == 'failure' }}
|
||||
FAILED_WRAPPERS: ${{ steps.action-test.outputs.failed-wrapper }}
|
||||
FAILED_WRAPPERS_MATCHES: ${{ steps.action-test.outputs.failed-wrapper == 'sources/test/jest/wrapper-validation/data/invalid/gradle-wrapper.jar|sources/test/jest/wrapper-validation/data/invalid/gradlе-wrapper.jar' }}
|
||||
shell: bash
|
||||
run: |
|
||||
if [ "$VALIDATION_FAILED" != "true" ] ; then
|
||||
echo "Expected validation to fail, but it didn't"
|
||||
@@ -98,3 +105,64 @@ jobs:
|
||||
echo "'outputs.failed-wrapper' has unexpected content: $FAILED_WRAPPERS"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
wrapper-validation-minimum-wrapper-count:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Checkout sources
|
||||
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
|
||||
- name: Initialize integ-test
|
||||
uses: ./.github/actions/init-integ-test
|
||||
|
||||
- name: Run wrapper-validation-action
|
||||
id: action-test
|
||||
uses: ./wrapper-validation
|
||||
with:
|
||||
# to allow the invalid wrapper jar present in test data
|
||||
allow-checksums: e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855
|
||||
min-wrapper-count: 11
|
||||
# Expected to fail; validated below
|
||||
continue-on-error: true
|
||||
|
||||
- name: Check outcome
|
||||
env:
|
||||
# Evaluate workflow expressions here as env variable values instead of inside shell script
|
||||
# below to not accidentally inject code into shell script or break its syntax
|
||||
VALIDATION_FAILED: ${{ steps.action-test.outcome == 'failure' }}
|
||||
shell: bash
|
||||
run: |
|
||||
if [ "$VALIDATION_FAILED" != "true" ] ; then
|
||||
echo "Expected validation to fail, but it didn't"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
wrapper-validation-zero-wrappers:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Checkout sources
|
||||
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 # Checkout the repository with no wrappers
|
||||
with:
|
||||
sparse-checkout: |
|
||||
.github/actions
|
||||
dist
|
||||
wrapper-validation
|
||||
- name: Initialize integ-test
|
||||
uses: ./.github/actions/init-integ-test
|
||||
|
||||
- name: Run wrapper-validation-action
|
||||
id: action-test
|
||||
uses: ./wrapper-validation
|
||||
# Expected to fail; validated below
|
||||
continue-on-error: true
|
||||
|
||||
- name: Check outcome
|
||||
env:
|
||||
# Evaluate workflow expressions here as env variable values instead of inside shell script
|
||||
# below to not accidentally inject code into shell script or break its syntax
|
||||
VALIDATION_FAILED: ${{ steps.action-test.outcome == 'failure' }}
|
||||
shell: bash
|
||||
run: |
|
||||
if [ "$VALIDATION_FAILED" != "true" ] ; then
|
||||
echo "Expected validation to fail, but it didn't"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
55
.github/workflows/suite-integ-test-caching.yml
vendored
Normal file
55
.github/workflows/suite-integ-test-caching.yml
vendored
Normal file
@@ -0,0 +1,55 @@
|
||||
name: suite-integ-test-caching
|
||||
|
||||
on:
|
||||
workflow_call:
|
||||
inputs:
|
||||
runner-os:
|
||||
type: string
|
||||
default: '["ubuntu-latest"]'
|
||||
skip-dist:
|
||||
type: boolean
|
||||
default: false
|
||||
|
||||
permissions:
|
||||
contents: read
|
||||
|
||||
jobs:
|
||||
cache-cleanup:
|
||||
uses: ./.github/workflows/integ-test-cache-cleanup.yml
|
||||
with:
|
||||
runner-os: '${{ inputs.runner-os }}'
|
||||
skip-dist: ${{ inputs.skip-dist }}
|
||||
|
||||
caching-config:
|
||||
uses: ./.github/workflows/integ-test-caching-config.yml
|
||||
with:
|
||||
runner-os: '${{ inputs.runner-os }}'
|
||||
skip-dist: ${{ inputs.skip-dist }}
|
||||
|
||||
restore-configuration-cache:
|
||||
if: ${{ ! github.event.pull_request.head.repo.fork }}
|
||||
uses: ./.github/workflows/integ-test-restore-configuration-cache.yml
|
||||
with:
|
||||
skip-dist: ${{ inputs.skip-dist }}
|
||||
secrets:
|
||||
GRADLE_ENCRYPTION_KEY: ${{ secrets.GRADLE_ENCRYPTION_KEY }}
|
||||
|
||||
restore-containerized-gradle-home:
|
||||
uses: ./.github/workflows/integ-test-restore-containerized-gradle-home.yml
|
||||
with:
|
||||
skip-dist: ${{ inputs.skip-dist }}
|
||||
|
||||
restore-custom-gradle-home:
|
||||
uses: ./.github/workflows/integ-test-restore-custom-gradle-home.yml
|
||||
with:
|
||||
skip-dist: ${{ inputs.skip-dist }}
|
||||
|
||||
restore-gradle-home:
|
||||
uses: ./.github/workflows/integ-test-restore-gradle-home.yml
|
||||
with:
|
||||
skip-dist: ${{ inputs.skip-dist }}
|
||||
|
||||
restore-java-toolchain:
|
||||
uses: ./.github/workflows/integ-test-restore-java-toolchain.yml
|
||||
with:
|
||||
skip-dist: ${{ inputs.skip-dist }}
|
||||
85
.github/workflows/suite-integ-test-other.yml
vendored
Normal file
85
.github/workflows/suite-integ-test-other.yml
vendored
Normal file
@@ -0,0 +1,85 @@
|
||||
name: suite-integ-test-other
|
||||
|
||||
on:
|
||||
workflow_call:
|
||||
inputs:
|
||||
runner-os:
|
||||
type: string
|
||||
default: '["ubuntu-latest"]'
|
||||
skip-dist:
|
||||
type: boolean
|
||||
default: false
|
||||
|
||||
permissions:
|
||||
contents: read
|
||||
|
||||
jobs:
|
||||
build-scan-publish:
|
||||
uses: ./.github/workflows/integ-test-build-scan-publish.yml
|
||||
with:
|
||||
runner-os: '${{ inputs.runner-os }}'
|
||||
skip-dist: ${{ inputs.skip-dist }}
|
||||
|
||||
dependency-graph:
|
||||
if: ${{ ! github.event.pull_request.head.repo.fork }}
|
||||
uses: ./.github/workflows/integ-test-dependency-graph.yml
|
||||
permissions:
|
||||
contents: write
|
||||
with:
|
||||
runner-os: '${{ inputs.runner-os }}'
|
||||
skip-dist: ${{ inputs.skip-dist }}
|
||||
|
||||
dependency-submission:
|
||||
if: ${{ ! github.event.pull_request.head.repo.fork }}
|
||||
uses: ./.github/workflows/integ-test-dependency-submission.yml
|
||||
permissions:
|
||||
contents: write
|
||||
with:
|
||||
runner-os: '${{ inputs.runner-os }}'
|
||||
skip-dist: ${{ inputs.skip-dist }}
|
||||
|
||||
dependency-submission-failures:
|
||||
if: ${{ ! github.event.pull_request.head.repo.fork }}
|
||||
uses: ./.github/workflows/integ-test-dependency-submission-failures.yml
|
||||
permissions:
|
||||
contents: write
|
||||
with:
|
||||
runner-os: '${{ inputs.runner-os }}'
|
||||
skip-dist: ${{ inputs.skip-dist }}
|
||||
|
||||
develocity-injection:
|
||||
if: ${{ ! github.event.pull_request.head.repo.fork }}
|
||||
uses: ./.github/workflows/integ-test-inject-develocity.yml
|
||||
with:
|
||||
skip-dist: ${{ inputs.skip-dist }}
|
||||
secrets:
|
||||
DEVELOCITY_ACCESS_KEY: ${{ secrets.DV_SOLUTIONS_ACCESS_KEY }}
|
||||
|
||||
provision-gradle-versions:
|
||||
uses: ./.github/workflows/integ-test-provision-gradle-versions.yml
|
||||
with:
|
||||
runner-os: '${{ inputs.runner-os }}'
|
||||
skip-dist: ${{ inputs.skip-dist }}
|
||||
|
||||
sample-kotlin-dsl:
|
||||
uses: ./.github/workflows/integ-test-sample-kotlin-dsl.yml
|
||||
with:
|
||||
runner-os: '${{ inputs.runner-os }}'
|
||||
skip-dist: ${{ inputs.skip-dist }}
|
||||
|
||||
sample-gradle-plugin:
|
||||
uses: ./.github/workflows/integ-test-sample-gradle-plugin.yml
|
||||
with:
|
||||
runner-os: '${{ inputs.runner-os }}'
|
||||
skip-dist: ${{ inputs.skip-dist }}
|
||||
|
||||
toolchain-detection:
|
||||
uses: ./.github/workflows/integ-test-detect-toolchains.yml
|
||||
with:
|
||||
skip-dist: ${{ inputs.skip-dist }}
|
||||
|
||||
wrapper-validation:
|
||||
uses: ./.github/workflows/integ-test-wrapper-validation.yml
|
||||
with:
|
||||
runner-os: '${{ inputs.runner-os }}'
|
||||
skip-dist: ${{ inputs.skip-dist }}
|
||||
14
.github/workflows/update-checksums-file.yml
vendored
14
.github/workflows/update-checksums-file.yml
vendored
@@ -7,20 +7,22 @@ on:
|
||||
workflow_dispatch:
|
||||
|
||||
permissions:
|
||||
contents: write
|
||||
pull-requests: write
|
||||
contents: read
|
||||
|
||||
jobs:
|
||||
update-checksums:
|
||||
permissions:
|
||||
contents: write
|
||||
pull-requests: write
|
||||
name: Update checksums
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v4
|
||||
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
|
||||
|
||||
- name: Set up Node.js
|
||||
uses: actions/setup-node@v4
|
||||
uses: actions/setup-node@1d0ff469b7ec7b3cb9d8673fde0c81c44821de2a # v4.2.0
|
||||
with:
|
||||
node-version: 20
|
||||
cache: npm
|
||||
@@ -28,7 +30,7 @@ jobs:
|
||||
|
||||
- name: Install dependencies
|
||||
run: |
|
||||
npm install typed-rest-client@1.8.11 --no-save
|
||||
npm clean-install typed-rest-client@1.8.11 --no-save
|
||||
working-directory: sources
|
||||
|
||||
- name: Update checksums file
|
||||
@@ -37,7 +39,7 @@ jobs:
|
||||
|
||||
# If there are no changes, this action will not create a pull request
|
||||
- name: Create or update pull request
|
||||
uses: peter-evans/create-pull-request@v6
|
||||
uses: peter-evans/create-pull-request@67ccf781d68cd99b580ae25a5c18a1cc84ffff1f # v7.0.6
|
||||
with:
|
||||
branch: bot/wrapper-checksums-update
|
||||
commit-message: Update known wrapper checksums
|
||||
|
||||
@@ -3,8 +3,9 @@
|
||||
The `build` script in the project root provides a convenient way to perform many local build tasks:
|
||||
1. `./build` will lint and compile typescript sources
|
||||
2. `./build all` will lint and compile typescript and run unit tests
|
||||
3. `./build init-scripts` will run the init-script integration tests
|
||||
4. `./build act <act-commands>` will run `act` after building local changes (see below)
|
||||
3. `./build install` will install npm packages followed by lint and compile
|
||||
4. `./build init-scripts` will run the init-script integration tests
|
||||
5. `./build act <act-commands>` will run `act` after building local changes (see below)
|
||||
|
||||
## Using `act` to run integ-test workflows locally
|
||||
|
||||
|
||||
11
README.md
11
README.md
@@ -1,5 +1,7 @@
|
||||
# GitHub Actions for Gradle builds
|
||||
|
||||
[](https://scorecard.dev/viewer/?uri=github.com/gradle/actions)
|
||||
|
||||
This repository contains a set of GitHub Actions that are useful for building Gradle projects on GitHub.
|
||||
|
||||
## The `setup-gradle` action
|
||||
@@ -30,7 +32,7 @@ jobs:
|
||||
distribution: 'temurin'
|
||||
java-version: 17
|
||||
- name: Setup Gradle
|
||||
uses: gradle/actions/setup-gradle@v3
|
||||
uses: gradle/actions/setup-gradle@v4
|
||||
- name: Build with Gradle
|
||||
run: ./gradlew build
|
||||
```
|
||||
@@ -68,7 +70,7 @@ jobs:
|
||||
distribution: 'temurin'
|
||||
java-version: 17
|
||||
- name: Generate and submit dependency graph
|
||||
uses: gradle/actions/dependency-submission@v3
|
||||
uses: gradle/actions/dependency-submission@v4
|
||||
```
|
||||
|
||||
See the [full action documentation](docs/dependency-submission.md) for more advanced usage scenarios.
|
||||
@@ -79,6 +81,9 @@ The `wrapper-validation` action validates the checksums of _all_ [Gradle Wrapper
|
||||
|
||||
The action should be run in the root of the repository, as it will recursively search for any files named `gradle-wrapper.jar`.
|
||||
|
||||
Starting with v4 the `setup-gradle` action will [perform wrapper validation](docs/setup-gradle.md#gradle-wrapper-validation) on each execution.
|
||||
If you are using `setup-gradle` in your workflows, it is unlikely that you will need to use the `wrapper-validation` action.
|
||||
|
||||
### Example workflow
|
||||
|
||||
```yaml
|
||||
@@ -94,7 +99,7 @@ jobs:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
- uses: gradle/actions/wrapper-validation@v3
|
||||
- uses: gradle/actions/wrapper-validation@v4
|
||||
```
|
||||
|
||||
See the [full action documentation](docs/wrapper-validation.md) for more advanced usage scenarios.
|
||||
|
||||
49
RELEASING.md
49
RELEASING.md
@@ -5,58 +5,27 @@
|
||||
- Check that https://github.com/gradle/actions/actions is green for all workflows for the main branch.
|
||||
- This should include any workflows triggered by `[bot] Update dist directory`
|
||||
- Decide on the version number to use for the release. The action releases should follow semantic versioning.
|
||||
- By default, a patch release is assumed (eg. `3.0.0` → `3.0.1`)
|
||||
- If new features have been added, bump the minor version (eg `3.1.1` → `3.2.0`)
|
||||
- If a new major release is required, bump the major version (eg `3.1.1` → `4.0.0`)
|
||||
- By default, a patch release is assumed (eg. `4.0.0` → `4.0.1`)
|
||||
- If new features have been added, bump the minor version (eg `4.1.1` → `4.2.0`)
|
||||
- If a new major release is required, bump the major version (eg `4.1.1` → `5.0.0`)
|
||||
- Note: The gradle actions follow the GitHub Actions convention of including a .0 patch number for the first release of a minor version, unlike the Gradle convention which omits the trailing .0.
|
||||
|
||||
## Release gradle/actions
|
||||
- Create a tag for the release. The tag should have the format `v3.1.0`
|
||||
- From CLI: `git tag v3.1.0 && git push --tags`
|
||||
- Create a tag for the release. The tag should have the format `v4.1.0`
|
||||
- From CLI: `git tag v4.1.0 && git push --tags`
|
||||
- Go to https://github.com/gradle/actions/releases and "Draft new release"
|
||||
- Use the newly created tag and copy the tag name exactly as the release title.
|
||||
- Craft release notes content based on issues closed, PRs merged and commits
|
||||
- Include a Full changelog link in the format https://github.com/gradle/actions/compare/v2.12.0...v3.0.0
|
||||
- Publish the release.
|
||||
- Force push the `v3` tag (or current major version) to point to the new release. It is conventional for users to bind to a major release version using this tag.
|
||||
- From CLI: `git tag -f -a -m "v3.0.0" v3 v3.0.0 && git push -f --tags`
|
||||
- Force push the `v4` tag (or current major version) to point to the new release. It is conventional for users to bind to a major release version using this tag.
|
||||
- From CLI: `git tag -f -a -m "v4.0.0" v4 v4.0.0 && git push -f --tags`
|
||||
- Note that we set the commit message for the tag to the newly released version.
|
||||
|
||||
## Release gradle/gradle-build-action
|
||||
|
||||
During the 3.x release series, we will continue to publish parallel releases of `gradle/gradle-build-action`. These releases will simply delegate to `gradle/actions/setup-gradle` with the same version.
|
||||
|
||||
- Update the [gradle-build-action action.yml](https://github.com/gradle/gradle-build-action/blob/main/action.yml#L162) file to point to the newly released version of `gradle/actions/setup-gradle`.
|
||||
- Ensure that any parameters that have been added to the setup-gradle action are added to the gradle-build-action definition, and that these are passed on to setup-gradle.
|
||||
- Create and push a tag for the release.
|
||||
- From CLI: `git tag v3.1.0 && git push --tags`
|
||||
- Go to https://github.com/gradle/gradle-build-action/releases and "Draft new release"
|
||||
- Use the newly created tag and copy the tag name exactly as the release title.
|
||||
- In the release notes, point users to the gradle/actions release. Include a header informing users to switch to `gradle/actions/setup-gradle`.
|
||||
- Publish the release.
|
||||
- Force push the `v3` tag (or current major version) to point to the new release.
|
||||
- From CLI: `git tag -f -a -m "v3.0.0" v3 v3.0.0 && git push -f --tags`
|
||||
|
||||
## Release gradle/wrapper-validation-action
|
||||
|
||||
During the 3.x release series, we will continue to publish parallel releases of `gradle/wrapper-validation-action`. These releases will simply delegate to `gradle/actions/wrapper-validation` with the same version.
|
||||
|
||||
- Update the [wrapper-validation-action action.yml](https://github.com/gradle/wrapper-validation-action/blob/main/action.yml#L162) file to point to the newly released version of `gradle/actions/wrapper-validation`.
|
||||
- Ensure that any parameters that have been added to the `wrapper-validation` action (if any) are added to the action definition, and that these are passed on to setup-gradle.
|
||||
- Create and push a tag for the release.
|
||||
- From CLI: `git tag v3.1.0 && git push --tags`
|
||||
- Go to https://github.com/gradle/wrapper-validation-action/releases and "Draft new release"
|
||||
- Use the newly created tag and copy the tag name exactly as the release title.
|
||||
- In the release notes, point users to the gradle/actions release. Include a header informing users to switch to `gradle/actions/wrapper-validation`.
|
||||
- Publish the release.
|
||||
- Force push the `v3` tag (or current major version) to point to the new release.
|
||||
- From CLI: `git tag -f -a -m "v3.0.0" v3 v3.0.0 && git push -f --tags`
|
||||
|
||||
## Post release steps
|
||||
|
||||
Submit PRs to update the GitHub starter workflow. Starter workflows contain content that should reference the Git hash of the current gradle/actions release:
|
||||
https://github.com/actions/starter-workflows has [gradle](https://github.com/actions/starter-workflows/blob/main/ci/gradle.yml) and [gradle-publish](https://github.com/actions/starter-workflows/blob/main/ci/gradle-publish.yml): see [the v2.1.4 update PR](https://github.com/actions/starter-workflows/pull/1489) for an example.
|
||||
https://github.com/actions/starter-workflows has [gradle](https://github.com/actions/starter-workflows/blob/main/ci/gradle.yml) and [gradle-publish](https://github.com/actions/starter-workflows/blob/main/ci/gradle-publish.yml): see [the v4.0.0 update PR](https://github.com/actions/starter-workflows/pull/2468) for an example.
|
||||
|
||||
Submit PRs to update the GitHub documentation. The documentation contains content that should reference the Git hash of the current gradle/actions release:
|
||||
https://github.com/github/docs has [building-and-testing-java-with-gradle](https://github.com/github/docs/blob/main/content/actions/automating-builds-and-tests/building-and-testing-java-with-gradle.md) and [publishing-java-packages-with-gradle](https://github.com/github/docs/blob/main/content/actions/publishing-packages/publishing-java-packages-with-gradle.md) : see [the v2.1.4 update PR](https://github.com/github/docs/pull/16392) for an example.
|
||||
|
||||
https://github.com/github/docs has [building-and-testing-java-with-gradle](https://github.com/github/docs/blob/main/content/actions/automating-builds-and-tests/building-and-testing-java-with-gradle.md) and [publishing-java-packages-with-gradle](https://github.com/github/docs/blob/main/content/actions/publishing-packages/publishing-java-packages-with-gradle.md) : see [the v4.0.0 update PR](https://github.com/github/docs/pull/34239) for an example.
|
||||
|
||||
27
build
27
build
@@ -2,14 +2,18 @@
|
||||
|
||||
cd sources
|
||||
|
||||
if [[ -f ~/.gradle/develocity/keys.properties ]]; then
|
||||
export NODE_OPTIONS='-r @gradle/develocity-agent/preload'
|
||||
export DEVELOCITY_URL=https://ge.solutions-team.gradle.com
|
||||
export DEVELOCITY_ACCESS_KEY=$(paste -sd ';' ~/.gradle/develocity/keys.properties)
|
||||
fi
|
||||
|
||||
case "$1" in
|
||||
all)
|
||||
npm clean-install
|
||||
npm run all
|
||||
;;
|
||||
act)
|
||||
# Build and copy outputs to the dist directory
|
||||
npm install
|
||||
npm run build
|
||||
cd ..
|
||||
cp -r sources/dist .
|
||||
@@ -18,18 +22,25 @@ case "$1" in
|
||||
# Revert the changes to the dist directory
|
||||
git checkout -- dist
|
||||
;;
|
||||
init-scripts)
|
||||
cd test/init-scripts
|
||||
./gradlew check
|
||||
;;
|
||||
dist)
|
||||
npm install
|
||||
npm clean-install
|
||||
npm run build
|
||||
cd ..
|
||||
cp -r sources/dist .
|
||||
;;
|
||||
init-scripts)
|
||||
cd test/init-scripts
|
||||
./gradlew check
|
||||
;;
|
||||
install)
|
||||
npm clean-install
|
||||
npm run build
|
||||
;;
|
||||
test)
|
||||
shift
|
||||
npm test -- $@
|
||||
;;
|
||||
*)
|
||||
npm install
|
||||
npm run build
|
||||
;;
|
||||
esac
|
||||
|
||||
@@ -29,7 +29,7 @@ jobs:
|
||||
distribution: 'temurin'
|
||||
java-version: 17
|
||||
- name: Generate and submit dependency graph
|
||||
uses: gradle/actions/dependency-submission@v3
|
||||
uses: gradle/actions/dependency-submission@v4
|
||||
```
|
||||
|
||||
See the [full action documentation](../docs/dependency-submission.md) for more advanced usage scenarios.
|
||||
|
||||
@@ -60,7 +60,8 @@ inputs:
|
||||
cache-cleanup:
|
||||
description: |
|
||||
Specifies if the action should attempt to remove any stale/unused entries from the Gradle User Home prior to saving to the GitHub Actions cache.
|
||||
By default, no cleanup is performed. It can be configured to run every time, or only when all Gradle builds succeed for the Job.
|
||||
By default ('on-success'), cleanup is performed when all Gradle builds succeed for the Job.
|
||||
This behaviour can be disabled ('never'), or configured to always run irrespective of the build outcome ('always').
|
||||
Valid values are 'never', 'on-success' and 'always'.
|
||||
required: false
|
||||
default: 'on-success'
|
||||
@@ -95,17 +96,20 @@ inputs:
|
||||
# Dependency Graph configuration
|
||||
dependency-graph:
|
||||
description: |
|
||||
Specifies how the dependency-graph should be handled by this action. By default a dependency-graph will be generated and submitted.
|
||||
Specifies how the dependency-graph should be handled by this action.
|
||||
By default a dependency-graph will be generated, submitted to the dependency-submission API, and saved as a workflow artifact.
|
||||
Valid values are:
|
||||
'generate-and-submit' (default): Generates a dependency graph for the project and submits it in the same Job.
|
||||
'generate-and-upload': Generates a dependency graph for the project and saves it as a workflow artifact.
|
||||
'generate-and-submit': Generates a dependency graph for the project and submits it in the same Job.
|
||||
'generate-submit-and-upload (default)': As per 'generate-and-submit', but also saves the dependency graph as a workflow artifact.
|
||||
'generate-and-upload': Generates a dependency graph for the project and saves it as a workflow artifact. Does not submit it to the repository.
|
||||
'download-and-submit': Retrieves a previously saved dependency-graph and submits it to the repository.
|
||||
|
||||
Use `generate-and-submit` if you prefer not to save the dependency-graph as a workflow artifact.
|
||||
The `generate-and-upload` and `download-and-submit` options are designed to be used in an untrusted workflow scenario,
|
||||
where the workflow generating the dependency-graph cannot (or should not) be given the `contents: write` permissions
|
||||
required to submit via the Dependency Submission API.
|
||||
required: false
|
||||
default: 'generate-and-submit'
|
||||
default: 'generate-submit-and-upload'
|
||||
|
||||
dependency-graph-report-dir:
|
||||
description: |
|
||||
@@ -146,7 +150,6 @@ inputs:
|
||||
artifact-retention-days:
|
||||
description: Specifies the number of days to retain any artifacts generated by the action. If not set, the default retention settings for the repository will apply.
|
||||
required: false
|
||||
default: 1
|
||||
|
||||
# Build Scan configuration
|
||||
build-scan-publish:
|
||||
|
||||
84946
dist/dependency-submission/main/index.js
vendored
84946
dist/dependency-submission/main/index.js
vendored
File diff suppressed because one or more lines are too long
2
dist/dependency-submission/main/index.js.map
vendored
2
dist/dependency-submission/main/index.js.map
vendored
File diff suppressed because one or more lines are too long
57260
dist/dependency-submission/post/index.js
vendored
57260
dist/dependency-submission/post/index.js
vendored
File diff suppressed because one or more lines are too long
2
dist/dependency-submission/post/index.js.map
vendored
2
dist/dependency-submission/post/index.js.map
vendored
File diff suppressed because one or more lines are too long
84969
dist/setup-gradle/main/index.js
vendored
84969
dist/setup-gradle/main/index.js
vendored
File diff suppressed because one or more lines are too long
2
dist/setup-gradle/main/index.js.map
vendored
2
dist/setup-gradle/main/index.js.map
vendored
File diff suppressed because one or more lines are too long
84967
dist/setup-gradle/post/index.js
vendored
84967
dist/setup-gradle/post/index.js
vendored
File diff suppressed because one or more lines are too long
2
dist/setup-gradle/post/index.js.map
vendored
2
dist/setup-gradle/post/index.js.map
vendored
File diff suppressed because one or more lines are too long
54297
dist/wrapper-validation/main/index.js
vendored
54297
dist/wrapper-validation/main/index.js
vendored
File diff suppressed because one or more lines are too long
2
dist/wrapper-validation/main/index.js.map
vendored
2
dist/wrapper-validation/main/index.js.map
vendored
File diff suppressed because one or more lines are too long
@@ -43,7 +43,7 @@ jobs:
|
||||
java-version: 17
|
||||
|
||||
- name: Generate and submit dependency graph
|
||||
uses: gradle/actions/dependency-submission@v3
|
||||
uses: gradle/actions/dependency-submission@v4
|
||||
```
|
||||
|
||||
### Gradle execution
|
||||
@@ -68,7 +68,7 @@ Three input parameters are required, one to enable publishing and two more to ac
|
||||
|
||||
```yaml
|
||||
- name: Generate and submit dependency graph
|
||||
uses: gradle/actions/dependency-submission@v3
|
||||
uses: gradle/actions/dependency-submission@v4
|
||||
with:
|
||||
build-scan-publish: true
|
||||
build-scan-terms-of-use-url: "https://gradle.com/help/legal-terms-of-use"
|
||||
@@ -83,7 +83,7 @@ In some cases, the default action configuration will not be sufficient, and addi
|
||||
|
||||
```yaml
|
||||
- name: Generate and save dependency graph
|
||||
uses: gradle/actions/dependency-submission@v3
|
||||
uses: gradle/actions/dependency-submission@v4
|
||||
with:
|
||||
# Use a particular Gradle version instead of the configured wrapper.
|
||||
gradle-version: 8.6
|
||||
@@ -103,6 +103,9 @@ In some cases, the default action configuration will not be sufficient, and addi
|
||||
# Do not attempt to submit the dependency-graph. Save it as a workflow artifact.
|
||||
dependency-graph: generate-and-upload
|
||||
|
||||
# Change the number of days that workflow artifacts are retained. (Default is 30 days).
|
||||
artifact-retention-days: 5
|
||||
|
||||
# Specify the location where dependency graph files will be generated.
|
||||
dependency-graph-report-dir: custom-report-dir
|
||||
|
||||
@@ -118,6 +121,29 @@ The `GitHub Dependency Graph Gradle Plugin` can be further
|
||||
These will be automatically set by the `dependency-submission` action, but you may override these values
|
||||
by setting them explicitly in your workflow file.
|
||||
|
||||
### Reducing storage costs for saved dependency graph artifacts
|
||||
|
||||
By default, the dependency graph that is generated is stored as a workflow artifact.
|
||||
To reduce storage costs for these artifacts, you can:
|
||||
|
||||
1. Set the `artifact-retention-days`:
|
||||
|
||||
```yaml
|
||||
- name: Generate dependency graph but only store workflow artifacts for 1 day
|
||||
uses: gradle/actions/dependency-submission@v4
|
||||
with:
|
||||
artifact-retention-days: 1 # Default is 30 days or as configured for repository
|
||||
```
|
||||
|
||||
2. Disable storing dependency-graph artifacts using `generate-and-submit`
|
||||
|
||||
```yaml
|
||||
- name: Generate and submit dependency graph but do not store as workflow artifact
|
||||
uses: gradle/actions/dependency-submission@v4
|
||||
with:
|
||||
dependency-graph: 'generate-and-submit' # Default value is 'generate-submit-and-upload'
|
||||
```
|
||||
|
||||
# Resolving a dependency vulnerability
|
||||
|
||||
## Finding the source of a dependency vulnerability
|
||||
@@ -273,10 +299,10 @@ For example, if you want to exclude dependencies resolved by the `buildSrc` proj
|
||||
|
||||
```yaml
|
||||
- name: Generate and submit dependency graph
|
||||
uses: gradle/actions/dependency-submission@v3
|
||||
uses: gradle/actions/dependency-submission@v4
|
||||
with:
|
||||
# Exclude all dependencies that originate solely in the 'buildSrc' project
|
||||
dependency-graph-exclude-projets: ':buildSrc'
|
||||
dependency-graph-exclude-projects: ':buildSrc'
|
||||
# Exclude dependencies that are only resolved in test classpaths
|
||||
dependency-graph-exclude-configurations: '.*[Tt]est(Compile|Runtime)Classpath'
|
||||
```
|
||||
@@ -295,12 +321,19 @@ The GitHub [dependency-review-action](https://github.com/actions/dependency-revi
|
||||
understand dependency changes (and the security impact of these changes) for a pull request,
|
||||
by comparing the dependency graph for the pull-request with that of the HEAD commit.
|
||||
|
||||
Example of a pull request workflow that executes a build for a pull request and runs the `dependency-review-action`:
|
||||
Integrating the Dependency Review Action requires 2 changes to your workflows:
|
||||
|
||||
#### 1. Add a `pull_request` trigger to your existing Dependency Submission workflow.
|
||||
|
||||
In order to perform Dependency Review on a pull request, the dependency graph must be submitted for the pull request.
|
||||
To do this, simply add a `pull_request` trigger to your existing dependency submission workflow.
|
||||
|
||||
```yaml
|
||||
name: Dependency review for pull requests
|
||||
name: Dependency Submission
|
||||
|
||||
on:
|
||||
push:
|
||||
branches: [ 'main' ]
|
||||
pull_request:
|
||||
|
||||
permissions:
|
||||
@@ -317,12 +350,38 @@ jobs:
|
||||
java-version: 17
|
||||
|
||||
- name: Generate and submit dependency graph
|
||||
uses: gradle/actions/dependency-submission@v3
|
||||
|
||||
- name: Perform dependency review
|
||||
uses: actions/dependency-review-action@v3
|
||||
uses: gradle/actions/dependency-submission@v4
|
||||
```
|
||||
|
||||
#### 2. Add a dedicated Dependency Review workflow
|
||||
|
||||
The Dependency Review workflow will be triggered directly on `pull_request`, but will wait until the dependency graph results are
|
||||
submitted before the dependency review can complete. The period to wait is controlled by the `retry-on-snapshot-warnings` input parameters.
|
||||
|
||||
Here's an example of a separate "Dependency Review" workflow that will wait up to 10 minutes for dependency submission to complete.
|
||||
|
||||
```yaml
|
||||
name: Dependency Review
|
||||
|
||||
on:
|
||||
pull_request:
|
||||
|
||||
permissions:
|
||||
contents: read
|
||||
|
||||
jobs:
|
||||
dependency-review:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: 'Dependency Review'
|
||||
uses: actions/dependency-review-action@v4
|
||||
with:
|
||||
retry-on-snapshot-warnings: true
|
||||
retry-on-snapshot-warnings-timeout: 600
|
||||
```
|
||||
|
||||
The `retry-on-snapshot-warnings-timeout` (in seconds) needs to be long enough to allow the modified dependency-submission workflow to complete.
|
||||
|
||||
## Usage with pull requests from public forked repositories
|
||||
|
||||
This `contents: write` permission is [not available for any workflow that is triggered by a pull request submitted from a public forked repository](https://docs.github.com/en/actions/security-guides/automatic-token-authentication#permissions-for-the-github_token).
|
||||
@@ -353,7 +412,7 @@ jobs:
|
||||
java-version: 17
|
||||
|
||||
- name: Generate and save dependency graph
|
||||
uses: gradle/actions/dependency-submission@v3
|
||||
uses: gradle/actions/dependency-submission@v4
|
||||
with:
|
||||
dependency-graph: generate-and-upload
|
||||
```
|
||||
@@ -376,41 +435,11 @@ jobs:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Download and submit dependency graph
|
||||
uses: gradle/actions/dependency-submission@v3
|
||||
uses: gradle/actions/dependency-submission@v4
|
||||
with:
|
||||
dependency-graph: download-and-submit # Download saved dependency-graph and submit
|
||||
```
|
||||
|
||||
### Integrating `dependency-review-action` for pull requests from public forked repositories
|
||||
|
||||
To integrate the `dependency-review-action` into the pull request workflows above, a third workflow file is required.
|
||||
This workflow will be triggered directly on `pull_request`, but will wait until the dependency graph results are
|
||||
submitted before the dependency review can complete. The period to wait is controlled by the `retry-on-snapshot-warnings` input parameters.
|
||||
|
||||
Here's an example of a separate "Dependency Review" workflow that will wait for 10 minutes for the above PR check workflow to complete.
|
||||
|
||||
```yaml
|
||||
name: dependency-review
|
||||
|
||||
on:
|
||||
pull_request:
|
||||
|
||||
permissions:
|
||||
contents: read
|
||||
|
||||
jobs:
|
||||
dependency-review:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: 'Dependency Review'
|
||||
uses: actions/dependency-review-action@v3
|
||||
with:
|
||||
retry-on-snapshot-warnings: true
|
||||
retry-on-snapshot-warnings-timeout: 600
|
||||
```
|
||||
|
||||
The `retry-on-snapshot-warnings-timeout` (in seconds) needs to be long enough to allow the entire `Generate and save dependency graph` and `Download and submit dependency graph` workflows (above) to complete.
|
||||
|
||||
# Gradle version compatibility
|
||||
|
||||
Dependency-graph generation is compatible with most versions of Gradle >= `5.2`, and is tested regularly against
|
||||
|
||||
@@ -20,7 +20,7 @@ To convert your workflows, simply replace:
|
||||
```
|
||||
with
|
||||
```
|
||||
uses: gradle/actions/setup-gradle@v3
|
||||
uses: gradle/actions/setup-gradle@v4
|
||||
```
|
||||
|
||||
## The action `gradle/wrapper-validation-action` has been replaced by `gradle/actions/wrapper-validation`
|
||||
@@ -40,7 +40,7 @@ To convert your workflows, simply replace:
|
||||
```
|
||||
with
|
||||
```
|
||||
uses: gradle/actions/wrapper-validation@v3
|
||||
uses: gradle/actions/wrapper-validation@v4
|
||||
```
|
||||
|
||||
## Using the action to execute Gradle via the `arguments` parameter is deprecated
|
||||
@@ -82,7 +82,7 @@ The exact syntax depends on whether or not your project is configured with the [
|
||||
|
||||
```
|
||||
- name: Setup Gradle
|
||||
uses: gradle/actions/setup-gradle@v3
|
||||
uses: gradle/actions/setup-gradle@v4
|
||||
|
||||
- name: Assemble the project
|
||||
run: ./gradlew assemble
|
||||
@@ -99,9 +99,9 @@ The exact syntax depends on whether or not your project is configured with the [
|
||||
|
||||
```
|
||||
- name: Setup Gradle for a non-wrapper project
|
||||
uses: gradle/actions/setup-gradle@v3
|
||||
uses: gradle/actions/setup-gradle@v4
|
||||
with:
|
||||
gradle-version: 8.9
|
||||
gradle-version: "8.11"
|
||||
|
||||
- name: Assemble the project
|
||||
run: gradle assemble
|
||||
|
||||
@@ -45,7 +45,7 @@ jobs:
|
||||
java-version: 17
|
||||
|
||||
- name: Setup Gradle
|
||||
uses: gradle/actions/setup-gradle@v3
|
||||
uses: gradle/actions/setup-gradle@v4
|
||||
|
||||
- name: Execute Gradle build
|
||||
run: ./gradlew build
|
||||
@@ -57,11 +57,11 @@ The `setup-gradle` action can download and install a specified Gradle version, a
|
||||
Downloaded Gradle versions are stored in the GitHub Actions cache, to avoid having to download them again later.
|
||||
|
||||
```yaml
|
||||
- name: Setup Gradle 8.5
|
||||
uses: gradle/actions/setup-gradle@v3
|
||||
- name: Setup Gradle 8.10
|
||||
uses: gradle/actions/setup-gradle@v4
|
||||
with:
|
||||
gradle-version: 8.5
|
||||
- name: Build with Gradle 8.5
|
||||
gradle-version: "8.10" # Quotes required to prevent YAML converting to number
|
||||
- name: Build with Gradle 8.10
|
||||
run: gradle build
|
||||
```
|
||||
|
||||
@@ -96,7 +96,7 @@ jobs:
|
||||
distribution: temurin
|
||||
java-version: 17
|
||||
|
||||
- uses: gradle/actions/setup-gradle@v3
|
||||
- uses: gradle/actions/setup-gradle@v4
|
||||
id: setup-gradle
|
||||
with:
|
||||
gradle-version: release-candidate
|
||||
@@ -127,6 +127,8 @@ cache-disabled: true
|
||||
|
||||
By default, The `setup-gradle` action will only write to the cache from Jobs on the default (`main`/`master`) branch.
|
||||
Jobs on other branches will read entries from the cache but will not write updated entries.
|
||||
|
||||
This setup is designed around [GitHub imposed restrictions on cache access](https://docs.github.com/en/actions/using-workflows/caching-dependencies-to-speed-up-workflows#restrictions-for-accessing-a-cache) and should work well in most scenarios.
|
||||
See [Optimizing cache effectiveness](#select-which-branches-should-write-to-the-cache) for a more detailed explanation.
|
||||
|
||||
In some circumstances, it makes sense to change this default and configure a workflow Job to read existing cache entries but not to write changes back.
|
||||
@@ -196,6 +198,9 @@ When Gradle is executed with the [configuration-cache](https://docs.gradle.org/c
|
||||
in the project directory, at `<project-dir>/.gradle/configuration-cache`. Due to the way the configuration-cache works, [this file may contain stored credentials and other
|
||||
secrets](https://docs.gradle.org/release-nightly/userguide/configuration_cache.html#config_cache:secrets), and this data needs to be encrypted to be safely stored in the GitHub Actions cache.
|
||||
|
||||
> [!IMPORTANT]
|
||||
> To avoid potentially leaking secrets in the configuration-cache entry, the action will only save or restore configuration-cache data if the `cache-encryption-key` parameter is set.
|
||||
|
||||
To benefit from configuration caching in your GitHub Actions workflow, you must:
|
||||
- Execute your build with Gradle 8.6 or newer. This can be achieved directly or via the Gradle Wrapper.
|
||||
- Enable the configuration cache for your build.
|
||||
@@ -213,14 +218,17 @@ jobs:
|
||||
distribution: temurin
|
||||
java-version: 17
|
||||
|
||||
- uses: gradle/actions/setup-gradle@v3
|
||||
- uses: gradle/actions/setup-gradle@v4
|
||||
with:
|
||||
gradle-version: 8.6
|
||||
cache-encryption-key: ${{ secrets.GradleEncryptionKey }}
|
||||
cache-encryption-key: ${{ secrets.GRADLE_ENCRYPTION_KEY }}
|
||||
- run: gradle build --configuration-cache
|
||||
```
|
||||
|
||||
> [!IMPORTANT]
|
||||
Even with everything correctly configured, you may find that the configuration-cache entry is not reused in your workflow.
|
||||
This is often due to a known issue: [Included builds containing build logic prevent configuration-cache reuse](https://github.com/gradle/actions/issues/21). Refer to the issue for more details.
|
||||
|
||||
> [!NOTE]
|
||||
> The configuration cache cannot be saved or restored in workflows triggered by a pull requests from a repository fork.
|
||||
> This is because [GitHub secrets are not passed to workflows triggered by PRs from forks](https://docs.github.com/en/actions/security-guides/using-secrets-in-github-actions#using-secrets-in-a-workflow).
|
||||
> This prevents a malicious PR from reading the configuration-cache data, which may encode secrets read by Gradle.
|
||||
@@ -430,6 +438,15 @@ so that a Job Summary is never generated, or so that a Job Summary is only gener
|
||||
add-job-summary: 'on-failure' # Valid values are 'always' (default), 'never', and 'on-failure'
|
||||
```
|
||||
|
||||
### Excluding specific Gradle builds from Job Summary
|
||||
|
||||
The Job Summary works by installing an init-script in Gradle User Home which will record details of any Gradle execution during the workflow.
|
||||
This means that any Gradle excecution sharing the same Gradle User Home will show up in the Job Summary, which may include Gradle executions
|
||||
run as part of integration testing.
|
||||
|
||||
To avoid having these test builds show up in the Job Summary, add the `GRADLE_ACTIONS_SKIP_BUILD_RESULT_CAPTURE=true` environment variable
|
||||
to the process that executes Gradle. This will stop the init-script from collecting any build results.
|
||||
|
||||
### Adding Job Summary as a Pull Request comment
|
||||
|
||||
It is sometimes more convenient to view the results of a GitHub Actions Job directly from the Pull Request that triggered
|
||||
@@ -455,7 +472,7 @@ jobs:
|
||||
java-version: 17
|
||||
|
||||
- name: Setup Gradle
|
||||
uses: gradle/actions/setup-gradle@v3
|
||||
uses: gradle/actions/setup-gradle@v4
|
||||
with:
|
||||
add-job-summary-as-pr-comment: on-failure # Valid values are 'never' (default), 'always', and 'on-failure'
|
||||
|
||||
@@ -492,17 +509,17 @@ jobs:
|
||||
java-version: 17
|
||||
|
||||
- name: Setup Gradle
|
||||
uses: gradle/actions/setup-gradle@v3
|
||||
uses: gradle/actions/setup-gradle@v4
|
||||
|
||||
- name: Run build with Gradle wrapper
|
||||
run: ./gradlew build --scan
|
||||
|
||||
- name: Upload build reports
|
||||
uses: actions/upload-artifact@v3
|
||||
uses: actions/upload-artifact@v4
|
||||
if: always()
|
||||
with:
|
||||
name: build-reports
|
||||
path: build/reports/
|
||||
path: **/build/reports/
|
||||
```
|
||||
|
||||
### Use of custom init-scripts in Gradle User Home
|
||||
@@ -523,7 +540,7 @@ If you do not want wrapper-validation to occur automatically, you can disable it
|
||||
|
||||
```yaml
|
||||
- name: Setup Gradle
|
||||
uses: gradle/actions/setup-gradle@v3
|
||||
uses: gradle/actions/setup-gradle@v4
|
||||
with:
|
||||
validate-wrappers: false
|
||||
```
|
||||
@@ -535,7 +552,7 @@ These are not allowed by default.
|
||||
|
||||
```yaml
|
||||
- name: Setup Gradle
|
||||
uses: gradle/actions/setup-gradle@v3
|
||||
uses: gradle/actions/setup-gradle@v4
|
||||
with:
|
||||
validate-wrappers: true
|
||||
allow-snapshot-wrappers: true
|
||||
@@ -600,7 +617,7 @@ jobs:
|
||||
java-version: 17
|
||||
|
||||
- name: Setup Gradle to generate and submit dependency graphs
|
||||
uses: gradle/actions/setup-gradle@v3
|
||||
uses: gradle/actions/setup-gradle@v4
|
||||
with:
|
||||
dependency-graph: generate-and-submit
|
||||
- name: Run the usual CI build (dependency-graph will be generated and submitted post-job)
|
||||
@@ -627,7 +644,7 @@ graph cannot be generated or submitted. You can enable this behavior with the `d
|
||||
|
||||
```yaml
|
||||
# Ensure that the workflow Job will fail if the dependency graph cannot be submitted
|
||||
- uses: gradle/actions/setup-gradle@v3
|
||||
- uses: gradle/actions/setup-gradle@v4
|
||||
with:
|
||||
dependency-graph: generate-and-submit
|
||||
dependency-graph-continue-on-failure: false
|
||||
@@ -652,7 +669,7 @@ jobs:
|
||||
java-version: 17
|
||||
|
||||
- name: Setup Gradle to generate and submit dependency graphs
|
||||
uses: gradle/actions/setup-gradle@v3
|
||||
uses: gradle/actions/setup-gradle@v4
|
||||
with:
|
||||
dependency-graph: generate-and-submit
|
||||
- name: Run a build, resolving the 'dependency-graph' plugin from the plugin portal proxy
|
||||
@@ -682,7 +699,7 @@ jobs:
|
||||
java-version: 17
|
||||
|
||||
- name: Setup Gradle to generate and submit dependency graphs
|
||||
uses: gradle/actions/setup-gradle@v3
|
||||
uses: gradle/actions/setup-gradle@v4
|
||||
with:
|
||||
dependency-graph: generate-and-submit
|
||||
- name: Build the app, generating a graph of dependencies required
|
||||
@@ -710,28 +727,106 @@ A known exception to this is that Gradle `7.0`, `7.0.1`, and `7.0.2` are not sup
|
||||
|
||||
See [here](https://github.com/gradle/github-dependency-graph-gradle-plugin?tab=readme-ov-file#gradle-compatibility) for complete compatibility information.
|
||||
|
||||
### Reducing storage costs for saved dependency graph artifacts
|
||||
# Develocity Build Scan® integration
|
||||
|
||||
When `generate` or `generate-and-submit` is used with the action, the dependency graph that is generated is stored as a workflow artifact.
|
||||
By default, these artifacts are retained for 30 days (or as configured for the repository).
|
||||
To reduce storage costs for these artifacts, you can set the `artifact-retention-days` value to a lower number.
|
||||
Publishing a Develocity Build Scan can be very helpful for Gradle builds run on GitHub Actions. Each Build Scan provides a
|
||||
detailed report of the execution of the build, including which tasks were executed and the results of any test execution.
|
||||
|
||||
The `setup-gradle` plugin provides a number of features to enable and enhance publishing Build Scans® to a Develocity instance.
|
||||
|
||||
## Publishing to scans.gradle.com
|
||||
|
||||
If you don't have a a private Develocity instance, you can easily publish Build Scans to the
|
||||
free, public Develocity instance (https://scans.gradle.com).
|
||||
|
||||
To publish to https://scans.gradle.com, you must specify in your workflow that you accept the [Gradle Terms of Use](https://gradle.com/help/legal-terms-of-use).
|
||||
|
||||
```yaml
|
||||
- name: Generate dependency graph, but only retain artifact for one day
|
||||
uses: gradle/actions/setup-gradle@v3
|
||||
- name: Setup Gradle to publish build scans
|
||||
uses: gradle/actions/setup-gradle@v4
|
||||
with:
|
||||
dependency-graph: generate
|
||||
artifact-retention-days: 1
|
||||
build-scan-publish: true
|
||||
build-scan-terms-of-use-url: "https://gradle.com/terms-of-service"
|
||||
build-scan-terms-of-use-agree: "yes"
|
||||
|
||||
- name: Run a Gradle build - a build scan will be published automatically
|
||||
run: ./gradlew build
|
||||
```
|
||||
|
||||
# Develocity plugin injection
|
||||
## Managing Develocity access keys
|
||||
|
||||
The `setup-gradle` action provides support for injecting and configuring the Develocity Gradle plugin into any Gradle build, without any modification to the project sources.
|
||||
This is achieved via an init-script installed into Gradle User Home, which is enabled and parameterized via environment variables.
|
||||
Develocity access keys are long-lived, creating risks if they are leaked. To mitigate this risk this,
|
||||
the `setup-gradle` action can automatically attempt to obtain a [short-lived access token](https://docs.gradle.com/develocity/gradle-plugin/current/#short_lived_access_tokens)
|
||||
to use when authenticating with Develocity.
|
||||
The short-lived access token will then be used wherever a Develocity access key is required.
|
||||
|
||||
```yaml
|
||||
- name: Setup Gradle
|
||||
uses: gradle/actions/setup-gradle@v4
|
||||
with:
|
||||
develocity-access-key: ${{ secrets.MY_DEVELOCITY_ACCESS_KEY }} # Long-lived access key, visiblility is restricted to this step.
|
||||
|
||||
# Subsequent steps will automatically use a short-lived access token to authenticate with Develocity
|
||||
- name: Run a Gradle build that is configured to publish to Develocity.
|
||||
run: ./gradlew build
|
||||
```
|
||||
|
||||
### Increasing the expiry time for Develocity access tokens
|
||||
|
||||
By default, a short-lived Develocity access token will be valid for 2 hours from the time it is generated. If your workflows take longer than
|
||||
2 hours to complete, you may see failure to publish Build Scans due to access token expiry.
|
||||
|
||||
To avoid this, use the `develocity-token-expiry` parameter to specify a different token expiry in hours.
|
||||
|
||||
```yaml
|
||||
- name: Setup Gradle
|
||||
uses: gradle/actions/setup-gradle@v4
|
||||
with:
|
||||
develocity-access-key: ${{ secrets.MY_DEVELOCITY_ACCESS_KEY }}
|
||||
develocity-token-expiry: 8 # The number of hours that the access token should remain valid (max 24).
|
||||
```
|
||||
|
||||
### Develocity access key supplied as environment variable
|
||||
|
||||
The preferred mechanism is to supply the long-lived Develocity access key directly to `setup-gradle` via
|
||||
the `develocity-access-key` input variable. However, the action will also detect an access key configured as an environment variable,
|
||||
such as `DEVELOCITY_ACCESS_KEY` or `GRADLE_ENTERPRISE_ACCESS_KEY`. In this case, the environment variable value will be replaced by
|
||||
a short-lived access token, thus hiding the long-lived access key from subsequent steps.
|
||||
|
||||
```yaml
|
||||
env:
|
||||
DEVELOCITY_ACCESS_KEY: ${{ secrets.MY_DEVELOCITY_ACCESS_KEY }}
|
||||
|
||||
jobs:
|
||||
build-with-gradle:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Setup Gradle
|
||||
uses: gradle/actions/setup-gradle@v4
|
||||
|
||||
# The build will automatically use a short-lived access token to authenticate with Develocity
|
||||
- name: Run a Gradle build that is configured to publish to Develocity.
|
||||
run: ./gradlew build
|
||||
```
|
||||
|
||||
### Failure to obtain a short-lived access token
|
||||
|
||||
If a short-lived token cannot be retrieved (for example, if the Develocity server version is lower than `2024.1`):
|
||||
- If the access key is provided via `develocity-access-key`, then no access token is set and authentication with Develocity will not succeed.
|
||||
- If the access key is provided via an environment variable, a warning will be logged and the environment variable will be left as-is.
|
||||
This can result in long-lived access keys being unintentionally exposed to other workflow steps.
|
||||
For more information on short-lived tokens, see [Develocity API documentation](https://docs.gradle.com/develocity/api-manual/#short_lived_access_tokens).
|
||||
|
||||
## Develocity plugin injection
|
||||
|
||||
The `setup-gradle` action provides support for transparently injecting and configuring the Develocity Gradle plugin into any Gradle build,
|
||||
without any modification to the project sources. This allows Build Scans to be published for a repository without any changes to the project sources.
|
||||
|
||||
Develocity injection is achieved via an init-script installed into Gradle User Home, which is enabled and parameterized via environment variables.
|
||||
|
||||
The same auto-injection behavior is available for the Common Custom User Data Gradle plugin, which enriches any build scans published with additional useful information.
|
||||
|
||||
## Enabling Develocity injection
|
||||
### Enabling Develocity injection
|
||||
|
||||
To enable Develocity injection for your build, you must provide the required configuration via inputs.
|
||||
|
||||
@@ -739,7 +834,7 @@ Here's a minimal example:
|
||||
|
||||
```yaml
|
||||
- name: Setup Gradle
|
||||
uses: gradle/actions/setup-gradle@v3
|
||||
uses: gradle/actions/setup-gradle@v4
|
||||
with:
|
||||
develocity-injection-enabled: true
|
||||
develocity-url: https://develocity.your-server.com
|
||||
@@ -749,14 +844,14 @@ Here's a minimal example:
|
||||
run: ./gradlew build
|
||||
```
|
||||
|
||||
This configuration will automatically apply `v3.17.6` of the [Develocity Gradle plugin](https://docs.gradle.com/develocity/gradle-plugin/), and publish build scans to https://develocity.your-server.com.
|
||||
This configuration will automatically apply `v3.19.1` of the [Develocity Gradle plugin](https://docs.gradle.com/develocity/gradle-plugin/), and publish build scans to https://develocity.your-server.com.
|
||||
|
||||
This example assumes that the `develocity.your-server.com` server allows anonymous publishing of build scans.
|
||||
In the likely scenario that your Develocity server requires authentication, you will also need to pass a valid [Develocity access key](https://docs.gradle.com/develocity/gradle-plugin/#via_environment_variable) taken from a secret:
|
||||
|
||||
```yaml
|
||||
- name: Setup Gradle
|
||||
uses: gradle/actions/setup-gradle@v3
|
||||
uses: gradle/actions/setup-gradle@v4
|
||||
with:
|
||||
develocity-access-key: ${{ secrets.MY_DEVELOCITY_ACCESS_KEY }}
|
||||
|
||||
@@ -770,14 +865,7 @@ In the likely scenario that your Develocity server requires authentication, you
|
||||
|
||||
This access key will be used during the action execution to get a short-lived token and set it to the DEVELOCITY_ACCESS_KEY environment variable.
|
||||
|
||||
### Short-lived access tokens
|
||||
Develocity access keys are long-lived, creating risks if they are leaked. To avoid this, users can use short-lived access tokens to authenticate with Develocity. Access tokens can be used wherever an access key would be used. Access tokens are only valid for the Develocity instance that created them.
|
||||
If a short-lived token fails to be retrieved (for example, if the Develocity server version is lower than `2024.1`):
|
||||
- if a `GRADLE_ENTERPRISE_ACCESS_KEY` env var has been set, we're falling back to it with a deprecation warning
|
||||
- otherwise no access key env var will be set. In that case Develocity authenticated operations like build cache read/write and build scan publication will fail without failing the build.
|
||||
For more information on short-lived tokens, see [Develocity API documentation](https://docs.gradle.com/develocity/api-manual/#short_lived_access_tokens).
|
||||
|
||||
## Configuring Develocity injection
|
||||
### Configuring Develocity injection
|
||||
|
||||
The `init-script` supports several additional configuration parameters that you may find useful. All configuration options (required and optional) are detailed below:
|
||||
|
||||
@@ -814,33 +902,16 @@ Here's an example using the env vars:
|
||||
|
||||
```yaml
|
||||
- name: Setup Gradle
|
||||
uses: gradle/actions/setup-gradle@v3
|
||||
uses: gradle/actions/setup-gradle@v4
|
||||
|
||||
- name: Run a Gradle build with Develocity injection enabled with environment variables
|
||||
run: ./gradlew build
|
||||
env:
|
||||
DEVELOCITY_INJECTION_ENABLED: true
|
||||
DEVELOCITY_URL: https://develocity.your-server.com
|
||||
DEVELOCITY_PLUGIN_VERSION: 3.17.6
|
||||
```
|
||||
|
||||
## Publishing to scans.gradle.com
|
||||
|
||||
Develocity injection is designed to enable the publishing of build scans to a Develocity instance,
|
||||
but is also useful for publishing to the public Build Scans instance (https://scans.gradle.com).
|
||||
|
||||
To publish to https://scans.gradle.com, you must specify in your workflow that you accept the [Gradle Terms of Use](https://gradle.com/help/legal-terms-of-use).
|
||||
|
||||
```yaml
|
||||
- name: Setup Gradle to publish build scans
|
||||
uses: gradle/actions/setup-gradle@v3
|
||||
with:
|
||||
build-scan-publish: true
|
||||
build-scan-terms-of-use-url: "https://gradle.com/terms-of-service"
|
||||
build-scan-terms-of-use-agree: "yes"
|
||||
|
||||
- name: Run a Gradle build - a build scan will be published automatically
|
||||
run: ./gradlew build
|
||||
DEVELOCITY_ENFORCE_URL: true
|
||||
DEVELOCITY_PLUGIN_VERSION: "3.19"
|
||||
DEVELOCITY_CCUD_PLUGIN_VERSION: "2.1"
|
||||
```
|
||||
|
||||
# Dependency verification
|
||||
|
||||
@@ -4,8 +4,11 @@ This action validates the checksums of _all_ [Gradle Wrapper](https://docs.gradl
|
||||
|
||||
The action should be run in the root of the repository, as it will recursively search for any files named `gradle-wrapper.jar`.
|
||||
|
||||
The `setup-gradle` action will perform wrapper validation on each execution. If you are using `setup-gradle` in your
|
||||
workflows, it is unlikely that you will need to use this action.
|
||||
> [!NOTE]
|
||||
> Starting with v4 the `setup-gradle` action will automatically [perform wrapper validation](../docs/setup-gradle.md#gradle-wrapper-validation)
|
||||
> on each execution.
|
||||
>
|
||||
> If you are using `setup-gradle` in your workflows, it is unlikely that you will need to use the `wrapper-validation` action.
|
||||
|
||||
## The Gradle Wrapper Problem in Open Source
|
||||
|
||||
@@ -47,7 +50,7 @@ We created an example [Homoglyph attack PR here](https://github.com/JLLeitschuh/
|
||||
Simply add this action to your workflow **after** having checked out your source tree and **before** running any Gradle build:
|
||||
|
||||
```yaml
|
||||
uses: gradle/actions/wrapper-validation@v3
|
||||
uses: gradle/actions/wrapper-validation@v4
|
||||
```
|
||||
|
||||
This action step should precede any step using `gradle/gradle-build-action` or `gradle/actions/setup-gradle`.
|
||||
@@ -70,7 +73,7 @@ jobs:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
- uses: gradle/actions/wrapper-validation@v3
|
||||
- uses: gradle/actions/wrapper-validation@v4
|
||||
```
|
||||
|
||||
## Contributing to an external GitHub Repository
|
||||
@@ -99,7 +102,8 @@ A wrapper jar can fail validation for a few reasons:
|
||||
1. The wrapper is from a snapshot build of Gradle (nightly or release nightly) and you have not set `allow-snapshots`
|
||||
or `allow-snapshot-wrappers` to `true`.
|
||||
2. The wrapper jar is from a version of Gradle with an unverifiable wrapper jar (see below).
|
||||
3. The wrapper jar was not published by Gradle, and could be compromised.
|
||||
3. The wrapper jar is saved in Git LFS, and has not been correctly restored on checkout (see below).
|
||||
4. The wrapper jar was not published by Gradle, and could be compromised.
|
||||
|
||||
If this GitHub action fails because a `gradle-wrapper.jar` was not published by Gradle,
|
||||
we highly recommend that you reach out to us at [security@gradle.com](mailto:security@gradle.com).
|
||||
@@ -110,6 +114,17 @@ Wrapper Jars generated by Gradle versions `3.3` to `4.0` are not verifiable beca
|
||||
- If the Gradle version in `gradle-wrapper.properties` is outside of this range, you can regenerate the `gradle-wrapper.jar` by running `./gradlew wrapper`. This will generate a new, verifiable wrapper jar.
|
||||
- If you need to run your build with a version of Gradle between 3.3 and 4.0, you can use a newer version of Gradle to generate the `gradle-wrapper.jar`.
|
||||
|
||||
#### Wrapper Jar stored with Git LFS
|
||||
If your repository is configured to store Wrapper Jars in Git Large File Storage (LFS), then you must include the configuration to correctly
|
||||
restore these Jars on checkout. Without this, only a pointer to the Wrapper Jar is restored, and the checksum verification will fail.
|
||||
|
||||
```
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
with:
|
||||
lfs: true # gradle-wrapper.jar verification will fail without this
|
||||
```
|
||||
|
||||
## Resources
|
||||
|
||||
To learn more about verifying the Gradle Wrapper JAR locally, see our
|
||||
|
||||
@@ -26,7 +26,7 @@ jobs:
|
||||
distribution: 'temurin'
|
||||
java-version: 17
|
||||
- name: Setup Gradle
|
||||
uses: gradle/actions/setup-gradle@v3
|
||||
uses: gradle/actions/setup-gradle@v4
|
||||
- name: Build with Gradle
|
||||
run: ./gradlew build
|
||||
```
|
||||
|
||||
@@ -43,7 +43,8 @@ inputs:
|
||||
cache-cleanup:
|
||||
description: |
|
||||
Specifies if the action should attempt to remove any stale/unused entries from the Gradle User Home prior to saving to the GitHub Actions cache.
|
||||
By default, no cleanup is performed. It can be configured to run every time, or only when all Gradle builds succeed for the Job.
|
||||
By default ('on-success'), cleanup is performed when all Gradle builds succeed for the Job.
|
||||
This behaviour can be disabled ('never'), or configured to always run irrespective of the build outcome ('always').
|
||||
Valid values are 'never', 'on-success' and 'always'.
|
||||
required: false
|
||||
default: 'on-success'
|
||||
@@ -79,7 +80,7 @@ inputs:
|
||||
dependency-graph:
|
||||
description: |
|
||||
Specifies if a GitHub dependency snapshot should be generated for each Gradle build, and if so, how.
|
||||
Valid values are 'disabled' (default), 'generate', 'generate-and-submit', 'generate-and-upload', and 'download-and-submit'.
|
||||
Valid values are 'disabled' (default), 'generate', 'generate-and-submit', 'generate-submit-and-upload', 'generate-and-upload', and 'download-and-submit'.
|
||||
required: false
|
||||
default: 'disabled'
|
||||
|
||||
|
||||
@@ -1,3 +1,3 @@
|
||||
# Configuration file for asdf version manager
|
||||
nodejs 20.10.0
|
||||
gradle 8.9
|
||||
gradle 8.12.1
|
||||
|
||||
6403
sources/package-lock.json
generated
6403
sources/package-lock.json
generated
File diff suppressed because it is too large
Load Diff
@@ -32,41 +32,41 @@
|
||||
],
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"@actions/artifact": "2.1.4",
|
||||
"@actions/cache": "3.2.4",
|
||||
"@actions/core": "1.10.1",
|
||||
"@actions/artifact": "2.2.1",
|
||||
"@actions/cache": "4.0.0",
|
||||
"@actions/core": "1.11.1",
|
||||
"@actions/exec": "1.1.1",
|
||||
"@actions/github": "6.0.0",
|
||||
"@actions/glob": "0.4.0",
|
||||
"@actions/http-client": "2.2.1",
|
||||
"@actions/tool-cache": "2.0.1",
|
||||
"@octokit/rest": "20.1.0",
|
||||
"@octokit/webhooks-types": "7.5.0",
|
||||
"cheerio": "^1.0.0-rc.12",
|
||||
"semver": "7.6.0",
|
||||
"@actions/glob": "0.5.0",
|
||||
"@actions/http-client": "2.2.3",
|
||||
"@actions/tool-cache": "2.0.2",
|
||||
"@octokit/rest": "21.1.0",
|
||||
"@octokit/webhooks-types": "7.6.1",
|
||||
"cheerio": "^1.0.0",
|
||||
"semver": "7.6.3",
|
||||
"string-argv": "0.3.2",
|
||||
"typed-rest-client": "1.8.11",
|
||||
"typed-rest-client": "2.1.0",
|
||||
"unhomoglyph": "1.0.6",
|
||||
"which": "4.0.0"
|
||||
"which": "5.0.0"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@types/jest": "29.5.12",
|
||||
"@types/node": "20.12.4",
|
||||
"@types/unzipper": "0.10.9",
|
||||
"@gradle/develocity-agent": "https://develocity-npm-pkgs.gradle.com/gradle-develocity-agent-0.9.0.tgz",
|
||||
"@types/jest": "29.5.14",
|
||||
"@types/node": "20.17.16",
|
||||
"@types/unzipper": "0.10.10",
|
||||
"@types/which": "3.0.4",
|
||||
"@typescript-eslint/parser": "7.5.0",
|
||||
"@vercel/ncc": "0.38.1",
|
||||
"eslint": "8.57.0",
|
||||
"eslint-plugin-github": "4.10.2",
|
||||
"eslint-plugin-jest": "27.9.0",
|
||||
"eslint-plugin-prettier": "5.1.3",
|
||||
"@typescript-eslint/parser": "7.18.0",
|
||||
"@vercel/ncc": "0.38.3",
|
||||
"eslint": "8.57.1",
|
||||
"eslint-plugin-github": "5.1.6",
|
||||
"eslint-plugin-jest": "28.11.0",
|
||||
"jest": "29.7.0",
|
||||
"js-yaml": "4.1.0",
|
||||
"nock": "13.5.4",
|
||||
"nock": "13.5.6",
|
||||
"npm-run-all": "4.1.5",
|
||||
"patch-package": "8.0.0",
|
||||
"prettier": "3.2.5",
|
||||
"ts-jest": "29.1.2",
|
||||
"typescript": "5.4.3"
|
||||
"prettier": "3.4.2",
|
||||
"ts-jest": "29.2.5",
|
||||
"typescript": "5.7.3"
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,113 +0,0 @@
|
||||
diff --git a/node_modules/@actions/cache/lib/cache.d.ts b/node_modules/@actions/cache/lib/cache.d.ts
|
||||
index 4658366..b796e58 100644
|
||||
--- a/node_modules/@actions/cache/lib/cache.d.ts
|
||||
+++ b/node_modules/@actions/cache/lib/cache.d.ts
|
||||
@@ -21,7 +21,7 @@ export declare function isFeatureAvailable(): boolean;
|
||||
* @param enableCrossOsArchive an optional boolean enabled to restore on windows any cache created on any platform
|
||||
* @returns string returns the key for the cache hit, otherwise returns undefined
|
||||
*/
|
||||
-export declare function restoreCache(paths: string[], primaryKey: string, restoreKeys?: string[], options?: DownloadOptions, enableCrossOsArchive?: boolean): Promise<string | undefined>;
|
||||
+export declare function restoreCache(paths: string[], primaryKey: string, restoreKeys?: string[], options?: DownloadOptions, enableCrossOsArchive?: boolean): Promise<CacheEntry | undefined>;
|
||||
/**
|
||||
* Saves a list of files with the specified key
|
||||
*
|
||||
@@ -31,4 +31,12 @@ export declare function restoreCache(paths: string[], primaryKey: string, restor
|
||||
* @param options cache upload options
|
||||
* @returns number returns cacheId if the cache was saved successfully and throws an error if save fails
|
||||
*/
|
||||
-export declare function saveCache(paths: string[], key: string, options?: UploadOptions, enableCrossOsArchive?: boolean): Promise<number>;
|
||||
+export declare function saveCache(paths: string[], key: string, options?: UploadOptions, enableCrossOsArchive?: boolean): Promise<CacheEntry>;
|
||||
+
|
||||
+// PATCHED: Add `CacheEntry` as return type for save/restore functions
|
||||
+// This allows us to track and report on cache entry sizes.
|
||||
+export declare class CacheEntry {
|
||||
+ key: string;
|
||||
+ size?: number;
|
||||
+ constructor(key: string, size?: number);
|
||||
+}
|
||||
diff --git a/node_modules/@actions/cache/lib/cache.js b/node_modules/@actions/cache/lib/cache.js
|
||||
index 9d636aa..a176bd7 100644
|
||||
--- a/node_modules/@actions/cache/lib/cache.js
|
||||
+++ b/node_modules/@actions/cache/lib/cache.js
|
||||
@@ -127,18 +127,21 @@ function restoreCache(paths, primaryKey, restoreKeys, options, enableCrossOsArch
|
||||
core.info(`Cache Size: ~${Math.round(archiveFileSize / (1024 * 1024))} MB (${archiveFileSize} B)`);
|
||||
yield (0, tar_1.extractTar)(archivePath, compressionMethod);
|
||||
core.info('Cache restored successfully');
|
||||
- return cacheEntry.cacheKey;
|
||||
- }
|
||||
- catch (error) {
|
||||
- const typedError = error;
|
||||
- if (typedError.name === ValidationError.name) {
|
||||
- throw error;
|
||||
- }
|
||||
- else {
|
||||
- // Supress all non-validation cache related errors because caching should be optional
|
||||
- core.warning(`Failed to restore: ${error.message}`);
|
||||
- }
|
||||
+
|
||||
+ // PATCHED - Return more inforamtion about restored entry
|
||||
+ return new CacheEntry(cacheEntry.cacheKey, archiveFileSize);;
|
||||
}
|
||||
+ // PATCHED - propagate errors
|
||||
+ // catch (error) {
|
||||
+ // const typedError = error;
|
||||
+ // if (typedError.name === ValidationError.name) {
|
||||
+ // throw error;
|
||||
+ // }
|
||||
+ // else {
|
||||
+ // // Supress all non-validation cache related errors because caching should be optional
|
||||
+ // core.warning(`Failed to restore: ${error.message}`);
|
||||
+ // }
|
||||
+ // }
|
||||
finally {
|
||||
// Try to delete the archive to save space
|
||||
try {
|
||||
@@ -206,19 +209,23 @@ function saveCache(paths, key, options, enableCrossOsArchive = false) {
|
||||
}
|
||||
core.debug(`Saving Cache (ID: ${cacheId})`);
|
||||
yield cacheHttpClient.saveCache(cacheId, archivePath, options);
|
||||
+
|
||||
+ // PATCHED - Return more inforamtion about saved entry
|
||||
+ return new CacheEntry(key, archiveFileSize);
|
||||
}
|
||||
- catch (error) {
|
||||
- const typedError = error;
|
||||
- if (typedError.name === ValidationError.name) {
|
||||
- throw error;
|
||||
- }
|
||||
- else if (typedError.name === ReserveCacheError.name) {
|
||||
- core.info(`Failed to save: ${typedError.message}`);
|
||||
- }
|
||||
- else {
|
||||
- core.warning(`Failed to save: ${typedError.message}`);
|
||||
- }
|
||||
- }
|
||||
+ // PATCHED - propagate errors
|
||||
+ // catch (error) {
|
||||
+ // const typedError = error;
|
||||
+ // if (typedError.name === ValidationError.name) {
|
||||
+ // throw error;
|
||||
+ // }
|
||||
+ // else if (typedError.name === ReserveCacheError.name) {
|
||||
+ // core.info(`Failed to save: ${typedError.message}`);
|
||||
+ // }
|
||||
+ // else {
|
||||
+ // core.warning(`Failed to save: ${typedError.message}`);
|
||||
+ // }
|
||||
+ // }
|
||||
finally {
|
||||
// Try to delete the archive to save space
|
||||
try {
|
||||
@@ -232,4 +239,11 @@ function saveCache(paths, key, options, enableCrossOsArchive = false) {
|
||||
});
|
||||
}
|
||||
exports.saveCache = saveCache;
|
||||
+class CacheEntry {
|
||||
+ constructor(key, size) {
|
||||
+ this.key = key;
|
||||
+ this.size = size;
|
||||
+ }
|
||||
+}
|
||||
+exports.CacheEntry = CacheEntry;
|
||||
//# sourceMappingURL=cache.js.map
|
||||
\ No newline at end of file
|
||||
183
sources/patches/@actions+cache+4.0.0.patch
Normal file
183
sources/patches/@actions+cache+4.0.0.patch
Normal file
@@ -0,0 +1,183 @@
|
||||
diff --git a/node_modules/@actions/cache/lib/cache.d.ts b/node_modules/@actions/cache/lib/cache.d.ts
|
||||
index ef0928b..4e2f570 100644
|
||||
--- a/node_modules/@actions/cache/lib/cache.d.ts
|
||||
+++ b/node_modules/@actions/cache/lib/cache.d.ts
|
||||
@@ -21,7 +21,7 @@ export declare function isFeatureAvailable(): boolean;
|
||||
* @param enableCrossOsArchive an optional boolean enabled to restore on windows any cache created on any platform
|
||||
* @returns string returns the key for the cache hit, otherwise returns undefined
|
||||
*/
|
||||
-export declare function restoreCache(paths: string[], primaryKey: string, restoreKeys?: string[], options?: DownloadOptions, enableCrossOsArchive?: boolean): Promise<string | undefined>;
|
||||
+export declare function restoreCache(paths: string[], primaryKey: string, restoreKeys?: string[], options?: DownloadOptions, enableCrossOsArchive?: boolean): Promise<CacheEntry | undefined>;
|
||||
/**
|
||||
* Saves a list of files with the specified key
|
||||
*
|
||||
@@ -31,4 +31,12 @@ export declare function restoreCache(paths: string[], primaryKey: string, restor
|
||||
* @param options cache upload options
|
||||
* @returns number returns cacheId if the cache was saved successfully and throws an error if save fails
|
||||
*/
|
||||
-export declare function saveCache(paths: string[], key: string, options?: UploadOptions, enableCrossOsArchive?: boolean): Promise<number>;
|
||||
+export declare function saveCache(paths: string[], key: string, options?: UploadOptions, enableCrossOsArchive?: boolean): Promise<CacheEntry>;
|
||||
+
|
||||
+// PATCHED: Add `CacheEntry` as return type for save/restore functions
|
||||
+// This allows us to track and report on cache entry sizes.
|
||||
+export declare class CacheEntry {
|
||||
+ key: string;
|
||||
+ size?: number;
|
||||
+ constructor(key: string, size?: number);
|
||||
+}
|
||||
\ No newline at end of file
|
||||
diff --git a/node_modules/@actions/cache/lib/cache.js b/node_modules/@actions/cache/lib/cache.js
|
||||
index 45201b6..2654e4b 100644
|
||||
--- a/node_modules/@actions/cache/lib/cache.js
|
||||
+++ b/node_modules/@actions/cache/lib/cache.js
|
||||
@@ -154,18 +154,21 @@ function restoreCacheV1(paths, primaryKey, restoreKeys, options, enableCrossOsAr
|
||||
core.info(`Cache Size: ~${Math.round(archiveFileSize / (1024 * 1024))} MB (${archiveFileSize} B)`);
|
||||
yield (0, tar_1.extractTar)(archivePath, compressionMethod);
|
||||
core.info('Cache restored successfully');
|
||||
- return cacheEntry.cacheKey;
|
||||
- }
|
||||
- catch (error) {
|
||||
- const typedError = error;
|
||||
- if (typedError.name === ValidationError.name) {
|
||||
- throw error;
|
||||
- }
|
||||
- else {
|
||||
- // Supress all non-validation cache related errors because caching should be optional
|
||||
- core.warning(`Failed to restore: ${error.message}`);
|
||||
- }
|
||||
+
|
||||
+ // PATCHED - Include size of restored entry
|
||||
+ return new CacheEntry(cacheEntry.cacheKey, archiveFileSize);;
|
||||
}
|
||||
+ // PATCHED - propagate errors
|
||||
+ // catch (error) {
|
||||
+ // const typedError = error;
|
||||
+ // if (typedError.name === ValidationError.name) {
|
||||
+ // throw error;
|
||||
+ // }
|
||||
+ // else {
|
||||
+ // // Supress all non-validation cache related errors because caching should be optional
|
||||
+ // core.warning(`Failed to restore: ${error.message}`);
|
||||
+ // }
|
||||
+ // }
|
||||
finally {
|
||||
// Try to delete the archive to save space
|
||||
try {
|
||||
@@ -232,18 +235,21 @@ function restoreCacheV2(paths, primaryKey, restoreKeys, options, enableCrossOsAr
|
||||
}
|
||||
yield (0, tar_1.extractTar)(archivePath, compressionMethod);
|
||||
core.info('Cache restored successfully');
|
||||
- return response.matchedKey;
|
||||
- }
|
||||
- catch (error) {
|
||||
- const typedError = error;
|
||||
- if (typedError.name === ValidationError.name) {
|
||||
- throw error;
|
||||
- }
|
||||
- else {
|
||||
- // Supress all non-validation cache related errors because caching should be optional
|
||||
- core.warning(`Failed to restore: ${error.message}`);
|
||||
- }
|
||||
+
|
||||
+ // PATCHED - Include size of restored entry
|
||||
+ return new CacheEntry(response.matchedKey, archiveFileSize);;
|
||||
}
|
||||
+ // PATCHED - propagate errors
|
||||
+ // catch (error) {
|
||||
+ // const typedError = error;
|
||||
+ // if (typedError.name === ValidationError.name) {
|
||||
+ // throw error;
|
||||
+ // }
|
||||
+ // else {
|
||||
+ // // Supress all non-validation cache related errors because caching should be optional
|
||||
+ // core.warning(`Failed to restore: ${error.message}`);
|
||||
+ // }
|
||||
+ // }
|
||||
finally {
|
||||
try {
|
||||
if (archivePath) {
|
||||
@@ -334,19 +340,23 @@ function saveCacheV1(paths, key, options, enableCrossOsArchive = false) {
|
||||
}
|
||||
core.debug(`Saving Cache (ID: ${cacheId})`);
|
||||
yield cacheHttpClient.saveCache(cacheId, archivePath, '', options);
|
||||
+
|
||||
+ // PATCHED - Include size of saved entry
|
||||
+ return new CacheEntry(key, archiveFileSize);
|
||||
}
|
||||
- catch (error) {
|
||||
- const typedError = error;
|
||||
- if (typedError.name === ValidationError.name) {
|
||||
- throw error;
|
||||
- }
|
||||
- else if (typedError.name === ReserveCacheError.name) {
|
||||
- core.info(`Failed to save: ${typedError.message}`);
|
||||
- }
|
||||
- else {
|
||||
- core.warning(`Failed to save: ${typedError.message}`);
|
||||
- }
|
||||
- }
|
||||
+ // PATCHED - propagate errors
|
||||
+ // catch (error) {
|
||||
+ // const typedError = error;
|
||||
+ // if (typedError.name === ValidationError.name) {
|
||||
+ // throw error;
|
||||
+ // }
|
||||
+ // else if (typedError.name === ReserveCacheError.name) {
|
||||
+ // core.info(`Failed to save: ${typedError.message}`);
|
||||
+ // }
|
||||
+ // else {
|
||||
+ // core.warning(`Failed to save: ${typedError.message}`);
|
||||
+ // }
|
||||
+ // }
|
||||
finally {
|
||||
// Try to delete the archive to save space
|
||||
try {
|
||||
@@ -422,19 +432,23 @@ function saveCacheV2(paths, key, options, enableCrossOsArchive = false) {
|
||||
throw new Error(`Unable to finalize cache with key ${key}, another job may be finalizing this cache.`);
|
||||
}
|
||||
cacheId = parseInt(finalizeResponse.entryId);
|
||||
+
|
||||
+ // PATCHED - Include size of saved entry
|
||||
+ return new CacheEntry(key, archiveFileSize);
|
||||
}
|
||||
- catch (error) {
|
||||
- const typedError = error;
|
||||
- if (typedError.name === ValidationError.name) {
|
||||
- throw error;
|
||||
- }
|
||||
- else if (typedError.name === ReserveCacheError.name) {
|
||||
- core.info(`Failed to save: ${typedError.message}`);
|
||||
- }
|
||||
- else {
|
||||
- core.warning(`Failed to save: ${typedError.message}`);
|
||||
- }
|
||||
- }
|
||||
+ // PATCHED - propagate errors
|
||||
+ // catch (error) {
|
||||
+ // const typedError = error;
|
||||
+ // if (typedError.name === ValidationError.name) {
|
||||
+ // throw error;
|
||||
+ // }
|
||||
+ // else if (typedError.name === ReserveCacheError.name) {
|
||||
+ // core.info(`Failed to save: ${typedError.message}`);
|
||||
+ // }
|
||||
+ // else {
|
||||
+ // core.warning(`Failed to save: ${typedError.message}`);
|
||||
+ // }
|
||||
+ // }
|
||||
finally {
|
||||
// Try to delete the archive to save space
|
||||
try {
|
||||
@@ -447,4 +461,11 @@ function saveCacheV2(paths, key, options, enableCrossOsArchive = false) {
|
||||
return cacheId;
|
||||
});
|
||||
}
|
||||
+// PATCHED - CacheEntry class
|
||||
+class CacheEntry {
|
||||
+ constructor(key, size) {
|
||||
+ this.key = key;
|
||||
+ this.size = size;
|
||||
+ }
|
||||
+}
|
||||
//# sourceMappingURL=cache.js.map
|
||||
\ No newline at end of file
|
||||
@@ -18,15 +18,23 @@ export async function run(): Promise<void> {
|
||||
|
||||
const result = await validate.findInvalidWrapperJars(
|
||||
path.resolve('.'),
|
||||
+core.getInput('min-wrapper-count'),
|
||||
core.getInput('allow-snapshots') === 'true',
|
||||
core.getInput('allow-checksums').split(',')
|
||||
)
|
||||
if (result.isValid()) {
|
||||
core.info(result.toDisplayString())
|
||||
|
||||
const minWrapperCount = +core.getInput('min-wrapper-count')
|
||||
if (result.valid.length < minWrapperCount) {
|
||||
const message =
|
||||
result.valid.length === 0
|
||||
? 'Wrapper validation failed: no Gradle Wrapper jars found. Did you forget to checkout the repository?'
|
||||
: `Wrapper validation failed: expected at least ${minWrapperCount} Gradle Wrapper jars, but found ${result.valid.length}.`
|
||||
core.setFailed(message)
|
||||
}
|
||||
} else {
|
||||
core.setFailed(
|
||||
`Gradle Wrapper Validation Failed!\n See https://github.com/gradle/actions/blob/main/docs/wrapper-validation.md#reporting-failures\n${result.toDisplayString()}`
|
||||
`At least one Gradle Wrapper Jar failed validation!\n See https://github.com/gradle/actions/blob/main/docs/wrapper-validation.md#validation-failures\n${result.toDisplayString()}`
|
||||
)
|
||||
if (result.invalid.length > 0) {
|
||||
core.setOutput('failed-wrapper', `${result.invalid.map(w => w.path).join('|')}`)
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
import * as fs from 'fs'
|
||||
import * as path from 'path'
|
||||
import {versionIsAtLeast} from './execution/gradle'
|
||||
|
||||
export interface BuildResult {
|
||||
get rootProjectName(): string
|
||||
@@ -32,6 +33,18 @@ export class BuildResults {
|
||||
const allHomes = this.results.map(buildResult => buildResult.gradleHomeDir)
|
||||
return Array.from(new Set(allHomes))
|
||||
}
|
||||
|
||||
highestGradleVersion(): string | null {
|
||||
if (this.results.length === 0) {
|
||||
return null
|
||||
}
|
||||
return this.results
|
||||
.map(result => result.gradleVersion)
|
||||
.reduce((maxVersion: string, currentVersion: string) => {
|
||||
if (!maxVersion) return currentVersion
|
||||
return versionIsAtLeast(currentVersion, maxVersion) ? currentVersion : maxVersion
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
export function loadBuildResults(): BuildResults {
|
||||
|
||||
@@ -4,6 +4,9 @@ import * as exec from '@actions/exec'
|
||||
import fs from 'fs'
|
||||
import path from 'path'
|
||||
import * as provisioner from '../execution/provision'
|
||||
import {BuildResult, BuildResults} from '../build-results'
|
||||
import {versionIsAtLeast} from '../execution/gradle'
|
||||
import {gradleWrapperScript} from '../execution/gradlew'
|
||||
|
||||
export class CacheCleaner {
|
||||
private readonly gradleUserHome: string
|
||||
@@ -21,13 +24,51 @@ export class CacheCleaner {
|
||||
return timestamp
|
||||
}
|
||||
|
||||
async forceCleanup(): Promise<void> {
|
||||
async forceCleanup(buildResults: BuildResults): Promise<void> {
|
||||
const executable = await this.gradleExecutableForCleanup(buildResults)
|
||||
const cleanTimestamp = core.getState('clean-timestamp')
|
||||
await this.forceCleanupFilesOlderThan(cleanTimestamp)
|
||||
await this.forceCleanupFilesOlderThan(cleanTimestamp, executable)
|
||||
}
|
||||
|
||||
/**
|
||||
* Attempt to use the newest Gradle version that was used to run a build, at least 8.11.
|
||||
*
|
||||
* This will avoid the need to provision a Gradle version for the cleanup when not necessary.
|
||||
*/
|
||||
private async gradleExecutableForCleanup(buildResults: BuildResults): Promise<string> {
|
||||
const preferredVersion = buildResults.highestGradleVersion()
|
||||
if (preferredVersion && versionIsAtLeast(preferredVersion, '8.11')) {
|
||||
try {
|
||||
const wrapperScripts = buildResults.results
|
||||
.map(result => this.findGradleWrapperScript(result))
|
||||
.filter(Boolean) as string[]
|
||||
|
||||
return await provisioner.provisionGradleWithVersionAtLeast(preferredVersion, wrapperScripts)
|
||||
} catch (e) {
|
||||
// Ignore the case where the preferred version cannot be located in https://services.gradle.org/versions/all.
|
||||
// This can happen for snapshot Gradle versions.
|
||||
core.info(
|
||||
`Failed to provision Gradle ${preferredVersion} for cache cleanup. Falling back to default version.`
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
// Fallback to the minimum version required for cache-cleanup
|
||||
return await provisioner.provisionGradleWithVersionAtLeast('8.11')
|
||||
}
|
||||
|
||||
private findGradleWrapperScript(result: BuildResult): string | null {
|
||||
try {
|
||||
const wrapperScript = gradleWrapperScript(result.rootProjectDir)
|
||||
return path.resolve(result.rootProjectDir, wrapperScript)
|
||||
} catch (error) {
|
||||
core.debug(`No Gradle Wrapper found for ${result.rootProjectName}: ${error}`)
|
||||
return null
|
||||
}
|
||||
}
|
||||
|
||||
// Visible for testing
|
||||
async forceCleanupFilesOlderThan(cleanTimestamp: string): Promise<void> {
|
||||
async forceCleanupFilesOlderThan(cleanTimestamp: string, executable: string): Promise<void> {
|
||||
// Run a dummy Gradle build to trigger cache cleanup
|
||||
const cleanupProjectDir = path.resolve(this.tmpDir, 'dummy-cleanup-project')
|
||||
fs.mkdirSync(cleanupProjectDir, {recursive: true})
|
||||
@@ -44,22 +85,20 @@ export class CacheCleaner {
|
||||
settings.caches {
|
||||
cleanup = Cleanup.ALWAYS
|
||||
|
||||
releasedWrappers.removeUnusedEntriesOlderThan.set(cleanupTime)
|
||||
snapshotWrappers.removeUnusedEntriesOlderThan.set(cleanupTime)
|
||||
downloadedResources.removeUnusedEntriesOlderThan.set(cleanupTime)
|
||||
createdResources.removeUnusedEntriesOlderThan.set(cleanupTime)
|
||||
buildCache.removeUnusedEntriesOlderThan.set(cleanupTime)
|
||||
releasedWrappers.setRemoveUnusedEntriesOlderThan(cleanupTime)
|
||||
snapshotWrappers.setRemoveUnusedEntriesOlderThan(cleanupTime)
|
||||
downloadedResources.setRemoveUnusedEntriesOlderThan(cleanupTime)
|
||||
createdResources.setRemoveUnusedEntriesOlderThan(cleanupTime)
|
||||
buildCache.setRemoveUnusedEntriesOlderThan(cleanupTime)
|
||||
}
|
||||
}
|
||||
`
|
||||
)
|
||||
fs.writeFileSync(path.resolve(cleanupProjectDir, 'build.gradle'), 'task("noop") {}')
|
||||
|
||||
const executable = await provisioner.provisionGradle('current')
|
||||
|
||||
await core.group('Executing Gradle to clean up caches', async () => {
|
||||
core.info(`Cleaning up caches last used before ${cleanTimestamp}`)
|
||||
await this.executeCleanupBuild(executable!, cleanupProjectDir)
|
||||
await this.executeCleanupBuild(executable, cleanupProjectDir)
|
||||
})
|
||||
}
|
||||
|
||||
@@ -74,14 +113,12 @@ export class CacheCleaner {
|
||||
'--no-scan',
|
||||
'--build-cache',
|
||||
'-DGITHUB_DEPENDENCY_GRAPH_ENABLED=false',
|
||||
'-DGRADLE_ACTIONS_SKIP_BUILD_RESULT_CAPTURE=true',
|
||||
'noop'
|
||||
]
|
||||
|
||||
const result = await exec.getExecOutput(executable, args, {
|
||||
cwd: cleanupProjectDir,
|
||||
silent: true
|
||||
await exec.exec(executable, args, {
|
||||
cwd: cleanupProjectDir
|
||||
})
|
||||
|
||||
core.info(result.stdout)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -4,7 +4,7 @@ export const DEFAULT_CACHE_ENABLED_REASON = `[Cache was enabled](https://github.
|
||||
|
||||
export const DEFAULT_READONLY_REASON = `[Cache was read-only](https://github.com/gradle/actions/blob/main/docs/setup-gradle.md#using-the-cache-read-only). By default, the action will only write to the cache for Jobs running on the default branch.`
|
||||
|
||||
export const DEFAULT_DISABLED_REASON = `[Cache was disabled](https://github.com/gradle/actions/blob/main/docs/setup-gradle.md#disabling-caching) via action confiugration. Gradle User Home was not restored from or saved to the cache.`
|
||||
export const DEFAULT_DISABLED_REASON = `[Cache was disabled](https://github.com/gradle/actions/blob/main/docs/setup-gradle.md#disabling-caching) via action configuration. Gradle User Home was not restored from or saved to the cache.`
|
||||
|
||||
export const DEFAULT_WRITEONLY_REASON = `[Cache was set to write-only](https://github.com/gradle/actions/blob/main/docs/setup-gradle.md#using-the-cache-write-only) via action configuration. Gradle User Home was not restored from cache.`
|
||||
|
||||
@@ -110,10 +110,12 @@ export class CacheEntryListener {
|
||||
requestedRestoreKeys: string[] | undefined
|
||||
restoredKey: string | undefined
|
||||
restoredSize: number | undefined
|
||||
restoredTime: number | undefined
|
||||
notRestored: string | undefined
|
||||
|
||||
savedKey: string | undefined
|
||||
savedSize: number | undefined
|
||||
savedTime: number | undefined
|
||||
notSaved: string | undefined
|
||||
|
||||
constructor(entryName: string) {
|
||||
@@ -130,9 +132,10 @@ export class CacheEntryListener {
|
||||
return this
|
||||
}
|
||||
|
||||
markRestored(key: string, size: number | undefined): CacheEntryListener {
|
||||
markRestored(key: string, size: number | undefined, time: number): CacheEntryListener {
|
||||
this.restoredKey = key
|
||||
this.restoredSize = size
|
||||
this.restoredTime = time
|
||||
return this
|
||||
}
|
||||
|
||||
@@ -141,9 +144,10 @@ export class CacheEntryListener {
|
||||
return this
|
||||
}
|
||||
|
||||
markSaved(key: string, size: number | undefined): CacheEntryListener {
|
||||
markSaved(key: string, size: number | undefined, time: number): CacheEntryListener {
|
||||
this.savedKey = key
|
||||
this.savedSize = size
|
||||
this.savedTime = time
|
||||
return this
|
||||
}
|
||||
|
||||
@@ -182,14 +186,16 @@ ${renderEntryTable(entries)}
|
||||
function renderEntryTable(entries: CacheEntryListener[]): string {
|
||||
return `
|
||||
<table>
|
||||
<tr><td></td><th>Count</th><th>Total Size (Mb)</th></tr>
|
||||
<tr><td></td><th>Count</th><th>Total Size (Mb)</th><th>Total Time (ms)</tr>
|
||||
<tr><td>Entries Restored</td>
|
||||
<td>${getCount(entries, e => e.restoredSize)}</td>
|
||||
<td>${getSize(entries, e => e.restoredSize)}</td>
|
||||
<td>${getTime(entries, e => e.restoredTime)}</td>
|
||||
</tr>
|
||||
<tr><td>Entries Saved</td>
|
||||
<td>${getCount(entries, e => e.savedSize)}</td>
|
||||
<td>${getSize(entries, e => e.savedSize)}</td>
|
||||
<td>${getTime(entries, e => e.savedTime)}</td>
|
||||
</tr>
|
||||
</table>
|
||||
`
|
||||
@@ -202,9 +208,11 @@ function renderEntryDetails(listener: CacheListener): string {
|
||||
Requested Key : ${entry.requestedKey ?? ''}
|
||||
Restored Key : ${entry.restoredKey ?? ''}
|
||||
Size: ${formatSize(entry.restoredSize)}
|
||||
Time: ${formatTime(entry.restoredTime)}
|
||||
${getRestoredMessage(entry, listener.cacheWriteOnly)}
|
||||
Saved Key : ${entry.savedKey ?? ''}
|
||||
Size: ${formatSize(entry.savedSize)}
|
||||
Time: ${formatTime(entry.savedTime)}
|
||||
${getSavedMessage(entry, listener.cacheReadOnly)}
|
||||
`
|
||||
)
|
||||
@@ -264,9 +272,23 @@ function getSize(
|
||||
return Math.round(bytes / (1024 * 1024))
|
||||
}
|
||||
|
||||
function getTime(
|
||||
cacheEntries: CacheEntryListener[],
|
||||
predicate: (value: CacheEntryListener) => number | undefined
|
||||
): number {
|
||||
return cacheEntries.map(e => predicate(e) ?? 0).reduce((p, v) => p + v, 0)
|
||||
}
|
||||
|
||||
function formatSize(bytes: number | undefined): string {
|
||||
if (bytes === undefined || bytes === 0) {
|
||||
return ''
|
||||
}
|
||||
return `${Math.round(bytes / (1024 * 1024))} MB (${bytes} B)`
|
||||
}
|
||||
|
||||
function formatTime(ms: number | undefined): string {
|
||||
if (ms === undefined || ms === 0) {
|
||||
return ''
|
||||
}
|
||||
return `${ms} ms`
|
||||
}
|
||||
|
||||
@@ -38,13 +38,16 @@ export async function restoreCache(
|
||||
): Promise<cache.CacheEntry | undefined> {
|
||||
listener.markRequested(cacheKey, cacheRestoreKeys)
|
||||
try {
|
||||
const startTime = Date.now()
|
||||
// Only override the read timeout if the SEGMENT_DOWNLOAD_TIMEOUT_MINS env var has NOT been set
|
||||
const cacheRestoreOptions = process.env[SEGMENT_DOWNLOAD_TIMEOUT_VAR]
|
||||
? {}
|
||||
: {segmentTimeoutInMs: SEGMENT_DOWNLOAD_TIMEOUT_DEFAULT}
|
||||
const restoredEntry = await cache.restoreCache(cachePath, cacheKey, cacheRestoreKeys, cacheRestoreOptions)
|
||||
if (restoredEntry !== undefined) {
|
||||
listener.markRestored(restoredEntry.key, restoredEntry.size)
|
||||
const restoreTime = Date.now() - startTime
|
||||
listener.markRestored(restoredEntry.key, restoredEntry.size, restoreTime)
|
||||
core.info(`Restored cache entry with key ${cacheKey} to ${cachePath.join()} in ${restoreTime}ms`)
|
||||
}
|
||||
return restoredEntry
|
||||
} catch (error) {
|
||||
@@ -56,8 +59,11 @@ export async function restoreCache(
|
||||
|
||||
export async function saveCache(cachePath: string[], cacheKey: string, listener: CacheEntryListener): Promise<void> {
|
||||
try {
|
||||
const startTime = Date.now()
|
||||
const savedEntry = await cache.saveCache(cachePath, cacheKey)
|
||||
listener.markSaved(savedEntry.key, savedEntry.size)
|
||||
const saveTime = Date.now() - startTime
|
||||
listener.markSaved(savedEntry.key, savedEntry.size, saveTime)
|
||||
core.info(`Saved cache entry with key ${cacheKey} from ${cachePath.join()} in ${saveTime}ms`)
|
||||
} catch (error) {
|
||||
if (error instanceof cache.ReserveCacheError) {
|
||||
listener.markAlreadyExists(cacheKey)
|
||||
|
||||
@@ -102,7 +102,7 @@ export async function save(
|
||||
cacheListener.setCacheCleanupDisabled(CLEANUP_DISABLED_DUE_TO_CONFIG_CACHE_HIT)
|
||||
} else if (cacheConfig.shouldPerformCacheCleanup(buildResults.anyFailed())) {
|
||||
cacheListener.setCacheCleanupEnabled()
|
||||
await performCacheCleanup(gradleUserHome)
|
||||
await performCacheCleanup(gradleUserHome, buildResults)
|
||||
} else {
|
||||
core.info('Not performing cache-cleanup due to build failure')
|
||||
cacheListener.setCacheCleanupDisabled(CLEANUP_DISABLED_DUE_TO_FAILURE)
|
||||
@@ -114,10 +114,10 @@ export async function save(
|
||||
})
|
||||
}
|
||||
|
||||
async function performCacheCleanup(gradleUserHome: string): Promise<void> {
|
||||
async function performCacheCleanup(gradleUserHome: string, buildResults: BuildResults): Promise<void> {
|
||||
const cacheCleaner = new CacheCleaner(gradleUserHome, process.env['RUNNER_TEMP']!)
|
||||
try {
|
||||
await cacheCleaner.forceCleanup()
|
||||
await cacheCleaner.forceCleanup(buildResults)
|
||||
} catch (e) {
|
||||
core.warning(`Cache cleanup failed. Will continue. ${String(e)}`)
|
||||
}
|
||||
|
||||
@@ -2,7 +2,6 @@ import path from 'path'
|
||||
import fs from 'fs'
|
||||
import * as core from '@actions/core'
|
||||
import * as glob from '@actions/glob'
|
||||
import * as semver from 'semver'
|
||||
|
||||
import {CacheEntryListener, CacheListener} from './cache-reporting'
|
||||
import {cacheDebug, hashFileNames, isCacheDebuggingEnabled, restoreCache, saveCache, tryDelete} from './cache-utils'
|
||||
@@ -10,6 +9,7 @@ import {cacheDebug, hashFileNames, isCacheDebuggingEnabled, restoreCache, saveCa
|
||||
import {BuildResult, loadBuildResults} from '../build-results'
|
||||
import {CacheConfig, ACTION_METADATA_DIR} from '../configuration'
|
||||
import {getCacheKeyBase} from './cache-key'
|
||||
import {versionIsAtLeast} from '../execution/gradle'
|
||||
|
||||
const SKIP_RESTORE_VAR = 'GRADLE_BUILD_ACTION_SKIP_RESTORE'
|
||||
const CACHE_PROTOCOL_VERSION = 'v1'
|
||||
@@ -132,9 +132,8 @@ abstract class AbstractEntryExtractor {
|
||||
pattern: string,
|
||||
listener: CacheEntryListener
|
||||
): Promise<ExtractedCacheEntry> {
|
||||
const restoredEntry = await restoreCache([pattern], cacheKey, [], listener)
|
||||
const restoredEntry = await restoreCache(pattern.split('\n'), cacheKey, [], listener)
|
||||
if (restoredEntry) {
|
||||
core.info(`Restored ${artifactType} with key ${cacheKey} to ${pattern}`)
|
||||
return new ExtractedCacheEntry(artifactType, pattern, cacheKey)
|
||||
} else {
|
||||
core.info(`Did not restore ${artifactType} with key ${cacheKey} to ${pattern}`)
|
||||
@@ -232,8 +231,7 @@ abstract class AbstractEntryExtractor {
|
||||
cacheDebug(`No change to previously restored ${artifactType}. Not saving.`)
|
||||
entryListener.markNotSaved('contents unchanged')
|
||||
} else {
|
||||
core.info(`Caching ${artifactType} with path '${pattern}' and cache key: ${cacheKey}`)
|
||||
await saveCache([pattern], cacheKey, entryListener)
|
||||
await saveCache(pattern.split('\n'), cacheKey, entryListener)
|
||||
}
|
||||
|
||||
for (const file of matchingFiles) {
|
||||
@@ -434,8 +432,7 @@ export class ConfigurationCacheEntryExtractor extends AbstractEntryExtractor {
|
||||
// If any associated build result used Gradle < 8.6, then mark it as not cacheable
|
||||
if (
|
||||
pathResults.find(result => {
|
||||
const gradleVersion = semver.coerce(result.gradleVersion)
|
||||
return gradleVersion && semver.lt(gradleVersion, '8.6.0')
|
||||
return !versionIsAtLeast(result.gradleVersion, '8.6.0')
|
||||
})
|
||||
) {
|
||||
core.info(
|
||||
|
||||
@@ -60,7 +60,8 @@ export class GradleUserHomeCache {
|
||||
restoreKeys:[${cacheKey.restoreKeys}]`
|
||||
)
|
||||
|
||||
const cacheResult = await restoreCache(this.getCachePath(), cacheKey.key, cacheKey.restoreKeys, entryListener)
|
||||
const cachePath = this.getCachePath()
|
||||
const cacheResult = await restoreCache(cachePath, cacheKey.key, cacheKey.restoreKeys, entryListener)
|
||||
if (!cacheResult) {
|
||||
core.info(`${this.cacheDescription} cache not found. Will initialize empty.`)
|
||||
return
|
||||
@@ -68,8 +69,6 @@ export class GradleUserHomeCache {
|
||||
|
||||
core.saveState(RESTORED_CACHE_KEY_KEY, cacheResult.key)
|
||||
|
||||
core.info(`Restored ${this.cacheDescription} from cache key: ${cacheResult.key}`)
|
||||
|
||||
try {
|
||||
await this.afterRestore(listener)
|
||||
} catch (error) {
|
||||
@@ -120,10 +119,8 @@ export class GradleUserHomeCache {
|
||||
return
|
||||
}
|
||||
|
||||
core.info(`Caching ${this.cacheDescription} with cache key: ${cacheKey}`)
|
||||
const cachePath = this.getCachePath()
|
||||
await saveCache(cachePath, cacheKey, gradleHomeEntryListener)
|
||||
|
||||
return
|
||||
}
|
||||
|
||||
|
||||
@@ -13,34 +13,37 @@ export function readResourceFileAsString(...paths: string[]): string {
|
||||
* @VisibleForTesting
|
||||
*/
|
||||
export function getPredefinedToolchains(): string | null {
|
||||
const javaHomeEnvs: string[] = []
|
||||
for (const javaHomeEnvsKey in process.env) {
|
||||
if (javaHomeEnvsKey.startsWith('JAVA_HOME_')) {
|
||||
javaHomeEnvs.push(javaHomeEnvsKey)
|
||||
}
|
||||
}
|
||||
// Get the version and path for each JAVA_HOME env var
|
||||
const javaHomeEnvs = Object.entries(process.env)
|
||||
.filter(([key]) => key.startsWith('JAVA_HOME_') && process.env[key])
|
||||
.map(([key, value]) => ({
|
||||
jdkVersion: key.match(/JAVA_HOME_(\d+)_/)?.[1] ?? null,
|
||||
jdkPath: value as string
|
||||
}))
|
||||
.filter(env => env.jdkVersion !== null)
|
||||
|
||||
if (javaHomeEnvs.length === 0) {
|
||||
return null
|
||||
}
|
||||
|
||||
// language=XML
|
||||
let toolchainsXml = `<?xml version="1.0" encoding="UTF-8"?>
|
||||
return `<?xml version="1.0" encoding="UTF-8"?>
|
||||
<toolchains>
|
||||
<!-- JDK Toolchains installed by default on GitHub-hosted runners -->
|
||||
`
|
||||
for (const javaHomeEnv of javaHomeEnvs) {
|
||||
const version = javaHomeEnv.match(/JAVA_HOME_(\d+)_/)?.[1]!
|
||||
toolchainsXml += ` <toolchain>
|
||||
${javaHomeEnvs
|
||||
.map(
|
||||
({jdkVersion, jdkPath}) => ` <toolchain>
|
||||
<type>jdk</type>
|
||||
<provides>
|
||||
<version>${version}</version>
|
||||
<version>${jdkVersion}</version>
|
||||
</provides>
|
||||
<configuration>
|
||||
<jdkHome>\${env.${javaHomeEnv}}</jdkHome>
|
||||
<jdkHome>${jdkPath}</jdkHome>
|
||||
</configuration>
|
||||
</toolchain>\n`
|
||||
}
|
||||
toolchainsXml += `</toolchains>\n`
|
||||
return toolchainsXml
|
||||
</toolchain>`
|
||||
)
|
||||
.join('\n')}
|
||||
</toolchains>\n`
|
||||
}
|
||||
|
||||
export function mergeToolchainContent(existingToolchainContent: string, preInstalledToolchains: string): string {
|
||||
|
||||
@@ -20,13 +20,15 @@ export class DependencyGraphConfig {
|
||||
return DependencyGraphOption.Generate
|
||||
case 'generate-and-submit':
|
||||
return DependencyGraphOption.GenerateAndSubmit
|
||||
case 'generate-submit-and-upload':
|
||||
return DependencyGraphOption.GenerateSubmitAndUpload
|
||||
case 'generate-and-upload':
|
||||
return DependencyGraphOption.GenerateAndUpload
|
||||
case 'download-and-submit':
|
||||
return DependencyGraphOption.DownloadAndSubmit
|
||||
}
|
||||
throw TypeError(
|
||||
`The value '${val}' is not valid for 'dependency-graph'. Valid values are: [disabled, generate, generate-and-submit, generate-and-upload, download-and-submit]. The default value is 'disabled'.`
|
||||
`The value '${val}' is not valid for 'dependency-graph'. Valid values are: [disabled, generate, generate-and-submit, generate-submit-and-upload, generate-and-upload, download-and-submit].`
|
||||
)
|
||||
}
|
||||
|
||||
@@ -96,6 +98,7 @@ export enum DependencyGraphOption {
|
||||
Disabled = 'disabled',
|
||||
Generate = 'generate',
|
||||
GenerateAndSubmit = 'generate-and-submit',
|
||||
GenerateSubmitAndUpload = 'generate-submit-and-upload',
|
||||
GenerateAndUpload = 'generate-and-upload',
|
||||
DownloadAndSubmit = 'download-and-submit'
|
||||
}
|
||||
|
||||
@@ -60,7 +60,10 @@ export async function complete(config: DependencyGraphConfig): Promise<void> {
|
||||
case DependencyGraphOption.DownloadAndSubmit: // Performed in setup
|
||||
return
|
||||
case DependencyGraphOption.GenerateAndSubmit:
|
||||
await findAndSubmitDependencyGraphs(config)
|
||||
await findAndSubmitDependencyGraphs(config, false)
|
||||
return
|
||||
case DependencyGraphOption.GenerateSubmitAndUpload:
|
||||
await findAndSubmitDependencyGraphs(config, true)
|
||||
return
|
||||
case DependencyGraphOption.GenerateAndUpload:
|
||||
await findAndUploadDependencyGraphs(config)
|
||||
@@ -83,7 +86,7 @@ async function downloadAndSubmitDependencyGraphs(config: DependencyGraphConfig):
|
||||
}
|
||||
}
|
||||
|
||||
async function findAndSubmitDependencyGraphs(config: DependencyGraphConfig): Promise<void> {
|
||||
async function findAndSubmitDependencyGraphs(config: DependencyGraphConfig, uploadAfterSubmit: boolean): Promise<void> {
|
||||
if (isRunningInActEnvironment()) {
|
||||
core.info('Dependency graph not supported in the ACT environment.')
|
||||
return
|
||||
@@ -100,6 +103,10 @@ async function findAndSubmitDependencyGraphs(config: DependencyGraphConfig): Pro
|
||||
}
|
||||
throw e
|
||||
}
|
||||
|
||||
if (uploadAfterSubmit) {
|
||||
await uploadDependencyGraphs(dependencyGraphFiles, config)
|
||||
}
|
||||
}
|
||||
|
||||
async function findAndUploadDependencyGraphs(config: DependencyGraphConfig): Promise<void> {
|
||||
|
||||
@@ -5,13 +5,6 @@ import {setupToken} from './short-lived-token'
|
||||
export async function setup(config: BuildScanConfig): Promise<void> {
|
||||
maybeExportVariable('DEVELOCITY_INJECTION_INIT_SCRIPT_NAME', 'gradle-actions.inject-develocity.init.gradle')
|
||||
maybeExportVariable('DEVELOCITY_AUTO_INJECTION_CUSTOM_VALUE', 'gradle-actions')
|
||||
if (config.getBuildScanPublishEnabled()) {
|
||||
maybeExportVariable('DEVELOCITY_INJECTION_ENABLED', 'true')
|
||||
maybeExportVariable('DEVELOCITY_PLUGIN_VERSION', '3.17.6')
|
||||
maybeExportVariable('DEVELOCITY_CCUD_PLUGIN_VERSION', '2.0')
|
||||
maybeExportVariable('DEVELOCITY_TERMS_OF_USE_URL', config.getBuildScanTermsOfUseUrl())
|
||||
maybeExportVariable('DEVELOCITY_TERMS_OF_USE_AGREE', config.getBuildScanTermsOfUseAgree())
|
||||
}
|
||||
|
||||
maybeExportVariableNotEmpty('DEVELOCITY_INJECTION_ENABLED', config.getDevelocityInjectionEnabled())
|
||||
maybeExportVariableNotEmpty('DEVELOCITY_URL', config.getDevelocityUrl())
|
||||
@@ -19,10 +12,22 @@ export async function setup(config: BuildScanConfig): Promise<void> {
|
||||
maybeExportVariableNotEmpty('DEVELOCITY_CAPTURE_FILE_FINGERPRINTS', config.getDevelocityCaptureFileFingerprints())
|
||||
maybeExportVariableNotEmpty('DEVELOCITY_ENFORCE_URL', config.getDevelocityEnforceUrl())
|
||||
maybeExportVariableNotEmpty('DEVELOCITY_PLUGIN_VERSION', config.getDevelocityPluginVersion())
|
||||
maybeExportVariableNotEmpty('DEVELOCITY_CCUD_PLUGIN_VERSION', config.getDevelocityCcudPluginVersion())
|
||||
maybeExportVariableNotEmpty('GRADLE_PLUGIN_REPOSITORY_URL', config.getGradlePluginRepositoryUrl())
|
||||
maybeExportVariableNotEmpty('GRADLE_PLUGIN_REPOSITORY_USERNAME', config.getGradlePluginRepositoryUsername())
|
||||
maybeExportVariableNotEmpty('GRADLE_PLUGIN_REPOSITORY_PASSWORD', config.getGradlePluginRepositoryPassword())
|
||||
|
||||
// If build-scan-publish is enabled, ensure the environment variables are set
|
||||
// The DEVELOCITY_PLUGIN_VERSION and DEVELOCITY_CCUD_PLUGIN_VERSION are set to the latest versions
|
||||
// except if they are defined in the configuration
|
||||
if (config.getBuildScanPublishEnabled()) {
|
||||
maybeExportVariable('DEVELOCITY_INJECTION_ENABLED', 'true')
|
||||
maybeExportVariable('DEVELOCITY_PLUGIN_VERSION', '3.19.1')
|
||||
maybeExportVariable('DEVELOCITY_CCUD_PLUGIN_VERSION', '2.1')
|
||||
maybeExportVariable('DEVELOCITY_TERMS_OF_USE_URL', config.getBuildScanTermsOfUseUrl())
|
||||
maybeExportVariable('DEVELOCITY_TERMS_OF_USE_AGREE', config.getBuildScanTermsOfUseAgree())
|
||||
}
|
||||
|
||||
return setupToken(config.getDevelocityAccessKey(), config.getDevelocityTokenExpiry())
|
||||
}
|
||||
|
||||
|
||||
@@ -72,7 +72,7 @@ class ShortLivedTokenClient {
|
||||
retryInterval = 1000
|
||||
|
||||
async fetchToken(serverUrl: string, accessKey: HostnameAccessKey, expiry: string): Promise<HostnameAccessKey> {
|
||||
const queryParams = expiry ? `?expiresInHours${expiry}` : ''
|
||||
const queryParams = expiry ? `?expiresInHours=${expiry}` : ''
|
||||
const sanitizedServerUrl = !serverUrl.endsWith('/') ? `${serverUrl}/` : serverUrl
|
||||
const headers = {
|
||||
'Content-Type': 'application/json',
|
||||
|
||||
@@ -1,6 +1,8 @@
|
||||
import * as core from '@actions/core'
|
||||
import * as exec from '@actions/exec'
|
||||
|
||||
import which from 'which'
|
||||
import * as semver from 'semver'
|
||||
import * as provisioner from './provision'
|
||||
import * as gradlew from './gradlew'
|
||||
|
||||
@@ -31,3 +33,79 @@ async function executeGradleBuild(executable: string | undefined, root: string,
|
||||
core.setFailed(`Gradle build failed: see console output for details`)
|
||||
}
|
||||
}
|
||||
|
||||
export function versionIsAtLeast(actualVersion: string, requiredVersion: string): boolean {
|
||||
if (actualVersion === requiredVersion) {
|
||||
return true
|
||||
}
|
||||
|
||||
const actual = new GradleVersion(actualVersion)
|
||||
const required = new GradleVersion(requiredVersion)
|
||||
|
||||
const actualSemver = semver.coerce(actual.versionPart)!
|
||||
const comparisonSemver = semver.coerce(required.versionPart)!
|
||||
|
||||
if (semver.gt(actualSemver, comparisonSemver)) {
|
||||
return true // Actual version is greater than comparison. So it's at least as new.
|
||||
}
|
||||
if (semver.lt(actualSemver, comparisonSemver)) {
|
||||
return false // Actual version is less than comparison. So it's not as new.
|
||||
}
|
||||
|
||||
// Actual and required version numbers are equal, so compare the other parts
|
||||
|
||||
if (actual.snapshotPart || required.snapshotPart) {
|
||||
if (actual.snapshotPart && !required.snapshotPart && !required.stagePart) {
|
||||
return false // Actual has a snapshot, but required is a plain version. Required is newer.
|
||||
}
|
||||
if (required.snapshotPart && !actual.snapshotPart && !actual.stagePart) {
|
||||
return true // Required has a snapshot, but actual is a plain version. Actual is newer.
|
||||
}
|
||||
|
||||
return false // Cannot compare case where both versions have a snapshot or stage
|
||||
}
|
||||
|
||||
if (actual.stagePart) {
|
||||
if (required.stagePart) {
|
||||
return actual.stagePart >= required.stagePart // Compare stages for newer
|
||||
}
|
||||
|
||||
return false // Actual has a stage, but required does not. So required is always newer.
|
||||
}
|
||||
|
||||
return true // Actual has no stage part or snapshot part, so it cannot be older than required.
|
||||
}
|
||||
|
||||
export async function findGradleExecutableOnPath(): Promise<string | null> {
|
||||
return await which('gradle', {nothrow: true})
|
||||
}
|
||||
|
||||
export async function determineGradleVersion(gradleExecutable: string): Promise<string | undefined> {
|
||||
const output = await exec.getExecOutput(gradleExecutable, ['-v'], {silent: true})
|
||||
return parseGradleVersionFromOutput(output.stdout)
|
||||
}
|
||||
|
||||
export function parseGradleVersionFromOutput(output: string): string | undefined {
|
||||
const regex = /Gradle (\d+\.\d+(\.\d+)?(-.*)?)/
|
||||
const versionString = output.match(regex)?.[1]
|
||||
return versionString
|
||||
}
|
||||
|
||||
class GradleVersion {
|
||||
static PATTERN = /((\d+)(\.\d+)+)(-([a-z]+)-(\w+))?(-(SNAPSHOT|\d{14}([-+]\d{4})?))?/
|
||||
|
||||
versionPart: string
|
||||
stagePart: string
|
||||
snapshotPart: string
|
||||
|
||||
constructor(readonly version: string) {
|
||||
const matcher = GradleVersion.PATTERN.exec(version)
|
||||
if (!matcher) {
|
||||
throw new Error(`'${version}' is not a valid Gradle version string (examples: '1.0', '1.0-rc-1')`)
|
||||
}
|
||||
|
||||
this.versionPart = matcher[1]
|
||||
this.stagePart = matcher[4]
|
||||
this.snapshotPart = matcher[7]
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,13 +1,12 @@
|
||||
import * as fs from 'fs'
|
||||
import * as os from 'os'
|
||||
import * as path from 'path'
|
||||
import which from 'which'
|
||||
import * as httpm from '@actions/http-client'
|
||||
import * as core from '@actions/core'
|
||||
import * as cache from '@actions/cache'
|
||||
import * as exec from '@actions/exec'
|
||||
import * as toolCache from '@actions/tool-cache'
|
||||
|
||||
import {determineGradleVersion, findGradleExecutableOnPath, versionIsAtLeast} from './gradle'
|
||||
import * as gradlew from './gradlew'
|
||||
import {handleCacheFailure} from '../caching/cache-utils'
|
||||
import {CacheConfig} from '../configuration'
|
||||
@@ -51,7 +50,7 @@ async function resolveGradleVersion(version: string): Promise<GradleVersionInfo>
|
||||
case 'release-nightly':
|
||||
return gradleReleaseNightly()
|
||||
default:
|
||||
return gradle(version)
|
||||
return gradleRelease(version)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -76,10 +75,10 @@ async function gradleReleaseNightly(): Promise<GradleVersionInfo> {
|
||||
return await gradleVersionDeclaration(`${gradleVersionsBaseUrl}/release-nightly`)
|
||||
}
|
||||
|
||||
async function gradle(version: string): Promise<GradleVersionInfo> {
|
||||
async function gradleRelease(version: string): Promise<GradleVersionInfo> {
|
||||
const versionInfo = await findGradleVersionDeclaration(version)
|
||||
if (!versionInfo) {
|
||||
throw new Error(`Gradle version ${version} does not exists`)
|
||||
throw new Error(`Gradle version ${version} does not exist`)
|
||||
}
|
||||
return versionInfo
|
||||
}
|
||||
@@ -97,16 +96,47 @@ async function findGradleVersionDeclaration(version: string): Promise<GradleVers
|
||||
|
||||
async function installGradleVersion(versionInfo: GradleVersionInfo): Promise<string> {
|
||||
return core.group(`Provision Gradle ${versionInfo.version}`, async () => {
|
||||
const preInstalledGradle = await findGradleVersionOnPath(versionInfo)
|
||||
if (preInstalledGradle !== undefined) {
|
||||
core.info(`Gradle version ${versionInfo.version} is already available on PATH. Not installing.`)
|
||||
return preInstalledGradle
|
||||
const gradleOnPath = await findGradleExecutableOnPath()
|
||||
if (gradleOnPath) {
|
||||
const gradleOnPathVersion = await determineGradleVersion(gradleOnPath)
|
||||
if (gradleOnPathVersion === versionInfo.version) {
|
||||
core.info(`Gradle version ${versionInfo.version} is already available on PATH. Not installing.`)
|
||||
return gradleOnPath
|
||||
}
|
||||
}
|
||||
|
||||
return locateGradleAndDownloadIfRequired(versionInfo)
|
||||
})
|
||||
}
|
||||
|
||||
/**
|
||||
* Find (or install) a Gradle executable that meets the specified version requirement.
|
||||
* The Gradle version on PATH and all candidates are first checked for version compatibility.
|
||||
* If no existing Gradle version meets the requirement, the required version is installed.
|
||||
* @return Gradle executable with at least the required version.
|
||||
*/
|
||||
export async function provisionGradleWithVersionAtLeast(
|
||||
minimumVersion: string,
|
||||
candidates: string[] = []
|
||||
): Promise<string> {
|
||||
const gradleOnPath = await findGradleExecutableOnPath()
|
||||
const allCandidates = gradleOnPath ? [gradleOnPath, ...candidates] : candidates
|
||||
|
||||
return core.group(`Provision Gradle >= ${minimumVersion}`, async () => {
|
||||
for (const candidate of allCandidates) {
|
||||
const candidateVersion = await determineGradleVersion(candidate)
|
||||
if (candidateVersion && versionIsAtLeast(candidateVersion, minimumVersion)) {
|
||||
core.info(
|
||||
`Gradle version ${candidateVersion} is available at ${candidate} and >= ${minimumVersion}. Not installing.`
|
||||
)
|
||||
return candidate
|
||||
}
|
||||
}
|
||||
|
||||
return locateGradleAndDownloadIfRequired(await gradleRelease(minimumVersion))
|
||||
})
|
||||
}
|
||||
|
||||
async function locateGradleAndDownloadIfRequired(versionInfo: GradleVersionInfo): Promise<string> {
|
||||
const installsDir = path.join(getProvisionDir(), 'installs')
|
||||
const installDir = path.join(installsDir, `gradle-${versionInfo.version}`)
|
||||
@@ -192,15 +222,3 @@ interface GradleVersionInfo {
|
||||
version: string
|
||||
downloadUrl: string
|
||||
}
|
||||
|
||||
async function findGradleVersionOnPath(versionInfo: GradleVersionInfo): Promise<string | undefined> {
|
||||
const gradleExecutable = await which('gradle', {nothrow: true})
|
||||
if (gradleExecutable) {
|
||||
const output = await exec.getExecOutput(gradleExecutable, ['-v'], {silent: true})
|
||||
if (output.stdout.includes(`Gradle ${versionInfo.version}`)) {
|
||||
return gradleExecutable
|
||||
}
|
||||
}
|
||||
|
||||
return undefined
|
||||
}
|
||||
|
||||
@@ -43,7 +43,7 @@ export async function generateJobSummary(
|
||||
async function addPRComment(jobSummary: string): Promise<void> {
|
||||
const context = github.context
|
||||
if (context.payload.pull_request == null) {
|
||||
core.info('No pull_request trigger: not adding PR comment')
|
||||
core.info('No pull_request trigger detected: not adding PR comment')
|
||||
return
|
||||
}
|
||||
|
||||
|
||||
@@ -6,6 +6,7 @@ import org.gradle.api.internal.tasks.execution.*
|
||||
import org.gradle.execution.*
|
||||
import org.gradle.internal.build.event.BuildEventListenerRegistryInternal
|
||||
import org.gradle.util.GradleVersion
|
||||
import org.slf4j.LoggerFactory
|
||||
|
||||
settingsEvaluated { settings ->
|
||||
def projectTracker = gradle.sharedServices.registerIfAbsent("gradle-action-buildResultsRecorder", BuildResultsRecorder, { spec ->
|
||||
@@ -20,6 +21,7 @@ settingsEvaluated { settings ->
|
||||
}
|
||||
|
||||
abstract class BuildResultsRecorder implements BuildService<BuildResultsRecorder.Params>, BuildOperationListener, AutoCloseable {
|
||||
private final logger = LoggerFactory.getLogger("gradle/actions")
|
||||
private boolean buildFailed = false
|
||||
private boolean configCacheHit = true
|
||||
interface Params extends BuildServiceParameters {
|
||||
@@ -69,6 +71,7 @@ abstract class BuildResultsRecorder implements BuildService<BuildResultsRecorder
|
||||
buildResultsDir.mkdirs()
|
||||
def buildResultsFile = new File(buildResultsDir, githubActionStep + getParameters().getInvocationId().get() + ".json")
|
||||
if (!buildResultsFile.exists()) {
|
||||
logger.lifecycle("gradle/actions: Writing build results to ${buildResultsFile}")
|
||||
buildResultsFile << groovy.json.JsonOutput.toJson(buildResults)
|
||||
}
|
||||
} catch (Exception e) {
|
||||
|
||||
@@ -2,7 +2,9 @@
|
||||
* Capture information for each executed Gradle build to display in the job summary.
|
||||
*/
|
||||
import org.gradle.util.GradleVersion
|
||||
import org.slf4j.LoggerFactory
|
||||
|
||||
def SKIP_BUILD_CAPTURE = "GRADLE_ACTIONS_SKIP_BUILD_RESULT_CAPTURE"
|
||||
def BUILD_SCAN_PLUGIN_ID = "com.gradle.build-scan"
|
||||
def BUILD_SCAN_EXTENSION = "buildScan"
|
||||
def DEVELOCITY_PLUGIN_ID = "com.gradle.develocity"
|
||||
@@ -10,6 +12,11 @@ def DEVELOCITY_EXTENSION = "develocity"
|
||||
def GE_PLUGIN_ID = "com.gradle.enterprise"
|
||||
def GE_EXTENSION = "gradleEnterprise"
|
||||
|
||||
if (System.properties[SKIP_BUILD_CAPTURE] ?: System.getenv(SKIP_BUILD_CAPTURE)) {
|
||||
logger.lifecycle("gradle/actions: Not capturing build results")
|
||||
return
|
||||
}
|
||||
|
||||
// Only run against root build. Do not run against included builds.
|
||||
def isTopLevelBuild = gradle.getParent() == null
|
||||
if (isTopLevelBuild) {
|
||||
@@ -32,15 +39,19 @@ if (isTopLevelBuild) {
|
||||
|
||||
// Use the Develocity plugin to also capture build scan links, when available
|
||||
settingsEvaluated { settings ->
|
||||
settings.pluginManager.withPlugin(GE_PLUGIN_ID) {
|
||||
// Only execute if develocity plugin isn't applied.
|
||||
if (!settings.extensions.findByName(DEVELOCITY_EXTENSION)) {
|
||||
def captureBuildScanLink = {
|
||||
// Prefer the 'develocity' extension, if available
|
||||
if (settings.extensions.findByName(DEVELOCITY_EXTENSION)) {
|
||||
captureUsingBuildScanPublished(settings.extensions[DEVELOCITY_EXTENSION].buildScan, invocationId, resultsWriter)
|
||||
} else {
|
||||
captureUsingBuildScanPublished(settings.extensions[GE_EXTENSION].buildScan, invocationId, resultsWriter)
|
||||
}
|
||||
}
|
||||
|
||||
settings.pluginManager.withPlugin(GE_PLUGIN_ID, captureBuildScanLink)
|
||||
settings.pluginManager.withPlugin(DEVELOCITY_PLUGIN_ID) {
|
||||
captureUsingBuildScanPublished(settings.extensions[DEVELOCITY_EXTENSION].buildScan, invocationId, resultsWriter)
|
||||
// Develocity plugin applies GE plugin: avoid duplicate call
|
||||
if (settings.pluginManager.hasPlugin(GE_PLUGIN_ID)) return
|
||||
captureBuildScanLink()
|
||||
}
|
||||
}
|
||||
} else if (atLeastGradle3) {
|
||||
@@ -48,15 +59,21 @@ if (isTopLevelBuild) {
|
||||
// By default, use 'buildFinished' to capture build results
|
||||
captureUsingBuildFinished(gradle, invocationId, resultsWriter)
|
||||
|
||||
gradle.rootProject.pluginManager.withPlugin(BUILD_SCAN_PLUGIN_ID) {
|
||||
// Only execute if develocity plugin isn't applied.
|
||||
if (!gradle.rootProject.extensions.findByName(DEVELOCITY_EXTENSION)) {
|
||||
def captureBuildScanLink = {
|
||||
// Prefer the 'develocity' extension, if available
|
||||
if (gradle.rootProject.extensions.findByName(DEVELOCITY_EXTENSION)) {
|
||||
captureUsingBuildScanPublished(gradle.rootProject.extensions[DEVELOCITY_EXTENSION].buildScan, invocationId, resultsWriter)
|
||||
} else {
|
||||
captureUsingBuildScanPublished(gradle.rootProject.extensions[BUILD_SCAN_EXTENSION], invocationId, resultsWriter)
|
||||
}
|
||||
}
|
||||
|
||||
gradle.rootProject.pluginManager.withPlugin(BUILD_SCAN_PLUGIN_ID, captureBuildScanLink)
|
||||
|
||||
gradle.rootProject.pluginManager.withPlugin(DEVELOCITY_PLUGIN_ID) {
|
||||
captureUsingBuildScanPublished(gradle.rootProject.extensions[DEVELOCITY_EXTENSION].buildScan, invocationId, resultsWriter)
|
||||
// Develocity plugin applies Build Scan plugin: avoid duplicate call
|
||||
if (gradle.rootProject.pluginManager.hasPlugin(BUILD_SCAN_PLUGIN_ID)) return
|
||||
captureBuildScanLink()
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -69,7 +86,6 @@ def captureUsingBuildService(invocationId) {
|
||||
|
||||
void captureUsingBuildFinished(gradle, String invocationId, ResultsWriter resultsWriter) {
|
||||
gradle.buildFinished { result ->
|
||||
println "Got buildFinished: ${result}"
|
||||
def buildResults = [
|
||||
rootProjectName: rootProject.name,
|
||||
rootProjectDir: rootProject.projectDir.absolutePath,
|
||||
@@ -114,6 +130,8 @@ void captureUsingBuildScanPublished(buildScanExtension, String invocationId, Res
|
||||
}
|
||||
|
||||
class ResultsWriter {
|
||||
private final logger = LoggerFactory.getLogger("gradle/actions")
|
||||
|
||||
void writeToResultsFile(String subDir, String invocationId, def content) {
|
||||
def runnerTempDir = System.getProperty("RUNNER_TEMP") ?: System.getenv("RUNNER_TEMP")
|
||||
def githubActionStep = System.getProperty("GITHUB_ACTION") ?: System.getenv("GITHUB_ACTION")
|
||||
@@ -126,6 +144,7 @@ class ResultsWriter {
|
||||
buildResultsDir.mkdirs()
|
||||
def buildResultsFile = new File(buildResultsDir, githubActionStep + invocationId + ".json")
|
||||
if (!buildResultsFile.exists()) {
|
||||
logger.lifecycle("gradle/actions: Writing build results to ${buildResultsFile}")
|
||||
buildResultsFile << groovy.json.JsonOutput.toJson(content)
|
||||
}
|
||||
} catch (Exception e) {
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user