mirror of
https://github.com/gradle/gradle-build-action.git
synced 2025-10-20 07:08:56 +08:00
Compare commits
149 Commits
Author | SHA1 | Date | |
---|---|---|---|
|
749f47bda3 | ||
|
eb126d771e | ||
|
5056fa9d50 | ||
|
8a0051ffb2 | ||
|
4f87177da0 | ||
|
ff62946998 | ||
|
2eddd207d6 | ||
|
887e0bda35 | ||
|
dac0b87334 | ||
|
a8f0f0d523 | ||
|
951bc8ab16 | ||
|
c0e9e4809f | ||
|
c5df77b4dd | ||
|
f04973c111 | ||
|
2287707267 | ||
|
530c579a03 | ||
|
f65e80839b | ||
|
fed795f38c | ||
|
a63ae37710 | ||
|
6095a76664 | ||
|
96015f1e52 | ||
|
4a570433d8 | ||
|
601a5d4aa4 | ||
|
6df3b5baf5 | ||
|
96374ed57d | ||
|
59d37bdb61 | ||
|
5abf330283 | ||
|
86ee4f1f60 | ||
|
e0391a3985 | ||
|
09af07ef76 | ||
|
b47aad4750 | ||
|
758ee5a303 | ||
|
50f436c485 | ||
|
32863c1a40 | ||
|
b744d1079a | ||
|
bff802913e | ||
|
cacfec068e | ||
|
935e8941dd | ||
|
cfc50b189a | ||
|
7e68f96bb3 | ||
|
e444647395 | ||
|
970a1475f1 | ||
|
d9106fb21d | ||
|
6f59210bbe | ||
|
a8cfaf666b | ||
|
c82ad7fca4 | ||
|
e70e4c5e6b | ||
|
2bc6cca4b8 | ||
|
38bf8d67e6 | ||
|
1c56ebc005 | ||
|
7b3886699e | ||
|
c7ca785b85 | ||
|
dbca794d9a | ||
|
cbd0ff0688 | ||
|
1e6c29c1af | ||
|
d518883ba8 | ||
|
b3d342ca6a | ||
|
f7e0e454da | ||
|
60499ea6fd | ||
|
e4ca0fdab0 | ||
|
9adc0d5566 | ||
|
b1d3b7d6a0 | ||
|
43879ebea6 | ||
|
a64e4c087d | ||
|
3952b17b6f | ||
|
cb48b1f38e | ||
|
68ef9a8880 | ||
|
980f056e16 | ||
|
57f5c44cc6 | ||
|
e34d59c741 | ||
|
3d966761cf | ||
|
1b220aef6b | ||
|
a40cc892c0 | ||
|
7a088f07a3 | ||
|
ce77f6daf4 | ||
|
ba25077191 | ||
|
ea2e601207 | ||
|
4ebaed58ba | ||
|
9884d8f3dc | ||
|
2e30e4cc65 | ||
|
2fcb85ffb5 | ||
|
617a29d5b5 | ||
|
0ea8b0085d | ||
|
084bf86b45 | ||
|
a1c0141aa8 | ||
|
19307c73ca | ||
|
12054785f0 | ||
|
5d67aff3ea | ||
|
c2abdfc02b | ||
|
4d24cb28d8 | ||
|
9db683d515 | ||
|
45abe419bb | ||
|
d9799478b8 | ||
|
579b14502b | ||
|
a0cffe83e1 | ||
|
add2af0efd | ||
|
1fcc75d614 | ||
|
5df685c7b2 | ||
|
ee7cbb6fb4 | ||
|
1d2e9eb287 | ||
|
2df8f7bc66 | ||
|
3fbe033aaa | ||
|
0842a550d1 | ||
|
3b959539de | ||
|
c267ad1fcb | ||
|
fab7664a6a | ||
|
a5b34e05de | ||
|
a4b5212a9d | ||
|
ad59e53998 | ||
|
c224a16628 | ||
|
ec783957f3 | ||
|
6b08b7d2b5 | ||
|
fd32ae9081 | ||
|
8545e5aed7 | ||
|
d92395703c | ||
|
af916fa394 | ||
|
3d9f1fdd28 | ||
|
387c8bc97a | ||
|
31c4390f56 | ||
|
05b706c1e7 | ||
|
b9a8697f71 | ||
|
394498f89f | ||
|
c295a4096e | ||
|
74a56b60ce | ||
|
aeb3e0fcd7 | ||
|
8a17724c3e | ||
|
76ed799d26 | ||
|
dd8493d4f2 | ||
|
66061a0409 | ||
|
1a66a38284 | ||
|
bf471096d3 | ||
|
e8a7e1402f | ||
|
0e3ce37aac | ||
|
8d2472536e | ||
|
832889a6eb | ||
|
61f7cb1f75 | ||
|
e440eaf750 | ||
|
570f67893a | ||
|
402732a560 | ||
|
a6f860c57c | ||
|
657d21ac23 | ||
|
688380a438 | ||
|
cce16c4e36 | ||
|
b50380a07d | ||
|
aa2854e6ea | ||
|
471bcda20a | ||
|
91306f47ea | ||
|
65c865a172 | ||
|
1761dcff13 |
@@ -29,7 +29,7 @@
|
|||||||
"@typescript-eslint/no-inferrable-types": "error",
|
"@typescript-eslint/no-inferrable-types": "error",
|
||||||
"@typescript-eslint/no-misused-new": "error",
|
"@typescript-eslint/no-misused-new": "error",
|
||||||
"@typescript-eslint/no-namespace": "error",
|
"@typescript-eslint/no-namespace": "error",
|
||||||
"@typescript-eslint/no-non-null-assertion": "warn",
|
"@typescript-eslint/no-non-null-assertion": "off",
|
||||||
"@typescript-eslint/no-unnecessary-qualifier": "error",
|
"@typescript-eslint/no-unnecessary-qualifier": "error",
|
||||||
"@typescript-eslint/no-unnecessary-type-assertion": "error",
|
"@typescript-eslint/no-unnecessary-type-assertion": "error",
|
||||||
"@typescript-eslint/no-useless-constructor": "error",
|
"@typescript-eslint/no-useless-constructor": "error",
|
||||||
|
5
.github/dependabot.yml
vendored
5
.github/dependabot.yml
vendored
@@ -6,11 +6,14 @@ registries:
|
|||||||
username: dummy # Required by dependabot
|
username: dummy # Required by dependabot
|
||||||
password: dummy # Required by dependabot
|
password: dummy # Required by dependabot
|
||||||
updates:
|
updates:
|
||||||
|
- package-ecosystem: "github-actions"
|
||||||
|
directory: "/"
|
||||||
|
schedule:
|
||||||
|
interval: "weekly"
|
||||||
- package-ecosystem: "npm"
|
- package-ecosystem: "npm"
|
||||||
directory: "/"
|
directory: "/"
|
||||||
schedule:
|
schedule:
|
||||||
interval: "weekly"
|
interval: "weekly"
|
||||||
open-pull-requests-limit: 10
|
|
||||||
ignore:
|
ignore:
|
||||||
- dependency-name: "@types/node"
|
- dependency-name: "@types/node"
|
||||||
- package-ecosystem: "gradle"
|
- package-ecosystem: "gradle"
|
||||||
|
Binary file not shown.
@@ -1,6 +1,7 @@
|
|||||||
distributionBase=GRADLE_USER_HOME
|
distributionBase=GRADLE_USER_HOME
|
||||||
distributionPath=wrapper/dists
|
distributionPath=wrapper/dists
|
||||||
distributionSha256Sum=f6b8596b10cce501591e92f229816aa4046424f3b24d771751b06779d58c8ec4
|
distributionSha256Sum=ff7bf6a86f09b9b2c40bb8f48b25fc19cf2b2664fd1d220cd7ab833ec758d0d7
|
||||||
distributionUrl=https\://services.gradle.org/distributions/gradle-7.5.1-bin.zip
|
distributionUrl=https\://services.gradle.org/distributions/gradle-8.0.2-bin.zip
|
||||||
|
networkTimeout=10000
|
||||||
zipStoreBase=GRADLE_USER_HOME
|
zipStoreBase=GRADLE_USER_HOME
|
||||||
zipStorePath=wrapper/dists
|
zipStorePath=wrapper/dists
|
||||||
|
12
.github/workflow-samples/gradle-plugin/gradlew
vendored
12
.github/workflow-samples/gradle-plugin/gradlew
vendored
@@ -55,7 +55,7 @@
|
|||||||
# Darwin, MinGW, and NonStop.
|
# Darwin, MinGW, and NonStop.
|
||||||
#
|
#
|
||||||
# (3) This script is generated from the Groovy template
|
# (3) This script is generated from the Groovy template
|
||||||
# https://github.com/gradle/gradle/blob/master/subprojects/plugins/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt
|
# https://github.com/gradle/gradle/blob/HEAD/subprojects/plugins/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt
|
||||||
# within the Gradle project.
|
# within the Gradle project.
|
||||||
#
|
#
|
||||||
# You can find Gradle at https://github.com/gradle/gradle/.
|
# You can find Gradle at https://github.com/gradle/gradle/.
|
||||||
@@ -80,10 +80,10 @@ do
|
|||||||
esac
|
esac
|
||||||
done
|
done
|
||||||
|
|
||||||
APP_HOME=$( cd "${APP_HOME:-./}" && pwd -P ) || exit
|
# This is normally unused
|
||||||
|
# shellcheck disable=SC2034
|
||||||
APP_NAME="Gradle"
|
|
||||||
APP_BASE_NAME=${0##*/}
|
APP_BASE_NAME=${0##*/}
|
||||||
|
APP_HOME=$( cd "${APP_HOME:-./}" && pwd -P ) || exit
|
||||||
|
|
||||||
# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
|
# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
|
||||||
DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"'
|
DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"'
|
||||||
@@ -143,12 +143,16 @@ fi
|
|||||||
if ! "$cygwin" && ! "$darwin" && ! "$nonstop" ; then
|
if ! "$cygwin" && ! "$darwin" && ! "$nonstop" ; then
|
||||||
case $MAX_FD in #(
|
case $MAX_FD in #(
|
||||||
max*)
|
max*)
|
||||||
|
# In POSIX sh, ulimit -H is undefined. That's why the result is checked to see if it worked.
|
||||||
|
# shellcheck disable=SC3045
|
||||||
MAX_FD=$( ulimit -H -n ) ||
|
MAX_FD=$( ulimit -H -n ) ||
|
||||||
warn "Could not query maximum file descriptor limit"
|
warn "Could not query maximum file descriptor limit"
|
||||||
esac
|
esac
|
||||||
case $MAX_FD in #(
|
case $MAX_FD in #(
|
||||||
'' | soft) :;; #(
|
'' | soft) :;; #(
|
||||||
*)
|
*)
|
||||||
|
# In POSIX sh, ulimit -n is undefined. That's why the result is checked to see if it worked.
|
||||||
|
# shellcheck disable=SC3045
|
||||||
ulimit -n "$MAX_FD" ||
|
ulimit -n "$MAX_FD" ||
|
||||||
warn "Could not set maximum file descriptor limit to $MAX_FD"
|
warn "Could not set maximum file descriptor limit to $MAX_FD"
|
||||||
esac
|
esac
|
||||||
|
@@ -26,6 +26,7 @@ if "%OS%"=="Windows_NT" setlocal
|
|||||||
|
|
||||||
set DIRNAME=%~dp0
|
set DIRNAME=%~dp0
|
||||||
if "%DIRNAME%"=="" set DIRNAME=.
|
if "%DIRNAME%"=="" set DIRNAME=.
|
||||||
|
@rem This is normally unused
|
||||||
set APP_BASE_NAME=%~n0
|
set APP_BASE_NAME=%~n0
|
||||||
set APP_HOME=%DIRNAME%
|
set APP_HOME=%DIRNAME%
|
||||||
|
|
||||||
|
@@ -29,7 +29,7 @@ testing {
|
|||||||
functionalTest(JvmTestSuite) {
|
functionalTest(JvmTestSuite) {
|
||||||
dependencies {
|
dependencies {
|
||||||
// functionalTest test suite depends on the production code in tests
|
// functionalTest test suite depends on the production code in tests
|
||||||
implementation project
|
implementation(project(':plugin'))
|
||||||
}
|
}
|
||||||
|
|
||||||
targets {
|
targets {
|
||||||
|
@@ -11,8 +11,8 @@ dependencies {
|
|||||||
}
|
}
|
||||||
|
|
||||||
tasks.named("test").configure {
|
tasks.named("test").configure {
|
||||||
// Echo an output value so we can detect configuration-cache usage
|
// Write marker file so we can detect if task was configured
|
||||||
println "::set-output name=task_configured::yes"
|
file("task-configured.txt").text = "true"
|
||||||
|
|
||||||
doLast {
|
doLast {
|
||||||
if (System.properties.verifyCachedBuild) {
|
if (System.properties.verifyCachedBuild) {
|
||||||
|
Binary file not shown.
@@ -1,6 +1,7 @@
|
|||||||
distributionBase=GRADLE_USER_HOME
|
distributionBase=GRADLE_USER_HOME
|
||||||
distributionPath=wrapper/dists
|
distributionPath=wrapper/dists
|
||||||
distributionSha256Sum=f6b8596b10cce501591e92f229816aa4046424f3b24d771751b06779d58c8ec4
|
distributionSha256Sum=ff7bf6a86f09b9b2c40bb8f48b25fc19cf2b2664fd1d220cd7ab833ec758d0d7
|
||||||
distributionUrl=https\://services.gradle.org/distributions/gradle-7.5.1-bin.zip
|
distributionUrl=https\://services.gradle.org/distributions/gradle-8.0.2-bin.zip
|
||||||
|
networkTimeout=10000
|
||||||
zipStoreBase=GRADLE_USER_HOME
|
zipStoreBase=GRADLE_USER_HOME
|
||||||
zipStorePath=wrapper/dists
|
zipStorePath=wrapper/dists
|
||||||
|
12
.github/workflow-samples/groovy-dsl/gradlew
vendored
12
.github/workflow-samples/groovy-dsl/gradlew
vendored
@@ -55,7 +55,7 @@
|
|||||||
# Darwin, MinGW, and NonStop.
|
# Darwin, MinGW, and NonStop.
|
||||||
#
|
#
|
||||||
# (3) This script is generated from the Groovy template
|
# (3) This script is generated from the Groovy template
|
||||||
# https://github.com/gradle/gradle/blob/master/subprojects/plugins/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt
|
# https://github.com/gradle/gradle/blob/HEAD/subprojects/plugins/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt
|
||||||
# within the Gradle project.
|
# within the Gradle project.
|
||||||
#
|
#
|
||||||
# You can find Gradle at https://github.com/gradle/gradle/.
|
# You can find Gradle at https://github.com/gradle/gradle/.
|
||||||
@@ -80,10 +80,10 @@ do
|
|||||||
esac
|
esac
|
||||||
done
|
done
|
||||||
|
|
||||||
APP_HOME=$( cd "${APP_HOME:-./}" && pwd -P ) || exit
|
# This is normally unused
|
||||||
|
# shellcheck disable=SC2034
|
||||||
APP_NAME="Gradle"
|
|
||||||
APP_BASE_NAME=${0##*/}
|
APP_BASE_NAME=${0##*/}
|
||||||
|
APP_HOME=$( cd "${APP_HOME:-./}" && pwd -P ) || exit
|
||||||
|
|
||||||
# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
|
# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
|
||||||
DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"'
|
DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"'
|
||||||
@@ -143,12 +143,16 @@ fi
|
|||||||
if ! "$cygwin" && ! "$darwin" && ! "$nonstop" ; then
|
if ! "$cygwin" && ! "$darwin" && ! "$nonstop" ; then
|
||||||
case $MAX_FD in #(
|
case $MAX_FD in #(
|
||||||
max*)
|
max*)
|
||||||
|
# In POSIX sh, ulimit -H is undefined. That's why the result is checked to see if it worked.
|
||||||
|
# shellcheck disable=SC3045
|
||||||
MAX_FD=$( ulimit -H -n ) ||
|
MAX_FD=$( ulimit -H -n ) ||
|
||||||
warn "Could not query maximum file descriptor limit"
|
warn "Could not query maximum file descriptor limit"
|
||||||
esac
|
esac
|
||||||
case $MAX_FD in #(
|
case $MAX_FD in #(
|
||||||
'' | soft) :;; #(
|
'' | soft) :;; #(
|
||||||
*)
|
*)
|
||||||
|
# In POSIX sh, ulimit -n is undefined. That's why the result is checked to see if it worked.
|
||||||
|
# shellcheck disable=SC3045
|
||||||
ulimit -n "$MAX_FD" ||
|
ulimit -n "$MAX_FD" ||
|
||||||
warn "Could not set maximum file descriptor limit to $MAX_FD"
|
warn "Could not set maximum file descriptor limit to $MAX_FD"
|
||||||
esac
|
esac
|
||||||
|
@@ -26,6 +26,7 @@ if "%OS%"=="Windows_NT" setlocal
|
|||||||
|
|
||||||
set DIRNAME=%~dp0
|
set DIRNAME=%~dp0
|
||||||
if "%DIRNAME%"=="" set DIRNAME=.
|
if "%DIRNAME%"=="" set DIRNAME=.
|
||||||
|
@rem This is normally unused
|
||||||
set APP_BASE_NAME=%~n0
|
set APP_BASE_NAME=%~n0
|
||||||
set APP_HOME=%DIRNAME%
|
set APP_HOME=%DIRNAME%
|
||||||
|
|
||||||
|
@@ -1,6 +1,6 @@
|
|||||||
plugins {
|
plugins {
|
||||||
id "com.gradle.enterprise" version "3.11.1"
|
id "com.gradle.enterprise" version "3.12.6"
|
||||||
id "com.gradle.common-custom-user-data-gradle-plugin" version "1.8"
|
id "com.gradle.common-custom-user-data-gradle-plugin" version "1.10"
|
||||||
}
|
}
|
||||||
|
|
||||||
gradleEnterprise {
|
gradleEnterprise {
|
||||||
|
Binary file not shown.
@@ -1,6 +1,7 @@
|
|||||||
distributionBase=GRADLE_USER_HOME
|
distributionBase=GRADLE_USER_HOME
|
||||||
distributionPath=wrapper/dists
|
distributionPath=wrapper/dists
|
||||||
distributionSha256Sum=f6b8596b10cce501591e92f229816aa4046424f3b24d771751b06779d58c8ec4
|
distributionSha256Sum=ff7bf6a86f09b9b2c40bb8f48b25fc19cf2b2664fd1d220cd7ab833ec758d0d7
|
||||||
distributionUrl=https\://services.gradle.org/distributions/gradle-7.5.1-bin.zip
|
distributionUrl=https\://services.gradle.org/distributions/gradle-8.0.2-bin.zip
|
||||||
|
networkTimeout=10000
|
||||||
zipStoreBase=GRADLE_USER_HOME
|
zipStoreBase=GRADLE_USER_HOME
|
||||||
zipStorePath=wrapper/dists
|
zipStorePath=wrapper/dists
|
||||||
|
12
.github/workflow-samples/java-toolchain/gradlew
vendored
12
.github/workflow-samples/java-toolchain/gradlew
vendored
@@ -55,7 +55,7 @@
|
|||||||
# Darwin, MinGW, and NonStop.
|
# Darwin, MinGW, and NonStop.
|
||||||
#
|
#
|
||||||
# (3) This script is generated from the Groovy template
|
# (3) This script is generated from the Groovy template
|
||||||
# https://github.com/gradle/gradle/blob/master/subprojects/plugins/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt
|
# https://github.com/gradle/gradle/blob/HEAD/subprojects/plugins/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt
|
||||||
# within the Gradle project.
|
# within the Gradle project.
|
||||||
#
|
#
|
||||||
# You can find Gradle at https://github.com/gradle/gradle/.
|
# You can find Gradle at https://github.com/gradle/gradle/.
|
||||||
@@ -80,10 +80,10 @@ do
|
|||||||
esac
|
esac
|
||||||
done
|
done
|
||||||
|
|
||||||
APP_HOME=$( cd "${APP_HOME:-./}" && pwd -P ) || exit
|
# This is normally unused
|
||||||
|
# shellcheck disable=SC2034
|
||||||
APP_NAME="Gradle"
|
|
||||||
APP_BASE_NAME=${0##*/}
|
APP_BASE_NAME=${0##*/}
|
||||||
|
APP_HOME=$( cd "${APP_HOME:-./}" && pwd -P ) || exit
|
||||||
|
|
||||||
# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
|
# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
|
||||||
DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"'
|
DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"'
|
||||||
@@ -143,12 +143,16 @@ fi
|
|||||||
if ! "$cygwin" && ! "$darwin" && ! "$nonstop" ; then
|
if ! "$cygwin" && ! "$darwin" && ! "$nonstop" ; then
|
||||||
case $MAX_FD in #(
|
case $MAX_FD in #(
|
||||||
max*)
|
max*)
|
||||||
|
# In POSIX sh, ulimit -H is undefined. That's why the result is checked to see if it worked.
|
||||||
|
# shellcheck disable=SC3045
|
||||||
MAX_FD=$( ulimit -H -n ) ||
|
MAX_FD=$( ulimit -H -n ) ||
|
||||||
warn "Could not query maximum file descriptor limit"
|
warn "Could not query maximum file descriptor limit"
|
||||||
esac
|
esac
|
||||||
case $MAX_FD in #(
|
case $MAX_FD in #(
|
||||||
'' | soft) :;; #(
|
'' | soft) :;; #(
|
||||||
*)
|
*)
|
||||||
|
# In POSIX sh, ulimit -n is undefined. That's why the result is checked to see if it worked.
|
||||||
|
# shellcheck disable=SC3045
|
||||||
ulimit -n "$MAX_FD" ||
|
ulimit -n "$MAX_FD" ||
|
||||||
warn "Could not set maximum file descriptor limit to $MAX_FD"
|
warn "Could not set maximum file descriptor limit to $MAX_FD"
|
||||||
esac
|
esac
|
||||||
|
@@ -26,6 +26,7 @@ if "%OS%"=="Windows_NT" setlocal
|
|||||||
|
|
||||||
set DIRNAME=%~dp0
|
set DIRNAME=%~dp0
|
||||||
if "%DIRNAME%"=="" set DIRNAME=.
|
if "%DIRNAME%"=="" set DIRNAME=.
|
||||||
|
@rem This is normally unused
|
||||||
set APP_BASE_NAME=%~n0
|
set APP_BASE_NAME=%~n0
|
||||||
set APP_HOME=%DIRNAME%
|
set APP_HOME=%DIRNAME%
|
||||||
|
|
||||||
|
@@ -1 +1,5 @@
|
|||||||
|
plugins {
|
||||||
|
id("org.gradle.toolchains.foojay-resolver-convention") version("0.4.0")
|
||||||
|
}
|
||||||
|
|
||||||
rootProject.name = 'basic'
|
rootProject.name = 'basic'
|
||||||
|
@@ -10,7 +10,7 @@ dependencies {
|
|||||||
api("org.apache.commons:commons-math3:3.6.1")
|
api("org.apache.commons:commons-math3:3.6.1")
|
||||||
implementation("com.google.guava:guava:31.1-jre")
|
implementation("com.google.guava:guava:31.1-jre")
|
||||||
|
|
||||||
testImplementation("org.junit.jupiter:junit-jupiter:5.9.0")
|
testImplementation("org.junit.jupiter:junit-jupiter:5.9.2")
|
||||||
}
|
}
|
||||||
|
|
||||||
tasks.test {
|
tasks.test {
|
||||||
@@ -18,8 +18,8 @@ tasks.test {
|
|||||||
}
|
}
|
||||||
|
|
||||||
tasks.named("test").configure {
|
tasks.named("test").configure {
|
||||||
// Echo an output value so we can detect configuration-cache usage
|
// Write marker file so we can detect if task was configured
|
||||||
println("::set-output name=task_configured::yes")
|
file("task-configured.txt").writeText("true")
|
||||||
|
|
||||||
doLast {
|
doLast {
|
||||||
if (System.getProperties().containsKey("verifyCachedBuild")) {
|
if (System.getProperties().containsKey("verifyCachedBuild")) {
|
||||||
|
Binary file not shown.
@@ -1,6 +1,7 @@
|
|||||||
distributionBase=GRADLE_USER_HOME
|
distributionBase=GRADLE_USER_HOME
|
||||||
distributionPath=wrapper/dists
|
distributionPath=wrapper/dists
|
||||||
distributionSha256Sum=f6b8596b10cce501591e92f229816aa4046424f3b24d771751b06779d58c8ec4
|
distributionSha256Sum=ff7bf6a86f09b9b2c40bb8f48b25fc19cf2b2664fd1d220cd7ab833ec758d0d7
|
||||||
distributionUrl=https\://services.gradle.org/distributions/gradle-7.5.1-bin.zip
|
distributionUrl=https\://services.gradle.org/distributions/gradle-8.0.2-bin.zip
|
||||||
|
networkTimeout=10000
|
||||||
zipStoreBase=GRADLE_USER_HOME
|
zipStoreBase=GRADLE_USER_HOME
|
||||||
zipStorePath=wrapper/dists
|
zipStorePath=wrapper/dists
|
||||||
|
12
.github/workflow-samples/kotlin-dsl/gradlew
vendored
12
.github/workflow-samples/kotlin-dsl/gradlew
vendored
@@ -55,7 +55,7 @@
|
|||||||
# Darwin, MinGW, and NonStop.
|
# Darwin, MinGW, and NonStop.
|
||||||
#
|
#
|
||||||
# (3) This script is generated from the Groovy template
|
# (3) This script is generated from the Groovy template
|
||||||
# https://github.com/gradle/gradle/blob/master/subprojects/plugins/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt
|
# https://github.com/gradle/gradle/blob/HEAD/subprojects/plugins/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt
|
||||||
# within the Gradle project.
|
# within the Gradle project.
|
||||||
#
|
#
|
||||||
# You can find Gradle at https://github.com/gradle/gradle/.
|
# You can find Gradle at https://github.com/gradle/gradle/.
|
||||||
@@ -80,10 +80,10 @@ do
|
|||||||
esac
|
esac
|
||||||
done
|
done
|
||||||
|
|
||||||
APP_HOME=$( cd "${APP_HOME:-./}" && pwd -P ) || exit
|
# This is normally unused
|
||||||
|
# shellcheck disable=SC2034
|
||||||
APP_NAME="Gradle"
|
|
||||||
APP_BASE_NAME=${0##*/}
|
APP_BASE_NAME=${0##*/}
|
||||||
|
APP_HOME=$( cd "${APP_HOME:-./}" && pwd -P ) || exit
|
||||||
|
|
||||||
# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
|
# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
|
||||||
DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"'
|
DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"'
|
||||||
@@ -143,12 +143,16 @@ fi
|
|||||||
if ! "$cygwin" && ! "$darwin" && ! "$nonstop" ; then
|
if ! "$cygwin" && ! "$darwin" && ! "$nonstop" ; then
|
||||||
case $MAX_FD in #(
|
case $MAX_FD in #(
|
||||||
max*)
|
max*)
|
||||||
|
# In POSIX sh, ulimit -H is undefined. That's why the result is checked to see if it worked.
|
||||||
|
# shellcheck disable=SC3045
|
||||||
MAX_FD=$( ulimit -H -n ) ||
|
MAX_FD=$( ulimit -H -n ) ||
|
||||||
warn "Could not query maximum file descriptor limit"
|
warn "Could not query maximum file descriptor limit"
|
||||||
esac
|
esac
|
||||||
case $MAX_FD in #(
|
case $MAX_FD in #(
|
||||||
'' | soft) :;; #(
|
'' | soft) :;; #(
|
||||||
*)
|
*)
|
||||||
|
# In POSIX sh, ulimit -n is undefined. That's why the result is checked to see if it worked.
|
||||||
|
# shellcheck disable=SC3045
|
||||||
ulimit -n "$MAX_FD" ||
|
ulimit -n "$MAX_FD" ||
|
||||||
warn "Could not set maximum file descriptor limit to $MAX_FD"
|
warn "Could not set maximum file descriptor limit to $MAX_FD"
|
||||||
esac
|
esac
|
||||||
|
@@ -26,6 +26,7 @@ if "%OS%"=="Windows_NT" setlocal
|
|||||||
|
|
||||||
set DIRNAME=%~dp0
|
set DIRNAME=%~dp0
|
||||||
if "%DIRNAME%"=="" set DIRNAME=.
|
if "%DIRNAME%"=="" set DIRNAME=.
|
||||||
|
@rem This is normally unused
|
||||||
set APP_BASE_NAME=%~n0
|
set APP_BASE_NAME=%~n0
|
||||||
set APP_HOME=%DIRNAME%
|
set APP_HOME=%DIRNAME%
|
||||||
|
|
||||||
|
@@ -1,6 +1,6 @@
|
|||||||
plugins {
|
plugins {
|
||||||
id("com.gradle.enterprise") version "3.11.1"
|
id("com.gradle.enterprise") version "3.12.6"
|
||||||
id("com.gradle.common-custom-user-data-gradle-plugin") version "1.8"
|
id("com.gradle.common-custom-user-data-gradle-plugin") version "1.10"
|
||||||
}
|
}
|
||||||
|
|
||||||
gradleEnterprise {
|
gradleEnterprise {
|
||||||
|
@@ -1,5 +1,5 @@
|
|||||||
plugins {
|
plugins {
|
||||||
id "com.gradle.build-scan" version "3.11.1"
|
id "com.gradle.build-scan" version "3.12.6"
|
||||||
}
|
}
|
||||||
|
|
||||||
gradleEnterprise {
|
gradleEnterprise {
|
||||||
|
@@ -1,5 +1,5 @@
|
|||||||
plugins {
|
plugins {
|
||||||
id "com.gradle.enterprise" version "3.11.1"
|
id "com.gradle.enterprise" version "3.12.6"
|
||||||
}
|
}
|
||||||
|
|
||||||
gradleEnterprise {
|
gradleEnterprise {
|
||||||
|
20
.github/workflows/ci-dependency-review.yml
vendored
Normal file
20
.github/workflows/ci-dependency-review.yml
vendored
Normal file
@@ -0,0 +1,20 @@
|
|||||||
|
# Dependency Review Action
|
||||||
|
#
|
||||||
|
# This Action will scan dependency manifest files that change as part of a Pull Request, surfacing known-vulnerable versions of the packages declared or updated in the PR. Once installed, if the workflow run is marked as required, PRs introducing known-vulnerable packages will be blocked from merging.
|
||||||
|
#
|
||||||
|
# Source repository: https://github.com/actions/dependency-review-action
|
||||||
|
# Public documentation: https://docs.github.com/en/code-security/supply-chain-security/understanding-your-software-supply-chain/about-dependency-review#dependency-review-enforcement
|
||||||
|
name: CI-dependency-review
|
||||||
|
on: [pull_request]
|
||||||
|
|
||||||
|
permissions:
|
||||||
|
contents: read
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
dependency-review:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
steps:
|
||||||
|
- name: 'Checkout Repository'
|
||||||
|
uses: actions/checkout@v3
|
||||||
|
- name: 'Dependency Review'
|
||||||
|
uses: actions/dependency-review-action@v3
|
8
.github/workflows/ci-full-check.yml
vendored
8
.github/workflows/ci-full-check.yml
vendored
@@ -44,10 +44,10 @@ jobs:
|
|||||||
with:
|
with:
|
||||||
cache-key-prefix: ${{github.run_number}}-
|
cache-key-prefix: ${{github.run_number}}-
|
||||||
|
|
||||||
restore-configuration-cache:
|
# restore-configuration-cache:
|
||||||
uses: ./.github/workflows/integ-test-restore-configuration-cache.yml
|
# uses: ./.github/workflows/integ-test-restore-configuration-cache.yml
|
||||||
with:
|
# with:
|
||||||
cache-key-prefix: ${{github.run_number}}-
|
# cache-key-prefix: ${{github.run_number}}-
|
||||||
|
|
||||||
restore-custom-gradle-home:
|
restore-custom-gradle-home:
|
||||||
uses: ./.github/workflows/integ-test-restore-custom-gradle-home.yml
|
uses: ./.github/workflows/integ-test-restore-custom-gradle-home.yml
|
||||||
|
16
.github/workflows/ci-quick-check.yml
vendored
16
.github/workflows/ci-quick-check.yml
vendored
@@ -19,6 +19,10 @@ jobs:
|
|||||||
steps:
|
steps:
|
||||||
- name: Checkout sources
|
- name: Checkout sources
|
||||||
uses: actions/checkout@v3
|
uses: actions/checkout@v3
|
||||||
|
- name: Configure Gradle as default for unit test
|
||||||
|
uses: ./
|
||||||
|
with:
|
||||||
|
gradle-version: 7.6.1
|
||||||
- name: Run tests
|
- name: Run tests
|
||||||
run: |
|
run: |
|
||||||
npm install
|
npm install
|
||||||
@@ -67,12 +71,12 @@ jobs:
|
|||||||
runner-os: '["ubuntu-latest"]'
|
runner-os: '["ubuntu-latest"]'
|
||||||
download-dist: true
|
download-dist: true
|
||||||
|
|
||||||
restore-configuration-cache:
|
# restore-configuration-cache:
|
||||||
needs: build-distribution
|
# needs: build-distribution
|
||||||
uses: ./.github/workflows/integ-test-restore-configuration-cache.yml
|
# uses: ./.github/workflows/integ-test-restore-configuration-cache.yml
|
||||||
with:
|
# with:
|
||||||
runner-os: '["ubuntu-latest"]'
|
# runner-os: '["ubuntu-latest"]'
|
||||||
download-dist: true
|
# download-dist: true
|
||||||
|
|
||||||
restore-containerized-gradle-home:
|
restore-containerized-gradle-home:
|
||||||
needs: build-distribution
|
needs: build-distribution
|
||||||
|
4
.github/workflows/ci-verify-outputs.yml
vendored
4
.github/workflows/ci-verify-outputs.yml
vendored
@@ -18,8 +18,10 @@ jobs:
|
|||||||
uses: actions/checkout@v3
|
uses: actions/checkout@v3
|
||||||
- name: Build
|
- name: Build
|
||||||
run: |
|
run: |
|
||||||
|
npm -v
|
||||||
|
node -v
|
||||||
npm install
|
npm install
|
||||||
npm run all
|
npm run build
|
||||||
|
|
||||||
- name: Compare the expected and actual dist/ directories
|
- name: Compare the expected and actual dist/ directories
|
||||||
run: |
|
run: |
|
||||||
|
@@ -60,11 +60,13 @@ jobs:
|
|||||||
working-directory: .github/workflow-samples/groovy-dsl
|
working-directory: .github/workflow-samples/groovy-dsl
|
||||||
run: ./gradlew test --configuration-cache
|
run: ./gradlew test --configuration-cache
|
||||||
- name: Check that configuration-cache was used
|
- name: Check that configuration-cache was used
|
||||||
if: ${{ steps.execute.outputs.task_configured == 'yes' }}
|
|
||||||
uses: actions/github-script@v6
|
uses: actions/github-script@v6
|
||||||
with:
|
with:
|
||||||
script: |
|
script: |
|
||||||
|
const fs = require('fs')
|
||||||
|
if (fs.existsSync('.github/workflow-samples/groovy-dsl/task-configured.txt')) {
|
||||||
core.setFailed('Configuration cache was not used - task was configured unexpectedly')
|
core.setFailed('Configuration cache was not used - task was configured unexpectedly')
|
||||||
|
}
|
||||||
|
|
||||||
# Check that the build can run when no extracted cache entries are restored
|
# Check that the build can run when no extracted cache entries are restored
|
||||||
gradle-user-home-not-fully-restored:
|
gradle-user-home-not-fully-restored:
|
||||||
@@ -154,9 +156,11 @@ jobs:
|
|||||||
working-directory: .github/workflow-samples/kotlin-dsl
|
working-directory: .github/workflow-samples/kotlin-dsl
|
||||||
run: ./gradlew test --configuration-cache
|
run: ./gradlew test --configuration-cache
|
||||||
- name: Check that configuration-cache was used
|
- name: Check that configuration-cache was used
|
||||||
if: ${{ steps.execute.outputs.task_configured == 'yes' }}
|
|
||||||
uses: actions/github-script@v6
|
uses: actions/github-script@v6
|
||||||
with:
|
with:
|
||||||
script: |
|
script: |
|
||||||
|
const fs = require('fs')
|
||||||
|
if (fs.existsSync('.github/workflow-samples/kotlin-dsl/task-configured.txt')) {
|
||||||
core.setFailed('Configuration cache was not used - task was configured unexpectedly')
|
core.setFailed('Configuration cache was not used - task was configured unexpectedly')
|
||||||
|
}
|
||||||
|
|
||||||
|
2
.gitignore
vendored
2
.gitignore
vendored
@@ -102,5 +102,3 @@ __tests__/runner/*
|
|||||||
.idea/
|
.idea/
|
||||||
*.iml
|
*.iml
|
||||||
|
|
||||||
# ASDF tool configuration
|
|
||||||
.tool-versions
|
|
||||||
|
3
.tool-versions
Normal file
3
.tool-versions
Normal file
@@ -0,0 +1,3 @@
|
|||||||
|
# Configuration file for asdf version manager
|
||||||
|
nodejs 16.18.1
|
||||||
|
gradle 7.6.1
|
14
CONTRIBUTING.md
Normal file
14
CONTRIBUTING.md
Normal file
@@ -0,0 +1,14 @@
|
|||||||
|
### How to merge a Dependabot PR
|
||||||
|
|
||||||
|
The "distribution" for a GitHub Action is checked into the repository itself.
|
||||||
|
In the case of the `gradle-build-action`, the transpiled sources are committed to the `dist` directory.
|
||||||
|
Any production dependencies are inlined into the distribution.
|
||||||
|
So if a Dependabot PR updates a production dependency (or a dev dependency that changes the distribution, like the Typescript compiler),
|
||||||
|
then a manual step is required to rebuild the dist and commit.
|
||||||
|
|
||||||
|
The simplest process to follow is:
|
||||||
|
1. Checkout the dependabot branch locally eg: `git checkout dependabot/npm_and_yarn/actions/github-5.1.0`
|
||||||
|
2. Run `npm install` to download and the new dependencies and install locally
|
||||||
|
3. Run `npm run build` to regenerate the distribution
|
||||||
|
4. Push the changes to the dependabot branch
|
||||||
|
5. If/when the checks pass, you can merge the dependabot PR
|
32
README.md
32
README.md
@@ -38,7 +38,7 @@ It is possible to directly invoke Gradle in your workflow, and the `actions/setu
|
|||||||
|
|
||||||
However, the `gradle-build-action` offers a number of advantages over this approach:
|
However, the `gradle-build-action` offers a number of advantages over this approach:
|
||||||
|
|
||||||
- Easily [run the build with different versions of Gradle](#download-install-and-use-a-specific-gradle-version) using the `gradle-version` parameter. Gradle distributions are automatically downloaded and cached.
|
- Easily [run the build with different versions of Gradle](#use-a-specific-gradle-version) using the `gradle-version` parameter. Gradle distributions are automatically downloaded and cached.
|
||||||
- More sophisticated and more efficient caching of Gradle User Home between invocations, compared to `setup-java` and most custom configurations using `actions/cache`. [More details below](#caching).
|
- More sophisticated and more efficient caching of Gradle User Home between invocations, compared to `setup-java` and most custom configurations using `actions/cache`. [More details below](#caching).
|
||||||
- Detailed reporting of cache usage and cache configuration options allow you to [optimize the use of the GitHub actions cache](#optimizing-cache-effectiveness).
|
- Detailed reporting of cache usage and cache configuration options allow you to [optimize the use of the GitHub actions cache](#optimizing-cache-effectiveness).
|
||||||
- [Automatic capture of build scan links](#build-scans) from the build, making these easier to locate for workflow run.
|
- [Automatic capture of build scan links](#build-scans) from the build, making these easier to locate for workflow run.
|
||||||
@@ -197,7 +197,6 @@ By default, this action aims to cache any and all reusable state that may be spe
|
|||||||
The state that is cached includes:
|
The state that is cached includes:
|
||||||
- Any distributions downloaded to satisfy a `gradle-version` parameter ;
|
- Any distributions downloaded to satisfy a `gradle-version` parameter ;
|
||||||
- A subset of the Gradle User Home directory, including downloaded dependencies, wrapper distributions, and the local build cache ;
|
- A subset of the Gradle User Home directory, including downloaded dependencies, wrapper distributions, and the local build cache ;
|
||||||
- Any [configuration-cache](https://docs.gradle.org/nightly/userguide/configuration_cache.html) data stored in the project `.gradle` directory. (Only supported for Gradle 7 or higher.)
|
|
||||||
|
|
||||||
To reduce the space required for caching, this action makes a best effort to reduce duplication in cache entries.
|
To reduce the space required for caching, this action makes a best effort to reduce duplication in cache entries.
|
||||||
|
|
||||||
@@ -209,7 +208,7 @@ cache-disabled: true
|
|||||||
|
|
||||||
Distributions downloaded to satisfy a `gradle-version` parameter are stored outside of Gradle User Home and cached separately. The cache key is unique to the downloaded distribution and will not change over time.
|
Distributions downloaded to satisfy a `gradle-version` parameter are stored outside of Gradle User Home and cached separately. The cache key is unique to the downloaded distribution and will not change over time.
|
||||||
|
|
||||||
The state of the Gradle User Home and configuration-cache are highly dependent on the Gradle execution, so the cache key is composed of the current commit hash and the GitHub actions job id.
|
The state of the Gradle User Home is highly dependent on the Gradle execution, so the cache key is composed of the current commit hash and the GitHub actions job id.
|
||||||
As such, the cache key is likely to change on each subsequent run of GitHub actions.
|
As such, the cache key is likely to change on each subsequent run of GitHub actions.
|
||||||
This allows the most recent state to always be available in the GitHub actions cache.
|
This allows the most recent state to always be available in the GitHub actions cache.
|
||||||
|
|
||||||
@@ -252,9 +251,10 @@ gradle-home-cache-includes: |
|
|||||||
caches
|
caches
|
||||||
notifications
|
notifications
|
||||||
jdks
|
jdks
|
||||||
# Exclude the local build-cache from the directories cached.
|
# Exclude the local build-cache and keyrings from the directories cached.
|
||||||
gradle-home-cache-excludes: |
|
gradle-home-cache-excludes: |
|
||||||
caches/build-cache-1
|
caches/build-cache-1
|
||||||
|
caches/keyrings
|
||||||
```
|
```
|
||||||
|
|
||||||
You can specify any number of fixed paths or patterns to include or exclude.
|
You can specify any number of fixed paths or patterns to include or exclude.
|
||||||
@@ -306,6 +306,21 @@ Each build is different, and some builds produce more Gradle User Home content t
|
|||||||
[Cache debugging ](#cache-debugging-and-analysis) can provide insight into which cache entries are the largest,
|
[Cache debugging ](#cache-debugging-and-analysis) can provide insight into which cache entries are the largest,
|
||||||
and you can selectively [exclude content using `gradle-home-cache-exclude`](#gradle-user-home-cache-tuning).
|
and you can selectively [exclude content using `gradle-home-cache-exclude`](#gradle-user-home-cache-tuning).
|
||||||
|
|
||||||
|
#### Removing unused files from Gradle User Home before saving to cache
|
||||||
|
|
||||||
|
The Gradle User Home directory has a tendency to grow over time. When you switch to a new Gradle wrapper version or upgrade a dependency version
|
||||||
|
the old files are not automatically and immediately removed. While this can make sense in a local environment, in a GitHub Actions environment
|
||||||
|
it can lead to ever-larger Gradle User Home cache entries being saved and restored.
|
||||||
|
|
||||||
|
In order to avoid this situation, the `gradle-build-action` supports the `gradle-home-cache-cleanup` parameter.
|
||||||
|
When enabled, this feature will attempt to delete any files in the Gradle User Home that were not used by Gradle during the GitHub Actions workflow,
|
||||||
|
prior to saving the Gradle User Home to the GitHub Actions cache.
|
||||||
|
|
||||||
|
Gradle Home cache cleanup is disabled by default. You can enable this feature for the action as follows:
|
||||||
|
```yaml
|
||||||
|
gradle-home-cache-cleanup: true
|
||||||
|
```
|
||||||
|
|
||||||
## Saving build outputs
|
## Saving build outputs
|
||||||
|
|
||||||
By default, a GitHub Actions workflow using `gradle-build-action` will record the log output and any Build Scan links for your build,
|
By default, a GitHub Actions workflow using `gradle-build-action` will record the log output and any Build Scan links for your build,
|
||||||
@@ -369,10 +384,17 @@ jobs:
|
|||||||
})
|
})
|
||||||
```
|
```
|
||||||
|
|
||||||
|
Note that the build scan capturing utilizes the [Initialization Script](https://docs.gradle.org/current/userguide/init_scripts.html#sec:using_an_init_script)
|
||||||
|
in the `USER_HOME/.gradle/init.d/` directory, with the file named `build-result-capture.init.gradle`.
|
||||||
|
So, if you are using the init scripts for the [Gradle Enterprise Gradle Plugin](https://plugins.gradle.org/plugin/com.gradle.enterprise) like
|
||||||
|
[`scans-init.gradle` or `gradle-enterprise-init.gradle`](https://docs.gradle.com/enterprise/gradle-plugin/#scans_gradle_com),
|
||||||
|
make sure that its file names have earlier alphabetical order to the `build-result-capture.init.gradle`,
|
||||||
|
since configuring capture requires Gradle Enterprise Gradle Plugin to be applied already.
|
||||||
|
|
||||||
## Support for GitHub Enterprise Server (GHES)
|
## Support for GitHub Enterprise Server (GHES)
|
||||||
|
|
||||||
You can use the `gradle-build-action` on GitHub Enterprise Server, and benefit from the improved integration with Gradle. Depending on the version of GHES you are running, certain features may be limited:
|
You can use the `gradle-build-action` on GitHub Enterprise Server, and benefit from the improved integration with Gradle. Depending on the version of GHES you are running, certain features may be limited:
|
||||||
- Build scan links are captured and displayed in the GitHub Actions UI
|
- Build scan links are captured and displayed in the GitHub Actions UI
|
||||||
- Easily run your build with different versions of Gradle
|
- Easily run your build with different versions of Gradle
|
||||||
- Save/restore of Gradle User Home (requires GHES v3.5+ : GitHub Actions cache was introduced in GHES 3.5)
|
- Save/restore of Gradle User Home (requires GHES v3.5+ : GitHub Actions cache was introduced in GHES 3.5)
|
||||||
- Support for GitHub Actions Job Summary is not yet available in any version of GHES. Instead of producing a Job Summary, the build-results summary and caching report will be written to the workflow log, as part of the post-action step.
|
- Support for GitHub Actions Job Summary (requires GHES 3.6+ : GitHub Actions Job Summary support was introduced in GHES 3.6). In earlier versions of GHES the build-results summary and caching report will be written to the workflow log, as part of the post-action step.
|
||||||
|
13704
dist/main/index.js
vendored
13704
dist/main/index.js
vendored
File diff suppressed because one or more lines are too long
2
dist/main/index.js.map
vendored
2
dist/main/index.js.map
vendored
File diff suppressed because one or more lines are too long
1
dist/main/sourcemap-register.js
vendored
1
dist/main/sourcemap-register.js
vendored
File diff suppressed because one or more lines are too long
13704
dist/post/index.js
vendored
13704
dist/post/index.js
vendored
File diff suppressed because one or more lines are too long
2
dist/post/index.js.map
vendored
2
dist/post/index.js.map
vendored
File diff suppressed because one or more lines are too long
1
dist/post/sourcemap-register.js
vendored
1
dist/post/sourcemap-register.js
vendored
File diff suppressed because one or more lines are too long
6449
package-lock.json
generated
6449
package-lock.json
generated
File diff suppressed because it is too large
Load Diff
34
package.json
34
package.json
@@ -8,7 +8,7 @@
|
|||||||
"format": "prettier --write **/*.ts",
|
"format": "prettier --write **/*.ts",
|
||||||
"format-check": "prettier --check **/*.ts",
|
"format-check": "prettier --check **/*.ts",
|
||||||
"lint": "eslint src/**/*.ts",
|
"lint": "eslint src/**/*.ts",
|
||||||
"compile": "ncc build src/main.ts --out dist/main --source-map && ncc build src/post.ts --out dist/post --source-map",
|
"compile": "ncc build src/main.ts --out dist/main --source-map --no-source-map-register && ncc build src/post.ts --out dist/post --source-map --no-source-map-register",
|
||||||
"test": "jest",
|
"test": "jest",
|
||||||
"check": "npm run format && npm run lint",
|
"check": "npm run format && npm run lint",
|
||||||
"build": "npm run check && npm run compile",
|
"build": "npm run check && npm run compile",
|
||||||
@@ -26,29 +26,29 @@
|
|||||||
],
|
],
|
||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@actions/cache": "3.0.4",
|
"@actions/cache": "3.2.1",
|
||||||
"@actions/core": "1.9.1",
|
"@actions/core": "1.10.0",
|
||||||
"@actions/exec": "1.1.1",
|
"@actions/exec": "1.1.1",
|
||||||
"@actions/github": "5.0.3",
|
"@actions/github": "5.1.1",
|
||||||
"@actions/glob": "0.3.0",
|
"@actions/glob": "0.4.0",
|
||||||
"@actions/http-client": "2.0.1",
|
"@actions/http-client": "2.1.0",
|
||||||
"@actions/tool-cache": "2.0.1",
|
"@actions/tool-cache": "2.0.1",
|
||||||
"string-argv": "0.3.1"
|
"string-argv": "0.3.1"
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@types/jest": "28.1.7",
|
|
||||||
"@types/node": "16.11.21",
|
"@types/node": "16.11.21",
|
||||||
|
"@types/jest": "29.5.0",
|
||||||
"@types/unzipper": "0.10.5",
|
"@types/unzipper": "0.10.5",
|
||||||
"@typescript-eslint/parser": "5.35.1",
|
"@typescript-eslint/parser": "5.58.0",
|
||||||
"@vercel/ncc": "0.34.0",
|
"@vercel/ncc": "0.36.1",
|
||||||
"eslint": "8.22.0",
|
"eslint": "8.38.0",
|
||||||
"eslint-plugin-github": "4.3.7",
|
"eslint-plugin-github": "4.7.0",
|
||||||
"eslint-plugin-jest": "26.8.7",
|
"eslint-plugin-jest": "27.2.1",
|
||||||
"jest": "28.1.3",
|
"jest": "29.5.0",
|
||||||
"js-yaml": "4.1.0",
|
"js-yaml": "4.1.0",
|
||||||
"patch-package": "6.4.7",
|
"patch-package": "6.5.1",
|
||||||
"prettier": "2.7.1",
|
"prettier": "2.8.7",
|
||||||
"ts-jest": "28.0.8",
|
"ts-jest": "29.1.0",
|
||||||
"typescript": "4.8.2"
|
"typescript": "5.0.4"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@@ -1,22 +1,22 @@
|
|||||||
diff --git a/node_modules/@actions/cache/lib/cache.d.ts b/node_modules/@actions/cache/lib/cache.d.ts
|
diff --git a/node_modules/@actions/cache/lib/cache.d.ts b/node_modules/@actions/cache/lib/cache.d.ts
|
||||||
index 16b20f7..aea77ba 100644
|
index 4658366..b796e58 100644
|
||||||
--- a/node_modules/@actions/cache/lib/cache.d.ts
|
--- a/node_modules/@actions/cache/lib/cache.d.ts
|
||||||
+++ b/node_modules/@actions/cache/lib/cache.d.ts
|
+++ b/node_modules/@actions/cache/lib/cache.d.ts
|
||||||
@@ -20,7 +20,7 @@ export declare function isFeatureAvailable(): boolean;
|
@@ -21,7 +21,7 @@ export declare function isFeatureAvailable(): boolean;
|
||||||
* @param downloadOptions cache download options
|
* @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
|
* @returns string returns the key for the cache hit, otherwise returns undefined
|
||||||
*/
|
*/
|
||||||
-export declare function restoreCache(paths: string[], primaryKey: string, restoreKeys?: string[], options?: DownloadOptions): Promise<string | 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): Promise<CacheEntry | 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
|
* Saves a list of files with the specified key
|
||||||
*
|
*
|
||||||
@@ -29,4 +29,12 @@ export declare function restoreCache(paths: string[], primaryKey: string, restor
|
@@ -31,4 +31,12 @@ export declare function restoreCache(paths: string[], primaryKey: string, restor
|
||||||
* @param options cache upload options
|
* @param options cache upload options
|
||||||
* @returns number returns cacheId if the cache was saved successfully and throws an error if save fails
|
* @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): Promise<number>;
|
-export declare function saveCache(paths: string[], key: string, options?: UploadOptions, enableCrossOsArchive?: boolean): Promise<number>;
|
||||||
+export declare function saveCache(paths: string[], key: string, options?: UploadOptions): Promise<CacheEntry>;
|
+export declare function saveCache(paths: string[], key: string, options?: UploadOptions, enableCrossOsArchive?: boolean): Promise<CacheEntry>;
|
||||||
+
|
+
|
||||||
+// PATCHED: Add `CacheEntry` as return type for save/restore functions
|
+// PATCHED: Add `CacheEntry` as return type for save/restore functions
|
||||||
+// This allows us to track and report on cache entry sizes.
|
+// This allows us to track and report on cache entry sizes.
|
||||||
@@ -26,23 +26,12 @@ index 16b20f7..aea77ba 100644
|
|||||||
+ constructor(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
|
diff --git a/node_modules/@actions/cache/lib/cache.js b/node_modules/@actions/cache/lib/cache.js
|
||||||
index 4dc5e88..92d99d5 100644
|
index 9d636aa..a176bd7 100644
|
||||||
--- a/node_modules/@actions/cache/lib/cache.js
|
--- a/node_modules/@actions/cache/lib/cache.js
|
||||||
+++ b/node_modules/@actions/cache/lib/cache.js
|
+++ b/node_modules/@actions/cache/lib/cache.js
|
||||||
@@ -95,26 +95,18 @@ function restoreCache(paths, primaryKey, restoreKeys, options) {
|
@@ -127,18 +127,21 @@ function restoreCache(paths, primaryKey, restoreKeys, options, enableCrossOsArch
|
||||||
}
|
|
||||||
archivePath = path.join(yield utils.createTempDirectory(), utils.getCacheFileName(compressionMethod));
|
|
||||||
core.debug(`Archive Path: ${archivePath}`);
|
|
||||||
+ const restoredEntry = new CacheEntry(cacheEntry.cacheKey);
|
|
||||||
// Download the cache from the cache entry
|
|
||||||
yield cacheHttpClient.downloadCache(cacheEntry.archiveLocation, archivePath, options);
|
|
||||||
if (core.isDebug()) {
|
|
||||||
yield tar_1.listTar(archivePath, compressionMethod);
|
|
||||||
}
|
|
||||||
const archiveFileSize = utils.getArchiveFileSizeInBytes(archivePath);
|
|
||||||
+ restoredEntry.size = archiveFileSize;
|
|
||||||
core.info(`Cache Size: ~${Math.round(archiveFileSize / (1024 * 1024))} MB (${archiveFileSize} B)`);
|
core.info(`Cache Size: ~${Math.round(archiveFileSize / (1024 * 1024))} MB (${archiveFileSize} B)`);
|
||||||
yield tar_1.extractTar(archivePath, compressionMethod);
|
yield (0, tar_1.extractTar)(archivePath, compressionMethod);
|
||||||
core.info('Cache restored successfully');
|
core.info('Cache restored successfully');
|
||||||
- return cacheEntry.cacheKey;
|
- return cacheEntry.cacheKey;
|
||||||
- }
|
- }
|
||||||
@@ -55,29 +44,31 @@ index 4dc5e88..92d99d5 100644
|
|||||||
- // Supress all non-validation cache related errors because caching should be optional
|
- // Supress all non-validation cache related errors because caching should be optional
|
||||||
- core.warning(`Failed to restore: ${error.message}`);
|
- core.warning(`Failed to restore: ${error.message}`);
|
||||||
- }
|
- }
|
||||||
+ return restoredEntry;
|
+
|
||||||
|
+ // 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 {
|
finally {
|
||||||
// Try to delete the archive to save space
|
// Try to delete the archive to save space
|
||||||
@@ -153,6 +145,7 @@ function saveCache(paths, key, options) {
|
|
||||||
const archiveFolder = yield utils.createTempDirectory();
|
|
||||||
const archivePath = path.join(archiveFolder, utils.getCacheFileName(compressionMethod));
|
|
||||||
core.debug(`Archive Path: ${archivePath}`);
|
|
||||||
+ const savedEntry = new CacheEntry(key);
|
|
||||||
try {
|
try {
|
||||||
yield tar_1.createTar(archiveFolder, cachePaths, compressionMethod);
|
@@ -206,19 +209,23 @@ function saveCache(paths, key, options, enableCrossOsArchive = false) {
|
||||||
if (core.isDebug()) {
|
|
||||||
@@ -160,6 +153,7 @@ function saveCache(paths, key, options) {
|
|
||||||
}
|
}
|
||||||
const fileSizeLimit = 10 * 1024 * 1024 * 1024; // 10GB per repo limit
|
|
||||||
const archiveFileSize = utils.getArchiveFileSizeInBytes(archivePath);
|
|
||||||
+ savedEntry.size = archiveFileSize;
|
|
||||||
core.debug(`File Size: ${archiveFileSize}`);
|
|
||||||
// For GHES, this check will take place in ReserveCache API with enterprise file size limit
|
|
||||||
if (archiveFileSize > fileSizeLimit && !utils.isGhes()) {
|
|
||||||
@@ -182,18 +176,6 @@ function saveCache(paths, key, options) {
|
|
||||||
core.debug(`Saving Cache (ID: ${cacheId})`);
|
core.debug(`Saving Cache (ID: ${cacheId})`);
|
||||||
yield cacheHttpClient.saveCache(cacheId, archivePath, options);
|
yield cacheHttpClient.saveCache(cacheId, archivePath, options);
|
||||||
|
+
|
||||||
|
+ // PATCHED - Return more inforamtion about saved entry
|
||||||
|
+ return new CacheEntry(key, archiveFileSize);
|
||||||
}
|
}
|
||||||
- catch (error) {
|
- catch (error) {
|
||||||
- const typedError = error;
|
- const typedError = error;
|
||||||
@@ -91,15 +82,23 @@ index 4dc5e88..92d99d5 100644
|
|||||||
- core.warning(`Failed to save: ${typedError.message}`);
|
- 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 {
|
finally {
|
||||||
// Try to delete the archive to save space
|
// Try to delete the archive to save space
|
||||||
try {
|
try {
|
||||||
@@ -203,8 +185,15 @@ function saveCache(paths, key, options) {
|
@@ -232,4 +239,11 @@ function saveCache(paths, key, options, enableCrossOsArchive = false) {
|
||||||
core.debug(`Failed to delete archive: ${error}`);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
- return cacheId;
|
|
||||||
+ return savedEntry;
|
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
exports.saveCache = saveCache;
|
exports.saveCache = saveCache;
|
48
patches/@azure+logger+1.0.4.patch
Normal file
48
patches/@azure+logger+1.0.4.patch
Normal file
@@ -0,0 +1,48 @@
|
|||||||
|
diff --git a/node_modules/@azure/logger/dist-esm/src/debug.js b/node_modules/@azure/logger/dist-esm/src/debug.js
|
||||||
|
index d202779..30e8313 100644
|
||||||
|
--- a/node_modules/@azure/logger/dist-esm/src/debug.js
|
||||||
|
+++ b/node_modules/@azure/logger/dist-esm/src/debug.js
|
||||||
|
@@ -7,7 +7,7 @@ let enabledNamespaces = [];
|
||||||
|
let skippedNamespaces = [];
|
||||||
|
const debuggers = [];
|
||||||
|
if (debugEnvVariable) {
|
||||||
|
- enable(debugEnvVariable);
|
||||||
|
+ // enable(debugEnvVariable);
|
||||||
|
}
|
||||||
|
const debugObj = Object.assign((namespace) => {
|
||||||
|
return createDebugger(namespace);
|
||||||
|
diff --git a/node_modules/@azure/logger/dist-esm/src/index.js b/node_modules/@azure/logger/dist-esm/src/index.js
|
||||||
|
index cc25720..2925db5 100644
|
||||||
|
--- a/node_modules/@azure/logger/dist-esm/src/index.js
|
||||||
|
+++ b/node_modules/@azure/logger/dist-esm/src/index.js
|
||||||
|
@@ -20,7 +20,7 @@ if (logLevelFromEnv) {
|
||||||
|
setLogLevel(logLevelFromEnv);
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
- console.error(`AZURE_LOG_LEVEL set to unknown log level '${logLevelFromEnv}'; logging is not enabled. Acceptable values: ${AZURE_LOG_LEVELS.join(", ")}.`);
|
||||||
|
+ console.error(`AZURE_LOG_LEVEL set to unknown log level; logging is not enabled. Acceptable values: ${AZURE_LOG_LEVELS.join(", ")}.`);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
diff --git a/node_modules/@azure/logger/dist/index.js b/node_modules/@azure/logger/dist/index.js
|
||||||
|
index 81e97c3..a415e2f 100644
|
||||||
|
--- a/node_modules/@azure/logger/dist/index.js
|
||||||
|
+++ b/node_modules/@azure/logger/dist/index.js
|
||||||
|
@@ -21,7 +21,7 @@ let enabledNamespaces = [];
|
||||||
|
let skippedNamespaces = [];
|
||||||
|
const debuggers = [];
|
||||||
|
if (debugEnvVariable) {
|
||||||
|
- enable(debugEnvVariable);
|
||||||
|
+ // enable(debugEnvVariable);
|
||||||
|
}
|
||||||
|
const debugObj = Object.assign((namespace) => {
|
||||||
|
return createDebugger(namespace);
|
||||||
|
@@ -125,7 +125,7 @@ if (logLevelFromEnv) {
|
||||||
|
setLogLevel(logLevelFromEnv);
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
- console.error(`AZURE_LOG_LEVEL set to unknown log level '${logLevelFromEnv}'; logging is not enabled. Acceptable values: ${AZURE_LOG_LEVELS.join(", ")}.`);
|
||||||
|
+ console.error(`AZURE_LOG_LEVEL set to unknown log level; logging is not enabled. Acceptable values: ${AZURE_LOG_LEVELS.join(", ")}.`);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
/**
|
@@ -4,7 +4,7 @@ import path from 'path'
|
|||||||
import fs from 'fs'
|
import fs from 'fs'
|
||||||
import {CacheListener} from './cache-reporting'
|
import {CacheListener} from './cache-reporting'
|
||||||
import {saveCache, restoreCache, cacheDebug, isCacheDebuggingEnabled, tryDelete, generateCacheKey} from './cache-utils'
|
import {saveCache, restoreCache, cacheDebug, isCacheDebuggingEnabled, tryDelete, generateCacheKey} from './cache-utils'
|
||||||
import {ConfigurationCacheEntryExtractor, GradleHomeEntryExtractor} from './cache-extract-entries'
|
import {GradleHomeEntryExtractor} from './cache-extract-entries'
|
||||||
|
|
||||||
const RESTORED_CACHE_KEY_KEY = 'restored-cache-key'
|
const RESTORED_CACHE_KEY_KEY = 'restored-cache-key'
|
||||||
|
|
||||||
@@ -80,7 +80,7 @@ export class GradleStateCache {
|
|||||||
async afterRestore(listener: CacheListener): Promise<void> {
|
async afterRestore(listener: CacheListener): Promise<void> {
|
||||||
await this.debugReportGradleUserHomeSize('as restored from cache')
|
await this.debugReportGradleUserHomeSize('as restored from cache')
|
||||||
await new GradleHomeEntryExtractor(this.gradleUserHome).restore(listener)
|
await new GradleHomeEntryExtractor(this.gradleUserHome).restore(listener)
|
||||||
await new ConfigurationCacheEntryExtractor(this.gradleUserHome).restore(listener)
|
// await new ConfigurationCacheEntryExtractor(this.gradleUserHome).restore(listener)
|
||||||
await this.debugReportGradleUserHomeSize('after restoring common artifacts')
|
await this.debugReportGradleUserHomeSize('after restoring common artifacts')
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -130,8 +130,8 @@ export class GradleStateCache {
|
|||||||
await this.debugReportGradleUserHomeSize('before saving common artifacts')
|
await this.debugReportGradleUserHomeSize('before saving common artifacts')
|
||||||
this.deleteExcludedPaths()
|
this.deleteExcludedPaths()
|
||||||
await Promise.all([
|
await Promise.all([
|
||||||
new GradleHomeEntryExtractor(this.gradleUserHome).extract(listener),
|
new GradleHomeEntryExtractor(this.gradleUserHome).extract(listener)
|
||||||
new ConfigurationCacheEntryExtractor(this.gradleUserHome).extract(listener)
|
// new ConfigurationCacheEntryExtractor(this.gradleUserHome).extract(listener)
|
||||||
])
|
])
|
||||||
await this.debugReportGradleUserHomeSize(
|
await this.debugReportGradleUserHomeSize(
|
||||||
"after extracting common artifacts (only 'caches' and 'notifications' will be stored)"
|
"after extracting common artifacts (only 'caches' and 'notifications' will be stored)"
|
||||||
|
@@ -48,7 +48,7 @@ export class CacheCleaner {
|
|||||||
}
|
}
|
||||||
|
|
||||||
private async ageAllFiles(fileName = '*'): Promise<void> {
|
private async ageAllFiles(fileName = '*'): Promise<void> {
|
||||||
core.debug(`Aging all files in Gradle User Homee with name ${fileName}`)
|
core.debug(`Aging all files in Gradle User Home with name ${fileName}`)
|
||||||
await this.setUtimes(`${this.gradleUserHome}/**/${fileName}`, new Date(0))
|
await this.setUtimes(`${this.gradleUserHome}/**/${fileName}`, new Date(0))
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -338,8 +338,8 @@ export class GradleHomeEntryExtractor extends AbstractEntryExtractor {
|
|||||||
|
|
||||||
return [
|
return [
|
||||||
entryDefinition('generated-gradle-jars', ['caches/*/generated-gradle-jars/*.jar'], false),
|
entryDefinition('generated-gradle-jars', ['caches/*/generated-gradle-jars/*.jar'], false),
|
||||||
entryDefinition('wrapper-zips', ['wrapper/dists/*/*/'], false), // Entire wrapper directory cached together
|
entryDefinition('wrapper-zips', ['wrapper/dists/*/*/'], false), // Each wrapper directory cached separately
|
||||||
entryDefinition('java-toolchains', ['jdks/*.zip', 'jdks/*.tar.gz'], false),
|
entryDefinition('java-toolchains', ['jdks/*/'], false), // Each extracted JDK cached separately
|
||||||
entryDefinition('dependencies', ['caches/modules-*/files-*/*/*/*/*'], true),
|
entryDefinition('dependencies', ['caches/modules-*/files-*/*/*/*/*'], true),
|
||||||
entryDefinition('instrumented-jars', ['caches/jars-*/*'], true),
|
entryDefinition('instrumented-jars', ['caches/jars-*/*'], true),
|
||||||
entryDefinition('kotlin-dsl', ['caches/*/kotlin-dsl/*/*'], true)
|
entryDefinition('kotlin-dsl', ['caches/*/kotlin-dsl/*/*'], true)
|
||||||
|
@@ -9,7 +9,7 @@ import * as fs from 'fs'
|
|||||||
|
|
||||||
import {CacheEntryListener} from './cache-reporting'
|
import {CacheEntryListener} from './cache-reporting'
|
||||||
|
|
||||||
const CACHE_PROTOCOL_VERSION = 'v6-'
|
const CACHE_PROTOCOL_VERSION = 'v7-'
|
||||||
|
|
||||||
const JOB_CONTEXT_PARAMETER = 'workflow-job-context'
|
const JOB_CONTEXT_PARAMETER = 'workflow-job-context'
|
||||||
const CACHE_DISABLED_PARAMETER = 'cache-disabled'
|
const CACHE_DISABLED_PARAMETER = 'cache-disabled'
|
||||||
@@ -223,7 +223,7 @@ export async function tryDelete(file: string): Promise<void> {
|
|||||||
try {
|
try {
|
||||||
const stat = fs.lstatSync(file)
|
const stat = fs.lstatSync(file)
|
||||||
if (stat.isDirectory()) {
|
if (stat.isDirectory()) {
|
||||||
fs.rmdirSync(file, {recursive: true})
|
fs.rmSync(file, {recursive: true})
|
||||||
} else {
|
} else {
|
||||||
fs.unlinkSync(file)
|
fs.unlinkSync(file)
|
||||||
}
|
}
|
||||||
|
@@ -54,6 +54,8 @@ abstract class BuildResultsRecorder implements BuildService<BuildResultsRecorder
|
|||||||
def buildResultsDir = new File(runnerTempDir, ".build-results")
|
def buildResultsDir = new File(runnerTempDir, ".build-results")
|
||||||
buildResultsDir.mkdirs()
|
buildResultsDir.mkdirs()
|
||||||
def buildResultsFile = new File(buildResultsDir, githubActionStep + getParameters().getInvocationId().get() + ".json")
|
def buildResultsFile = new File(buildResultsDir, githubActionStep + getParameters().getInvocationId().get() + ".json")
|
||||||
|
if (!buildResultsFile.exists()) {
|
||||||
buildResultsFile << groovy.json.JsonOutput.toJson(buildResults)
|
buildResultsFile << groovy.json.JsonOutput.toJson(buildResults)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
@@ -21,6 +21,7 @@ if (isTopLevelBuild) {
|
|||||||
captureUsingBuildScanPublished(settings.extensions["gradleEnterprise"].buildScan, settings.rootProject, invocationId)
|
captureUsingBuildScanPublished(settings.extensions["gradleEnterprise"].buildScan, settings.rootProject, invocationId)
|
||||||
}
|
}
|
||||||
// We also need to add hooks in case the plugin is applied but no build scan is published
|
// We also need to add hooks in case the plugin is applied but no build scan is published
|
||||||
|
// The `buildScanPublished` results will NOT be overwritten by these calls
|
||||||
if (useBuildService) {
|
if (useBuildService) {
|
||||||
captureUsingBuildService(settings, invocationId)
|
captureUsingBuildService(settings, invocationId)
|
||||||
} else {
|
} else {
|
||||||
@@ -51,8 +52,14 @@ def captureUsingBuildScanPublished(buildScanExtension, rootProject, invocationId
|
|||||||
buildResults.setBuildScanUri(buildScan.buildScanUri.toASCIIString())
|
buildResults.setBuildScanUri(buildScan.buildScanUri.toASCIIString())
|
||||||
buildResults.writeToResultsFile(true)
|
buildResults.writeToResultsFile(true)
|
||||||
|
|
||||||
|
def githubOutput = System.getenv("GITHUB_OUTPUT")
|
||||||
|
if (githubOutput) {
|
||||||
|
new File(githubOutput) << "build-scan-url=${buildScan.buildScanUri}\n"
|
||||||
|
} else {
|
||||||
|
// Retained for compatibility with older GitHub Enterprise versions
|
||||||
println("::set-output name=build-scan-url::${buildScan.buildScanUri}")
|
println("::set-output name=build-scan-url::${buildScan.buildScanUri}")
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
onError { error ->
|
onError { error ->
|
||||||
buildResults.setBuildScanFailed()
|
buildResults.setBuildScanFailed()
|
||||||
@@ -65,9 +72,7 @@ def captureUsingBuildFinished(gradle, invocationId) {
|
|||||||
gradle.buildFinished { result ->
|
gradle.buildFinished { result ->
|
||||||
def buildResults = new BuildResults(invocationId, gradle, gradle.rootProject)
|
def buildResults = new BuildResults(invocationId, gradle, gradle.rootProject)
|
||||||
buildResults.setBuildResult(result)
|
buildResults.setBuildResult(result)
|
||||||
|
|
||||||
buildResults.writeToResultsFile(false)
|
buildResults.writeToResultsFile(false)
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -14,13 +14,13 @@ repositories {
|
|||||||
|
|
||||||
dependencies {
|
dependencies {
|
||||||
testImplementation gradleTestKit()
|
testImplementation gradleTestKit()
|
||||||
testImplementation 'org.spockframework:spock-core:2.1-groovy-3.0'
|
testImplementation 'org.spockframework:spock-core:2.3-groovy-3.0'
|
||||||
testImplementation('org.spockframework:spock-junit4:2.1-groovy-3.0')
|
testImplementation('org.spockframework:spock-junit4:2.3-groovy-3.0')
|
||||||
|
|
||||||
testImplementation ('io.ratpack:ratpack-groovy-test:1.9.0') {
|
testImplementation ('io.ratpack:ratpack-groovy-test:1.9.0') {
|
||||||
exclude group: 'org.codehaus.groovy', module: 'groovy-all'
|
exclude group: 'org.codehaus.groovy', module: 'groovy-all'
|
||||||
}
|
}
|
||||||
testImplementation 'com.fasterxml.jackson.dataformat:jackson-dataformat-smile:2.13.3'
|
testImplementation 'com.fasterxml.jackson.dataformat:jackson-dataformat-smile:2.14.2'
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -1,5 +1,5 @@
|
|||||||
distributionBase=GRADLE_USER_HOME
|
distributionBase=GRADLE_USER_HOME
|
||||||
distributionPath=wrapper/dists
|
distributionPath=wrapper/dists
|
||||||
distributionUrl=https\://services.gradle.org/distributions/gradle-7.4.2-bin.zip
|
distributionUrl=https\://services.gradle.org/distributions/gradle-7.5.1-bin.zip
|
||||||
zipStoreBase=GRADLE_USER_HOME
|
zipStoreBase=GRADLE_USER_HOME
|
||||||
zipStorePath=wrapper/dists
|
zipStorePath=wrapper/dists
|
||||||
|
@@ -1,6 +1,6 @@
|
|||||||
plugins {
|
plugins {
|
||||||
id "com.gradle.enterprise" version "3.11.1"
|
id "com.gradle.enterprise" version "3.12.6"
|
||||||
id "com.gradle.common-custom-user-data-gradle-plugin" version "1.8"
|
id "com.gradle.common-custom-user-data-gradle-plugin" version "1.10"
|
||||||
}
|
}
|
||||||
|
|
||||||
gradleEnterprise {
|
gradleEnterprise {
|
||||||
|
@@ -17,30 +17,26 @@ import java.util.zip.GZIPOutputStream
|
|||||||
|
|
||||||
class BaseInitScriptTest extends Specification {
|
class BaseInitScriptTest extends Specification {
|
||||||
|
|
||||||
static final TestGradleVersion GRADLE_3_5 = new TestGradleVersion(GradleVersion.version('3.5.1'), 7, 9)
|
static final TestGradleVersion GRADLE_3_X = new TestGradleVersion(GradleVersion.version('3.5.1'), 7, 9)
|
||||||
static final TestGradleVersion GRADLE_4_0 = new TestGradleVersion(GradleVersion.version('4.0.2'), 7, 9)
|
static final TestGradleVersion GRADLE_4_X = new TestGradleVersion(GradleVersion.version('4.10.3'), 7, 10)
|
||||||
static final TestGradleVersion GRADLE_4_10 = new TestGradleVersion(GradleVersion.version('4.10.3'), 7, 10)
|
static final TestGradleVersion GRADLE_5_X = new TestGradleVersion(GradleVersion.version('5.6.4'), 8, 12)
|
||||||
static final TestGradleVersion GRADLE_5_0 = new TestGradleVersion(GradleVersion.version('5.0'), 8, 11)
|
static final TestGradleVersion GRADLE_6_NO_BUILD_SERVICE = new TestGradleVersion(GradleVersion.version('6.5.1'), 8, 14)
|
||||||
static final TestGradleVersion GRADLE_5_6 = new TestGradleVersion(GradleVersion.version('5.6.4'), 8, 12)
|
static final TestGradleVersion GRADLE_6_X = new TestGradleVersion(GradleVersion.version('6.9.4'), 8, 15)
|
||||||
static final TestGradleVersion GRADLE_6_0 = new TestGradleVersion(GradleVersion.version('6.0.1'), 8, 13)
|
static final TestGradleVersion GRADLE_7_X = new TestGradleVersion(GradleVersion.version('7.6.1'), 8, 19)
|
||||||
static final TestGradleVersion GRADLE_6_7 = new TestGradleVersion(GradleVersion.version('6.7'), 8, 15)
|
static final TestGradleVersion GRADLE_8_X = new TestGradleVersion(GradleVersion.version('8.0.2'), 8, 19)
|
||||||
static final TestGradleVersion GRADLE_7_0 = new TestGradleVersion(GradleVersion.version('7.0.2'), 8, 16)
|
|
||||||
static final TestGradleVersion GRADLE_7_4 = new TestGradleVersion(GradleVersion.version('7.4.2'), 8, 17)
|
|
||||||
|
|
||||||
static final List<TestGradleVersion> ALL_VERSIONS = [
|
static final List<TestGradleVersion> ALL_VERSIONS = [
|
||||||
GRADLE_3_5, // First version where TestKit supports environment variables
|
GRADLE_3_X, // First version where TestKit supports environment variables
|
||||||
GRADLE_4_0,
|
GRADLE_4_X,
|
||||||
GRADLE_4_10,
|
GRADLE_5_X,
|
||||||
GRADLE_5_0,
|
GRADLE_6_NO_BUILD_SERVICE, // Last version without build service support
|
||||||
GRADLE_5_6,
|
GRADLE_6_X,
|
||||||
GRADLE_6_0,
|
GRADLE_7_X,
|
||||||
GRADLE_6_7,
|
GRADLE_8_X,
|
||||||
GRADLE_7_0,
|
|
||||||
GRADLE_7_4,
|
|
||||||
]
|
]
|
||||||
|
|
||||||
static final List<TestGradleVersion> CONFIGURATION_CACHE_VERSIONS =
|
static final List<TestGradleVersion> CONFIGURATION_CACHE_VERSIONS =
|
||||||
[GRADLE_7_0, GRADLE_7_4]
|
[GRADLE_7_X, GRADLE_8_X]
|
||||||
|
|
||||||
static final String PUBLIC_BUILD_SCAN_ID = 'i2wepy2gr7ovw'
|
static final String PUBLIC_BUILD_SCAN_ID = 'i2wepy2gr7ovw'
|
||||||
static final String DEFAULT_SCAN_UPLOAD_TOKEN = 'scan-upload-token'
|
static final String DEFAULT_SCAN_UPLOAD_TOKEN = 'scan-upload-token'
|
||||||
@@ -138,7 +134,7 @@ class BaseInitScriptTest extends Specification {
|
|||||||
} else {
|
} else {
|
||||||
"""
|
"""
|
||||||
plugins {
|
plugins {
|
||||||
id 'com.gradle.enterprise' version '3.4.1'
|
id 'com.gradle.enterprise' version '3.12.6'
|
||||||
}
|
}
|
||||||
gradleEnterprise {
|
gradleEnterprise {
|
||||||
server = '$mockScansServer.address'
|
server = '$mockScansServer.address'
|
||||||
@@ -164,7 +160,7 @@ class BaseInitScriptTest extends Specification {
|
|||||||
} else if (gradleVersion < GradleVersion.version('6.0')) {
|
} else if (gradleVersion < GradleVersion.version('6.0')) {
|
||||||
"""
|
"""
|
||||||
plugins {
|
plugins {
|
||||||
id 'com.gradle.build-scan' version '3.4.1'
|
id 'com.gradle.build-scan' version '3.12.6'
|
||||||
}
|
}
|
||||||
gradleEnterprise {
|
gradleEnterprise {
|
||||||
server = '$mockScansServer.address'
|
server = '$mockScansServer.address'
|
||||||
|
@@ -49,7 +49,7 @@ test('will cleanup unused gradle versions', async () => {
|
|||||||
|
|
||||||
const gradle733 = path.resolve(gradleUserHome, "caches/7.3.3")
|
const gradle733 = path.resolve(gradleUserHome, "caches/7.3.3")
|
||||||
const wrapper733 = path.resolve(gradleUserHome, "wrapper/dists/gradle-7.3.3-bin")
|
const wrapper733 = path.resolve(gradleUserHome, "wrapper/dists/gradle-7.3.3-bin")
|
||||||
const gradleCurrent = path.resolve(gradleUserHome, "caches/7.5.1")
|
const gradleCurrent = path.resolve(gradleUserHome, "caches/7.6.1")
|
||||||
|
|
||||||
expect(fs.existsSync(gradle733)).toBe(true)
|
expect(fs.existsSync(gradle733)).toBe(true)
|
||||||
expect(fs.existsSync(wrapper733)).toBe(true)
|
expect(fs.existsSync(wrapper733)).toBe(true)
|
||||||
|
@@ -1,5 +1,7 @@
|
|||||||
distributionBase=GRADLE_USER_HOME
|
distributionBase=GRADLE_USER_HOME
|
||||||
distributionPath=wrapper/dists
|
distributionPath=wrapper/dists
|
||||||
|
# Deliberately not using the latest Gradle version for cache cleanup testing
|
||||||
distributionUrl=https\://services.gradle.org/distributions/gradle-7.3.3-bin.zip
|
distributionUrl=https\://services.gradle.org/distributions/gradle-7.3.3-bin.zip
|
||||||
zipStoreBase=GRADLE_USER_HOME
|
zipStoreBase=GRADLE_USER_HOME
|
||||||
zipStorePath=wrapper/dists
|
zipStorePath=wrapper/dists
|
||||||
|
|
Reference in New Issue
Block a user