mirror of
https://github.com/gradle/actions.git
synced 2025-11-26 17:09:10 +08:00
Compare commits
24 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
d9c87d481d | ||
|
|
ff865cb801 | ||
|
|
c3acd19a4a | ||
|
|
e5bbd4c742 | ||
|
|
d7cd9fc65c | ||
|
|
6407986e96 | ||
|
|
87bf5ca2ea | ||
|
|
81b4ece56a | ||
|
|
cdbbabd09c | ||
|
|
dad038d88d | ||
|
|
621f3b3f79 | ||
|
|
4022faad7e | ||
|
|
95ef72241e | ||
|
|
169bec5d8b | ||
|
|
b9abb7b195 | ||
|
|
c04155e2ca | ||
|
|
1da1cc97d5 | ||
|
|
c401249391 | ||
|
|
a6a0c7dcef | ||
|
|
3f3913eed0 | ||
|
|
2cd2a6e951 | ||
|
|
dbbdc275be | ||
|
|
ae74429826 | ||
|
|
bdc7162ff9 |
Binary file not shown.
@@ -1,7 +1,7 @@
|
|||||||
distributionBase=GRADLE_USER_HOME
|
distributionBase=GRADLE_USER_HOME
|
||||||
distributionPath=wrapper/dists
|
distributionPath=wrapper/dists
|
||||||
distributionSha256Sum=a4b4158601f8636cdeeab09bd76afb640030bb5b144aafe261a5e8af027dc612
|
distributionSha256Sum=d725d707bfabd4dfdc958c624003b3c80accc03f7037b5122c4b1d0ef15cecab
|
||||||
distributionUrl=https\://services.gradle.org/distributions/gradle-8.8-bin.zip
|
distributionUrl=https\://services.gradle.org/distributions/gradle-8.9-bin.zip
|
||||||
networkTimeout=10000
|
networkTimeout=10000
|
||||||
validateDistributionUrl=true
|
validateDistributionUrl=true
|
||||||
zipStoreBase=GRADLE_USER_HOME
|
zipStoreBase=GRADLE_USER_HOME
|
||||||
|
|||||||
@@ -15,6 +15,8 @@
|
|||||||
# See the License for the specific language governing permissions and
|
# See the License for the specific language governing permissions and
|
||||||
# limitations under the License.
|
# limitations under the License.
|
||||||
#
|
#
|
||||||
|
# SPDX-License-Identifier: Apache-2.0
|
||||||
|
#
|
||||||
|
|
||||||
##############################################################################
|
##############################################################################
|
||||||
#
|
#
|
||||||
@@ -55,7 +57,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/HEAD/subprojects/plugins/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt
|
# https://github.com/gradle/gradle/blob/HEAD/platforms/jvm/plugins-application/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/.
|
||||||
@@ -84,7 +86,8 @@ done
|
|||||||
# shellcheck disable=SC2034
|
# shellcheck disable=SC2034
|
||||||
APP_BASE_NAME=${0##*/}
|
APP_BASE_NAME=${0##*/}
|
||||||
# Discard cd standard output in case $CDPATH is set (https://github.com/gradle/gradle/issues/25036)
|
# Discard cd standard output in case $CDPATH is set (https://github.com/gradle/gradle/issues/25036)
|
||||||
APP_HOME=$( cd "${APP_HOME:-./}" > /dev/null && pwd -P ) || exit
|
APP_HOME=$( cd -P "${APP_HOME:-./}" > /dev/null && printf '%s
|
||||||
|
' "$PWD" ) || exit
|
||||||
|
|
||||||
# Use the maximum available, or set MAX_FD != -1 to use that value.
|
# Use the maximum available, or set MAX_FD != -1 to use that value.
|
||||||
MAX_FD=maximum
|
MAX_FD=maximum
|
||||||
|
|||||||
@@ -13,6 +13,8 @@
|
|||||||
@rem See the License for the specific language governing permissions and
|
@rem See the License for the specific language governing permissions and
|
||||||
@rem limitations under the License.
|
@rem limitations under the License.
|
||||||
@rem
|
@rem
|
||||||
|
@rem SPDX-License-Identifier: Apache-2.0
|
||||||
|
@rem
|
||||||
|
|
||||||
@if "%DEBUG%"=="" @echo off
|
@if "%DEBUG%"=="" @echo off
|
||||||
@rem ##########################################################################
|
@rem ##########################################################################
|
||||||
@@ -43,11 +45,11 @@ set JAVA_EXE=java.exe
|
|||||||
%JAVA_EXE% -version >NUL 2>&1
|
%JAVA_EXE% -version >NUL 2>&1
|
||||||
if %ERRORLEVEL% equ 0 goto execute
|
if %ERRORLEVEL% equ 0 goto execute
|
||||||
|
|
||||||
echo.
|
echo. 1>&2
|
||||||
echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
|
echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. 1>&2
|
||||||
echo.
|
echo. 1>&2
|
||||||
echo Please set the JAVA_HOME variable in your environment to match the
|
echo Please set the JAVA_HOME variable in your environment to match the 1>&2
|
||||||
echo location of your Java installation.
|
echo location of your Java installation. 1>&2
|
||||||
|
|
||||||
goto fail
|
goto fail
|
||||||
|
|
||||||
@@ -57,11 +59,11 @@ set JAVA_EXE=%JAVA_HOME%/bin/java.exe
|
|||||||
|
|
||||||
if exist "%JAVA_EXE%" goto execute
|
if exist "%JAVA_EXE%" goto execute
|
||||||
|
|
||||||
echo.
|
echo. 1>&2
|
||||||
echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME%
|
echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% 1>&2
|
||||||
echo.
|
echo. 1>&2
|
||||||
echo Please set the JAVA_HOME variable in your environment to match the
|
echo Please set the JAVA_HOME variable in your environment to match the 1>&2
|
||||||
echo location of your Java installation.
|
echo location of your Java installation. 1>&2
|
||||||
|
|
||||||
goto fail
|
goto fail
|
||||||
|
|
||||||
|
|||||||
Binary file not shown.
@@ -1,7 +1,7 @@
|
|||||||
distributionBase=GRADLE_USER_HOME
|
distributionBase=GRADLE_USER_HOME
|
||||||
distributionPath=wrapper/dists
|
distributionPath=wrapper/dists
|
||||||
distributionSha256Sum=a4b4158601f8636cdeeab09bd76afb640030bb5b144aafe261a5e8af027dc612
|
distributionSha256Sum=d725d707bfabd4dfdc958c624003b3c80accc03f7037b5122c4b1d0ef15cecab
|
||||||
distributionUrl=https\://services.gradle.org/distributions/gradle-8.8-bin.zip
|
distributionUrl=https\://services.gradle.org/distributions/gradle-8.9-bin.zip
|
||||||
networkTimeout=10000
|
networkTimeout=10000
|
||||||
validateDistributionUrl=true
|
validateDistributionUrl=true
|
||||||
zipStoreBase=GRADLE_USER_HOME
|
zipStoreBase=GRADLE_USER_HOME
|
||||||
|
|||||||
7
.github/workflow-samples/groovy-dsl/gradlew
vendored
7
.github/workflow-samples/groovy-dsl/gradlew
vendored
@@ -15,6 +15,8 @@
|
|||||||
# See the License for the specific language governing permissions and
|
# See the License for the specific language governing permissions and
|
||||||
# limitations under the License.
|
# limitations under the License.
|
||||||
#
|
#
|
||||||
|
# SPDX-License-Identifier: Apache-2.0
|
||||||
|
#
|
||||||
|
|
||||||
##############################################################################
|
##############################################################################
|
||||||
#
|
#
|
||||||
@@ -55,7 +57,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/HEAD/subprojects/plugins/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt
|
# https://github.com/gradle/gradle/blob/HEAD/platforms/jvm/plugins-application/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/.
|
||||||
@@ -84,7 +86,8 @@ done
|
|||||||
# shellcheck disable=SC2034
|
# shellcheck disable=SC2034
|
||||||
APP_BASE_NAME=${0##*/}
|
APP_BASE_NAME=${0##*/}
|
||||||
# Discard cd standard output in case $CDPATH is set (https://github.com/gradle/gradle/issues/25036)
|
# Discard cd standard output in case $CDPATH is set (https://github.com/gradle/gradle/issues/25036)
|
||||||
APP_HOME=$( cd "${APP_HOME:-./}" > /dev/null && pwd -P ) || exit
|
APP_HOME=$( cd -P "${APP_HOME:-./}" > /dev/null && printf '%s
|
||||||
|
' "$PWD" ) || exit
|
||||||
|
|
||||||
# Use the maximum available, or set MAX_FD != -1 to use that value.
|
# Use the maximum available, or set MAX_FD != -1 to use that value.
|
||||||
MAX_FD=maximum
|
MAX_FD=maximum
|
||||||
|
|||||||
22
.github/workflow-samples/groovy-dsl/gradlew.bat
vendored
22
.github/workflow-samples/groovy-dsl/gradlew.bat
vendored
@@ -13,6 +13,8 @@
|
|||||||
@rem See the License for the specific language governing permissions and
|
@rem See the License for the specific language governing permissions and
|
||||||
@rem limitations under the License.
|
@rem limitations under the License.
|
||||||
@rem
|
@rem
|
||||||
|
@rem SPDX-License-Identifier: Apache-2.0
|
||||||
|
@rem
|
||||||
|
|
||||||
@if "%DEBUG%"=="" @echo off
|
@if "%DEBUG%"=="" @echo off
|
||||||
@rem ##########################################################################
|
@rem ##########################################################################
|
||||||
@@ -43,11 +45,11 @@ set JAVA_EXE=java.exe
|
|||||||
%JAVA_EXE% -version >NUL 2>&1
|
%JAVA_EXE% -version >NUL 2>&1
|
||||||
if %ERRORLEVEL% equ 0 goto execute
|
if %ERRORLEVEL% equ 0 goto execute
|
||||||
|
|
||||||
echo.
|
echo. 1>&2
|
||||||
echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
|
echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. 1>&2
|
||||||
echo.
|
echo. 1>&2
|
||||||
echo Please set the JAVA_HOME variable in your environment to match the
|
echo Please set the JAVA_HOME variable in your environment to match the 1>&2
|
||||||
echo location of your Java installation.
|
echo location of your Java installation. 1>&2
|
||||||
|
|
||||||
goto fail
|
goto fail
|
||||||
|
|
||||||
@@ -57,11 +59,11 @@ set JAVA_EXE=%JAVA_HOME%/bin/java.exe
|
|||||||
|
|
||||||
if exist "%JAVA_EXE%" goto execute
|
if exist "%JAVA_EXE%" goto execute
|
||||||
|
|
||||||
echo.
|
echo. 1>&2
|
||||||
echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME%
|
echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% 1>&2
|
||||||
echo.
|
echo. 1>&2
|
||||||
echo Please set the JAVA_HOME variable in your environment to match the
|
echo Please set the JAVA_HOME variable in your environment to match the 1>&2
|
||||||
echo location of your Java installation.
|
echo location of your Java installation. 1>&2
|
||||||
|
|
||||||
goto fail
|
goto fail
|
||||||
|
|
||||||
|
|||||||
Binary file not shown.
@@ -1,7 +1,7 @@
|
|||||||
distributionBase=GRADLE_USER_HOME
|
distributionBase=GRADLE_USER_HOME
|
||||||
distributionPath=wrapper/dists
|
distributionPath=wrapper/dists
|
||||||
distributionSha256Sum=a4b4158601f8636cdeeab09bd76afb640030bb5b144aafe261a5e8af027dc612
|
distributionSha256Sum=d725d707bfabd4dfdc958c624003b3c80accc03f7037b5122c4b1d0ef15cecab
|
||||||
distributionUrl=https\://services.gradle.org/distributions/gradle-8.8-bin.zip
|
distributionUrl=https\://services.gradle.org/distributions/gradle-8.9-bin.zip
|
||||||
networkTimeout=10000
|
networkTimeout=10000
|
||||||
validateDistributionUrl=true
|
validateDistributionUrl=true
|
||||||
zipStoreBase=GRADLE_USER_HOME
|
zipStoreBase=GRADLE_USER_HOME
|
||||||
|
|||||||
@@ -15,6 +15,8 @@
|
|||||||
# See the License for the specific language governing permissions and
|
# See the License for the specific language governing permissions and
|
||||||
# limitations under the License.
|
# limitations under the License.
|
||||||
#
|
#
|
||||||
|
# SPDX-License-Identifier: Apache-2.0
|
||||||
|
#
|
||||||
|
|
||||||
##############################################################################
|
##############################################################################
|
||||||
#
|
#
|
||||||
@@ -55,7 +57,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/HEAD/subprojects/plugins/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt
|
# https://github.com/gradle/gradle/blob/HEAD/platforms/jvm/plugins-application/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/.
|
||||||
@@ -84,7 +86,8 @@ done
|
|||||||
# shellcheck disable=SC2034
|
# shellcheck disable=SC2034
|
||||||
APP_BASE_NAME=${0##*/}
|
APP_BASE_NAME=${0##*/}
|
||||||
# Discard cd standard output in case $CDPATH is set (https://github.com/gradle/gradle/issues/25036)
|
# Discard cd standard output in case $CDPATH is set (https://github.com/gradle/gradle/issues/25036)
|
||||||
APP_HOME=$( cd "${APP_HOME:-./}" > /dev/null && pwd -P ) || exit
|
APP_HOME=$( cd -P "${APP_HOME:-./}" > /dev/null && printf '%s
|
||||||
|
' "$PWD" ) || exit
|
||||||
|
|
||||||
# Use the maximum available, or set MAX_FD != -1 to use that value.
|
# Use the maximum available, or set MAX_FD != -1 to use that value.
|
||||||
MAX_FD=maximum
|
MAX_FD=maximum
|
||||||
|
|||||||
@@ -13,6 +13,8 @@
|
|||||||
@rem See the License for the specific language governing permissions and
|
@rem See the License for the specific language governing permissions and
|
||||||
@rem limitations under the License.
|
@rem limitations under the License.
|
||||||
@rem
|
@rem
|
||||||
|
@rem SPDX-License-Identifier: Apache-2.0
|
||||||
|
@rem
|
||||||
|
|
||||||
@if "%DEBUG%"=="" @echo off
|
@if "%DEBUG%"=="" @echo off
|
||||||
@rem ##########################################################################
|
@rem ##########################################################################
|
||||||
@@ -43,11 +45,11 @@ set JAVA_EXE=java.exe
|
|||||||
%JAVA_EXE% -version >NUL 2>&1
|
%JAVA_EXE% -version >NUL 2>&1
|
||||||
if %ERRORLEVEL% equ 0 goto execute
|
if %ERRORLEVEL% equ 0 goto execute
|
||||||
|
|
||||||
echo.
|
echo. 1>&2
|
||||||
echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
|
echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. 1>&2
|
||||||
echo.
|
echo. 1>&2
|
||||||
echo Please set the JAVA_HOME variable in your environment to match the
|
echo Please set the JAVA_HOME variable in your environment to match the 1>&2
|
||||||
echo location of your Java installation.
|
echo location of your Java installation. 1>&2
|
||||||
|
|
||||||
goto fail
|
goto fail
|
||||||
|
|
||||||
@@ -57,11 +59,11 @@ set JAVA_EXE=%JAVA_HOME%/bin/java.exe
|
|||||||
|
|
||||||
if exist "%JAVA_EXE%" goto execute
|
if exist "%JAVA_EXE%" goto execute
|
||||||
|
|
||||||
echo.
|
echo. 1>&2
|
||||||
echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME%
|
echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% 1>&2
|
||||||
echo.
|
echo. 1>&2
|
||||||
echo Please set the JAVA_HOME variable in your environment to match the
|
echo Please set the JAVA_HOME variable in your environment to match the 1>&2
|
||||||
echo location of your Java installation.
|
echo location of your Java installation. 1>&2
|
||||||
|
|
||||||
goto fail
|
goto fail
|
||||||
|
|
||||||
|
|||||||
@@ -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:33.2.1-jre")
|
implementation("com.google.guava:guava:33.2.1-jre")
|
||||||
|
|
||||||
testImplementation("org.junit.jupiter:junit-jupiter:5.10.2")
|
testImplementation("org.junit.jupiter:junit-jupiter:5.10.3")
|
||||||
}
|
}
|
||||||
|
|
||||||
tasks.test {
|
tasks.test {
|
||||||
|
|||||||
Binary file not shown.
@@ -1,7 +1,7 @@
|
|||||||
distributionBase=GRADLE_USER_HOME
|
distributionBase=GRADLE_USER_HOME
|
||||||
distributionPath=wrapper/dists
|
distributionPath=wrapper/dists
|
||||||
distributionSha256Sum=a4b4158601f8636cdeeab09bd76afb640030bb5b144aafe261a5e8af027dc612
|
distributionSha256Sum=d725d707bfabd4dfdc958c624003b3c80accc03f7037b5122c4b1d0ef15cecab
|
||||||
distributionUrl=https\://services.gradle.org/distributions/gradle-8.8-bin.zip
|
distributionUrl=https\://services.gradle.org/distributions/gradle-8.9-bin.zip
|
||||||
networkTimeout=10000
|
networkTimeout=10000
|
||||||
validateDistributionUrl=true
|
validateDistributionUrl=true
|
||||||
zipStoreBase=GRADLE_USER_HOME
|
zipStoreBase=GRADLE_USER_HOME
|
||||||
|
|||||||
7
.github/workflow-samples/kotlin-dsl/gradlew
vendored
7
.github/workflow-samples/kotlin-dsl/gradlew
vendored
@@ -15,6 +15,8 @@
|
|||||||
# See the License for the specific language governing permissions and
|
# See the License for the specific language governing permissions and
|
||||||
# limitations under the License.
|
# limitations under the License.
|
||||||
#
|
#
|
||||||
|
# SPDX-License-Identifier: Apache-2.0
|
||||||
|
#
|
||||||
|
|
||||||
##############################################################################
|
##############################################################################
|
||||||
#
|
#
|
||||||
@@ -55,7 +57,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/HEAD/subprojects/plugins/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt
|
# https://github.com/gradle/gradle/blob/HEAD/platforms/jvm/plugins-application/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/.
|
||||||
@@ -84,7 +86,8 @@ done
|
|||||||
# shellcheck disable=SC2034
|
# shellcheck disable=SC2034
|
||||||
APP_BASE_NAME=${0##*/}
|
APP_BASE_NAME=${0##*/}
|
||||||
# Discard cd standard output in case $CDPATH is set (https://github.com/gradle/gradle/issues/25036)
|
# Discard cd standard output in case $CDPATH is set (https://github.com/gradle/gradle/issues/25036)
|
||||||
APP_HOME=$( cd "${APP_HOME:-./}" > /dev/null && pwd -P ) || exit
|
APP_HOME=$( cd -P "${APP_HOME:-./}" > /dev/null && printf '%s
|
||||||
|
' "$PWD" ) || exit
|
||||||
|
|
||||||
# Use the maximum available, or set MAX_FD != -1 to use that value.
|
# Use the maximum available, or set MAX_FD != -1 to use that value.
|
||||||
MAX_FD=maximum
|
MAX_FD=maximum
|
||||||
|
|||||||
22
.github/workflow-samples/kotlin-dsl/gradlew.bat
vendored
22
.github/workflow-samples/kotlin-dsl/gradlew.bat
vendored
@@ -13,6 +13,8 @@
|
|||||||
@rem See the License for the specific language governing permissions and
|
@rem See the License for the specific language governing permissions and
|
||||||
@rem limitations under the License.
|
@rem limitations under the License.
|
||||||
@rem
|
@rem
|
||||||
|
@rem SPDX-License-Identifier: Apache-2.0
|
||||||
|
@rem
|
||||||
|
|
||||||
@if "%DEBUG%"=="" @echo off
|
@if "%DEBUG%"=="" @echo off
|
||||||
@rem ##########################################################################
|
@rem ##########################################################################
|
||||||
@@ -43,11 +45,11 @@ set JAVA_EXE=java.exe
|
|||||||
%JAVA_EXE% -version >NUL 2>&1
|
%JAVA_EXE% -version >NUL 2>&1
|
||||||
if %ERRORLEVEL% equ 0 goto execute
|
if %ERRORLEVEL% equ 0 goto execute
|
||||||
|
|
||||||
echo.
|
echo. 1>&2
|
||||||
echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
|
echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. 1>&2
|
||||||
echo.
|
echo. 1>&2
|
||||||
echo Please set the JAVA_HOME variable in your environment to match the
|
echo Please set the JAVA_HOME variable in your environment to match the 1>&2
|
||||||
echo location of your Java installation.
|
echo location of your Java installation. 1>&2
|
||||||
|
|
||||||
goto fail
|
goto fail
|
||||||
|
|
||||||
@@ -57,11 +59,11 @@ set JAVA_EXE=%JAVA_HOME%/bin/java.exe
|
|||||||
|
|
||||||
if exist "%JAVA_EXE%" goto execute
|
if exist "%JAVA_EXE%" goto execute
|
||||||
|
|
||||||
echo.
|
echo. 1>&2
|
||||||
echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME%
|
echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% 1>&2
|
||||||
echo.
|
echo. 1>&2
|
||||||
echo Please set the JAVA_HOME variable in your environment to match the
|
echo Please set the JAVA_HOME variable in your environment to match the 1>&2
|
||||||
echo location of your Java installation.
|
echo location of your Java installation. 1>&2
|
||||||
|
|
||||||
goto fail
|
goto fail
|
||||||
|
|
||||||
|
|||||||
Binary file not shown.
@@ -1,7 +1,7 @@
|
|||||||
distributionBase=GRADLE_USER_HOME
|
distributionBase=GRADLE_USER_HOME
|
||||||
distributionPath=wrapper/dists
|
distributionPath=wrapper/dists
|
||||||
distributionSha256Sum=a4b4158601f8636cdeeab09bd76afb640030bb5b144aafe261a5e8af027dc612
|
distributionSha256Sum=d725d707bfabd4dfdc958c624003b3c80accc03f7037b5122c4b1d0ef15cecab
|
||||||
distributionUrl=https\://services.gradle.org/distributions/gradle-8.8-bin.zip
|
distributionUrl=https\://services.gradle.org/distributions/gradle-8.9-bin.zip
|
||||||
networkTimeout=10000
|
networkTimeout=10000
|
||||||
validateDistributionUrl=true
|
validateDistributionUrl=true
|
||||||
zipStoreBase=GRADLE_USER_HOME
|
zipStoreBase=GRADLE_USER_HOME
|
||||||
|
|||||||
@@ -15,6 +15,8 @@
|
|||||||
# See the License for the specific language governing permissions and
|
# See the License for the specific language governing permissions and
|
||||||
# limitations under the License.
|
# limitations under the License.
|
||||||
#
|
#
|
||||||
|
# SPDX-License-Identifier: Apache-2.0
|
||||||
|
#
|
||||||
|
|
||||||
##############################################################################
|
##############################################################################
|
||||||
#
|
#
|
||||||
@@ -55,7 +57,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/HEAD/subprojects/plugins/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt
|
# https://github.com/gradle/gradle/blob/HEAD/platforms/jvm/plugins-application/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/.
|
||||||
@@ -84,7 +86,8 @@ done
|
|||||||
# shellcheck disable=SC2034
|
# shellcheck disable=SC2034
|
||||||
APP_BASE_NAME=${0##*/}
|
APP_BASE_NAME=${0##*/}
|
||||||
# Discard cd standard output in case $CDPATH is set (https://github.com/gradle/gradle/issues/25036)
|
# Discard cd standard output in case $CDPATH is set (https://github.com/gradle/gradle/issues/25036)
|
||||||
APP_HOME=$( cd "${APP_HOME:-./}" > /dev/null && pwd -P ) || exit
|
APP_HOME=$( cd -P "${APP_HOME:-./}" > /dev/null && printf '%s
|
||||||
|
' "$PWD" ) || exit
|
||||||
|
|
||||||
# Use the maximum available, or set MAX_FD != -1 to use that value.
|
# Use the maximum available, or set MAX_FD != -1 to use that value.
|
||||||
MAX_FD=maximum
|
MAX_FD=maximum
|
||||||
|
|||||||
@@ -13,6 +13,8 @@
|
|||||||
@rem See the License for the specific language governing permissions and
|
@rem See the License for the specific language governing permissions and
|
||||||
@rem limitations under the License.
|
@rem limitations under the License.
|
||||||
@rem
|
@rem
|
||||||
|
@rem SPDX-License-Identifier: Apache-2.0
|
||||||
|
@rem
|
||||||
|
|
||||||
@if "%DEBUG%"=="" @echo off
|
@if "%DEBUG%"=="" @echo off
|
||||||
@rem ##########################################################################
|
@rem ##########################################################################
|
||||||
@@ -43,11 +45,11 @@ set JAVA_EXE=java.exe
|
|||||||
%JAVA_EXE% -version >NUL 2>&1
|
%JAVA_EXE% -version >NUL 2>&1
|
||||||
if %ERRORLEVEL% equ 0 goto execute
|
if %ERRORLEVEL% equ 0 goto execute
|
||||||
|
|
||||||
echo.
|
echo. 1>&2
|
||||||
echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
|
echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. 1>&2
|
||||||
echo.
|
echo. 1>&2
|
||||||
echo Please set the JAVA_HOME variable in your environment to match the
|
echo Please set the JAVA_HOME variable in your environment to match the 1>&2
|
||||||
echo location of your Java installation.
|
echo location of your Java installation. 1>&2
|
||||||
|
|
||||||
goto fail
|
goto fail
|
||||||
|
|
||||||
@@ -57,11 +59,11 @@ set JAVA_EXE=%JAVA_HOME%/bin/java.exe
|
|||||||
|
|
||||||
if exist "%JAVA_EXE%" goto execute
|
if exist "%JAVA_EXE%" goto execute
|
||||||
|
|
||||||
echo.
|
echo. 1>&2
|
||||||
echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME%
|
echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% 1>&2
|
||||||
echo.
|
echo. 1>&2
|
||||||
echo Please set the JAVA_HOME variable in your environment to match the
|
echo Please set the JAVA_HOME variable in your environment to match the 1>&2
|
||||||
echo location of your Java installation.
|
echo location of your Java installation. 1>&2
|
||||||
|
|
||||||
goto fail
|
goto fail
|
||||||
|
|
||||||
|
|||||||
2
.github/workflows/ci-integ-test.yml
vendored
2
.github/workflows/ci-integ-test.yml
vendored
@@ -143,7 +143,7 @@ jobs:
|
|||||||
cache-key-prefix: '${{ needs.determine-suite.outputs.cache-key-prefix }}-'
|
cache-key-prefix: '${{ needs.determine-suite.outputs.cache-key-prefix }}-'
|
||||||
skip-dist: ${{ needs.determine-suite.outputs.suite == 'full' }}
|
skip-dist: ${{ needs.determine-suite.outputs.suite == 'full' }}
|
||||||
secrets:
|
secrets:
|
||||||
DEVELOCITY_ACCESS_KEY: ${{ secrets.GE_SOLUTIONS_ACCESS_TOKEN }}
|
DEVELOCITY_ACCESS_KEY: ${{ secrets.DV_SOLUTIONS_ACCESS_KEY }}
|
||||||
|
|
||||||
provision-gradle-versions:
|
provision-gradle-versions:
|
||||||
needs: [determine-suite, build-distribution]
|
needs: [determine-suite, build-distribution]
|
||||||
|
|||||||
12
.github/workflows/integ-test-cache-cleanup.yml
vendored
12
.github/workflows/integ-test-cache-cleanup.yml
vendored
@@ -35,7 +35,7 @@ jobs:
|
|||||||
cache-read-only: false # For testing, allow writing cache entries on non-default branches
|
cache-read-only: false # For testing, allow writing cache entries on non-default branches
|
||||||
- name: Build with 3.1
|
- name: Build with 3.1
|
||||||
working-directory: sources/test/jest/resources/cache-cleanup
|
working-directory: sources/test/jest/resources/cache-cleanup
|
||||||
run: gradle --no-daemon --build-cache -Dcommons_math3_version="3.1" build
|
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
|
# Second build will use the cache from the first build, but cleanup should remove unused artifacts
|
||||||
assemble-build:
|
assemble-build:
|
||||||
@@ -58,7 +58,7 @@ jobs:
|
|||||||
gradle-home-cache-cleanup: true
|
gradle-home-cache-cleanup: true
|
||||||
- name: Build with 3.1.1
|
- name: Build with 3.1.1
|
||||||
working-directory: sources/test/jest/resources/cache-cleanup
|
working-directory: sources/test/jest/resources/cache-cleanup
|
||||||
run: gradle --no-daemon --build-cache -Dcommons_math3_version="3.1.1" build
|
run: ./gradlew --no-daemon --build-cache -Dcommons_math3_version="3.1.1" build
|
||||||
|
|
||||||
check-clean-cache:
|
check-clean-cache:
|
||||||
needs: assemble-build
|
needs: assemble-build
|
||||||
@@ -78,7 +78,9 @@ jobs:
|
|||||||
with:
|
with:
|
||||||
cache-read-only: true
|
cache-read-only: true
|
||||||
- name: Report Gradle User Home
|
- name: Report Gradle User Home
|
||||||
run: du -hc ~/.gradle/caches/modules-2
|
run: |
|
||||||
|
du -hc ~/.gradle/caches/modules-2
|
||||||
|
du -hc ~/.gradle/wrapper/dists
|
||||||
- name: Verify cleaned cache
|
- name: Verify cleaned cache
|
||||||
shell: bash
|
shell: bash
|
||||||
run: |
|
run: |
|
||||||
@@ -90,3 +92,7 @@ jobs:
|
|||||||
echo "::error ::Should NOT find commons-math3 3.1 in cache"
|
echo "::error ::Should NOT find commons-math3 3.1 in cache"
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
if [ ! -e ~/.gradle/wrapper/dists/gradle-8.0.2-bin ]; then
|
||||||
|
echo "::error ::Should find gradle-8.0.2 in wrapper/dists"
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|||||||
@@ -32,11 +32,11 @@ jobs:
|
|||||||
matrix:
|
matrix:
|
||||||
gradle: [current, 7.6.2, 6.9.4, 5.6.4]
|
gradle: [current, 7.6.2, 6.9.4, 5.6.4]
|
||||||
os: ${{fromJSON(inputs.runner-os)}}
|
os: ${{fromJSON(inputs.runner-os)}}
|
||||||
plugin-version: [3.16.2, 3.17.4]
|
plugin-version: [3.16.2, 3.17.5]
|
||||||
include:
|
include:
|
||||||
- plugin-version: 3.16.2
|
- plugin-version: 3.16.2
|
||||||
accessKeyEnv: GRADLE_ENTERPRISE_ACCESS_KEY
|
accessKeyEnv: GRADLE_ENTERPRISE_ACCESS_KEY
|
||||||
- plugin-version: 3.17.4
|
- plugin-version: 3.17.5
|
||||||
accessKeyEnv: DEVELOCITY_ACCESS_KEY
|
accessKeyEnv: DEVELOCITY_ACCESS_KEY
|
||||||
|
|
||||||
runs-on: ${{ matrix.os }}
|
runs-on: ${{ matrix.os }}
|
||||||
@@ -83,7 +83,7 @@ jobs:
|
|||||||
matrix:
|
matrix:
|
||||||
gradle: [current, 7.6.2, 6.9.4, 5.6.4]
|
gradle: [current, 7.6.2, 6.9.4, 5.6.4]
|
||||||
os: ${{fromJSON(inputs.runner-os)}}
|
os: ${{fromJSON(inputs.runner-os)}}
|
||||||
plugin-version: [3.16.2, 3.17.4]
|
plugin-version: [3.16.2, 3.17.5]
|
||||||
runs-on: ${{ matrix.os }}
|
runs-on: ${{ matrix.os }}
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout sources
|
- name: Checkout sources
|
||||||
@@ -132,7 +132,7 @@ jobs:
|
|||||||
matrix:
|
matrix:
|
||||||
gradle: [ current, 7.6.2, 6.9.4, 5.6.4 ]
|
gradle: [ current, 7.6.2, 6.9.4, 5.6.4 ]
|
||||||
os: ${{fromJSON(inputs.runner-os)}}
|
os: ${{fromJSON(inputs.runner-os)}}
|
||||||
plugin-version: [ 3.16.2, 3.17.4 ]
|
plugin-version: [ 3.16.2, 3.17.5 ]
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout sources
|
- name: Checkout sources
|
||||||
@@ -168,7 +168,7 @@ jobs:
|
|||||||
matrix:
|
matrix:
|
||||||
gradle: [ current, 7.6.2, 6.9.4, 5.6.4 ]
|
gradle: [ current, 7.6.2, 6.9.4, 5.6.4 ]
|
||||||
os: ${{fromJSON(inputs.runner-os)}}
|
os: ${{fromJSON(inputs.runner-os)}}
|
||||||
plugin-version: [ 3.16.2, 3.17.4 ]
|
plugin-version: [ 3.16.2, 3.17.5 ]
|
||||||
runs-on: ${{ matrix.os }}
|
runs-on: ${{ matrix.os }}
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout sources
|
- name: Checkout sources
|
||||||
|
|||||||
@@ -6,21 +6,6 @@ The `build` script in the project root provides a convenient way to perform many
|
|||||||
3. `./build init-scripts` will run the init-script integration 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)
|
4. `./build act <act-commands>` will run `act` after building local changes (see below)
|
||||||
|
|
||||||
## How to merge a Dependabot PR
|
|
||||||
|
|
||||||
The "distribution" for a GitHub Action is checked into the repository itself.
|
|
||||||
In the case of these actions, 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. In the `sources` directory, run `npm install` to download NPM dependencies
|
|
||||||
3. In the `sources` directory, 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
|
|
||||||
|
|
||||||
## Using `act` to run integ-test workflows locally
|
## Using `act` to run integ-test workflows locally
|
||||||
|
|
||||||
It's possible to run GitHub Actions workflows locally with https://nektosact.com/.
|
It's possible to run GitHub Actions workflows locally with https://nektosact.com/.
|
||||||
@@ -36,7 +21,6 @@ Example running a single job:
|
|||||||
`./build act -W .github/workflows/integ-test-caching-config.yml -j cache-disabled-pre-existing-gradle-home`
|
`./build act -W .github/workflows/integ-test-caching-config.yml -j cache-disabled-pre-existing-gradle-home`
|
||||||
|
|
||||||
Known issues:
|
Known issues:
|
||||||
- `integ-test-cache-cleanup.yml` fails because `gradle` is not installed on the runner. Should be fixed by #33.
|
|
||||||
- `integ-test-detect-java-toolchains.yml` fails when running on a `linux/amd64` container, since the expected pre-installed JDKs are not present. Should be fixed by #89.
|
- `integ-test-detect-java-toolchains.yml` fails when running on a `linux/amd64` container, since the expected pre-installed JDKs are not present. Should be fixed by #89.
|
||||||
- `act` is not yet compatible with `actions/upload-artifact@v4` (or related toolkit functions)
|
- `act` is not yet compatible with `actions/upload-artifact@v4` (or related toolkit functions)
|
||||||
- See https://github.com/nektos/act/pull/2224
|
- See https://github.com/nektos/act/pull/2224
|
||||||
@@ -46,4 +30,4 @@ Tips:
|
|||||||
- Add the following lines to `~/.actrc`:
|
- Add the following lines to `~/.actrc`:
|
||||||
- `--container-daemon-socket -` : Prevents "error while creating mount source path", and yes that's a solitary dash at the end
|
- `--container-daemon-socket -` : Prevents "error while creating mount source path", and yes that's a solitary dash at the end
|
||||||
- `--matrix os:ubuntu-latest` : Avoids a lot of logging about unsupported runners being skipped
|
- `--matrix os:ubuntu-latest` : Avoids a lot of logging about unsupported runners being skipped
|
||||||
- Runners don't have `java` installed by default, so all workflows that run Gradle require a `setup-java` step.
|
- Runners don't have `java` installed by default, so all workflows that run Gradle require a `setup-java` step.
|
||||||
|
|||||||
192
dist/dependency-submission/main/index.js
vendored
192
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
2924
dist/dependency-submission/post/index.js
vendored
2924
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
192
dist/setup-gradle/main/index.js
vendored
192
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
3048
dist/setup-gradle/post/index.js
vendored
3048
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
2
dist/wrapper-validation/main/index.js
vendored
2
dist/wrapper-validation/main/index.js
vendored
File diff suppressed because one or more lines are too long
@@ -13,7 +13,7 @@ The generated dependency graph includes all of the dependencies in your build, a
|
|||||||
for vulnerable dependencies, as well as to populate the
|
for vulnerable dependencies, as well as to populate the
|
||||||
[Dependency Graph insights view](https://docs.github.com/en/code-security/supply-chain-security/understanding-your-software-supply-chain/exploring-the-dependencies-of-a-repository#viewing-the-dependency-graph).
|
[Dependency Graph insights view](https://docs.github.com/en/code-security/supply-chain-security/understanding-your-software-supply-chain/exploring-the-dependencies-of-a-repository#viewing-the-dependency-graph).
|
||||||
|
|
||||||
If your confused by the behaviour you're seeing or have specific questions, please check out [the FAQ](dependency-submission-faq.md) before raising an issue.
|
If you're confused by the behaviour you're seeing or have specific questions, please check out [the FAQ](dependency-submission-faq.md) before raising an issue.
|
||||||
|
|
||||||
## General usage
|
## General usage
|
||||||
|
|
||||||
|
|||||||
@@ -101,7 +101,7 @@ The exact syntax depends on whether or not your project is configured with the [
|
|||||||
- name: Setup Gradle for a non-wrapper project
|
- name: Setup Gradle for a non-wrapper project
|
||||||
uses: gradle/actions/setup-gradle@v3
|
uses: gradle/actions/setup-gradle@v3
|
||||||
with:
|
with:
|
||||||
gradle-version: 8.8
|
gradle-version: 8.9
|
||||||
|
|
||||||
- name: Assemble the project
|
- name: Assemble the project
|
||||||
run: gradle assemble
|
run: gradle assemble
|
||||||
|
|||||||
@@ -218,7 +218,7 @@ Using either of these mechanisms may interfere with the caching provided by this
|
|||||||
|
|
||||||
The GitHub Actions cache has some properties that present problems for efficient caching of the Gradle User Home.
|
The GitHub Actions cache has some properties that present problems for efficient caching of the Gradle User Home.
|
||||||
- Immutable entries: once a cache entry is written for a key, it cannot be overwritten or changed.
|
- Immutable entries: once a cache entry is written for a key, it cannot be overwritten or changed.
|
||||||
- Branch scope: cache entries written for a Git branch are not visible from actions running against different branches. Entries written for the default branch are visible to all. https://docs.github.com/en/actions/using-workflows/caching-dependencies-to-speed-up-workflows#restrictions-for-accessing-a-cache
|
- Branch scope: cache entries written for a Git branch are not visible from actions running against different branches or tags. Entries written for the default branch are visible to all. https://docs.github.com/en/actions/using-workflows/caching-dependencies-to-speed-up-workflows#restrictions-for-accessing-a-cache
|
||||||
- Restore keys: if no exact match is found, a set of partial keys can be provided that will match by cache key prefix. https://docs.github.com/en/actions/using-workflows/caching-dependencies-to-speed-up-workflows#matching-a-cache-key
|
- Restore keys: if no exact match is found, a set of partial keys can be provided that will match by cache key prefix. https://docs.github.com/en/actions/using-workflows/caching-dependencies-to-speed-up-workflows#matching-a-cache-key
|
||||||
|
|
||||||
Each of these properties has influenced the design and implementation of the caching in `setup-gradle`, as described below.
|
Each of these properties has influenced the design and implementation of the caching in `setup-gradle`, as described below.
|
||||||
@@ -316,8 +316,8 @@ Some techniques can be used to avoid/mitigate this issue:
|
|||||||
|
|
||||||
### Select which branches should write to the cache
|
### Select which branches should write to the cache
|
||||||
|
|
||||||
GitHub cache entries are not shared between builds on different branches.
|
GitHub cache entries are not shared between builds on different branches or tags.
|
||||||
Workflow runs can restore caches created in either the current branch or the default branch (usually main).
|
Workflow runs can _only_ restore caches created in either the same branch or the default branch (usually `main`).
|
||||||
This means that each branch will have its own Gradle User Home cache scope, and will not benefit from cache entries written for other (non-default) branches.
|
This means that each branch will have its own Gradle User Home cache scope, and will not benefit from cache entries written for other (non-default) branches.
|
||||||
|
|
||||||
By default, The `setup-gradle` action will only _write_ to the cache for builds run on the default (`master`/`main`) branch.
|
By default, The `setup-gradle` action will only _write_ to the cache for builds run on the default (`master`/`main`) branch.
|
||||||
|
|||||||
@@ -1,3 +1,3 @@
|
|||||||
# Configuration file for asdf version manager
|
# Configuration file for asdf version manager
|
||||||
nodejs 20.10.0
|
nodejs 20.10.0
|
||||||
gradle 8.8
|
gradle 8.9
|
||||||
|
|||||||
@@ -1,8 +1,7 @@
|
|||||||
import * as core from '@actions/core'
|
import * as core from '@actions/core'
|
||||||
import * as exec from '@actions/exec'
|
|
||||||
import * as glob from '@actions/glob'
|
|
||||||
import fs from 'fs'
|
import fs from 'fs'
|
||||||
import path from 'path'
|
import path from 'path'
|
||||||
|
import {provisionAndMaybeExecute} from '../execution/gradle'
|
||||||
|
|
||||||
export class CacheCleaner {
|
export class CacheCleaner {
|
||||||
private readonly gradleUserHome: string
|
private readonly gradleUserHome: string
|
||||||
@@ -13,25 +12,20 @@ export class CacheCleaner {
|
|||||||
this.tmpDir = tmpDir
|
this.tmpDir = tmpDir
|
||||||
}
|
}
|
||||||
|
|
||||||
async prepare(): Promise<void> {
|
async prepare(): Promise<string> {
|
||||||
// Reset the file-access journal so that files appear not to have been used recently
|
// Save the current timestamp
|
||||||
fs.rmSync(path.resolve(this.gradleUserHome, 'caches/journal-1'), {recursive: true, force: true})
|
const timestamp = Date.now().toString()
|
||||||
fs.mkdirSync(path.resolve(this.gradleUserHome, 'caches/journal-1'), {recursive: true})
|
core.saveState('clean-timestamp', timestamp)
|
||||||
fs.writeFileSync(
|
return timestamp
|
||||||
path.resolve(this.gradleUserHome, 'caches/journal-1/file-access.properties'),
|
|
||||||
'inceptionTimestamp=0'
|
|
||||||
)
|
|
||||||
|
|
||||||
// Set the modification time of all files to the past: this timestamp is used when there is no matching entry in the journal
|
|
||||||
await this.ageAllFiles()
|
|
||||||
|
|
||||||
// Touch all 'gc' files so that cache cleanup won't run immediately.
|
|
||||||
await this.touchAllFiles('gc.properties')
|
|
||||||
}
|
}
|
||||||
|
|
||||||
async forceCleanup(): Promise<void> {
|
async forceCleanup(): Promise<void> {
|
||||||
// Age all 'gc' files so that cache cleanup will run immediately.
|
const cleanTimestamp = core.getState('clean-timestamp')
|
||||||
await this.ageAllFiles('gc.properties')
|
await this.forceCleanupFilesOlderThan(cleanTimestamp)
|
||||||
|
}
|
||||||
|
|
||||||
|
async forceCleanupFilesOlderThan(cleanTimestamp: string): Promise<void> {
|
||||||
|
core.info(`Cleaning up caches before ${cleanTimestamp}`)
|
||||||
|
|
||||||
// Run a dummy Gradle build to trigger cache cleanup
|
// Run a dummy Gradle build to trigger cache cleanup
|
||||||
const cleanupProjectDir = path.resolve(this.tmpDir, 'dummy-cleanup-project')
|
const cleanupProjectDir = path.resolve(this.tmpDir, 'dummy-cleanup-project')
|
||||||
@@ -40,30 +34,37 @@ export class CacheCleaner {
|
|||||||
path.resolve(cleanupProjectDir, 'settings.gradle'),
|
path.resolve(cleanupProjectDir, 'settings.gradle'),
|
||||||
'rootProject.name = "dummy-cleanup-project"'
|
'rootProject.name = "dummy-cleanup-project"'
|
||||||
)
|
)
|
||||||
|
fs.writeFileSync(
|
||||||
|
path.resolve(cleanupProjectDir, 'init.gradle'),
|
||||||
|
`
|
||||||
|
beforeSettings { settings ->
|
||||||
|
def cleanupTime = ${cleanTimestamp}
|
||||||
|
|
||||||
|
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)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
`
|
||||||
|
)
|
||||||
fs.writeFileSync(path.resolve(cleanupProjectDir, 'build.gradle'), 'task("noop") {}')
|
fs.writeFileSync(path.resolve(cleanupProjectDir, 'build.gradle'), 'task("noop") {}')
|
||||||
|
|
||||||
const gradleCommand = `gradle -g ${this.gradleUserHome} --no-daemon --build-cache --no-scan --quiet -DGITHUB_DEPENDENCY_GRAPH_ENABLED=false noop`
|
await provisionAndMaybeExecute('current', cleanupProjectDir, [
|
||||||
await exec.exec(gradleCommand, [], {
|
'-g',
|
||||||
cwd: cleanupProjectDir
|
this.gradleUserHome,
|
||||||
})
|
'-I',
|
||||||
}
|
'init.gradle',
|
||||||
|
'--info',
|
||||||
private async ageAllFiles(fileName = '*'): Promise<void> {
|
'--no-daemon',
|
||||||
core.debug(`Aging all files in Gradle User Home with name ${fileName}`)
|
'--no-scan',
|
||||||
await this.setUtimes(`${this.gradleUserHome}/**/${fileName}`, new Date(0))
|
'--build-cache',
|
||||||
}
|
'-DGITHUB_DEPENDENCY_GRAPH_ENABLED=false',
|
||||||
|
'noop'
|
||||||
private async touchAllFiles(fileName = '*'): Promise<void> {
|
])
|
||||||
core.debug(`Touching all files in Gradle User Home with name ${fileName}`)
|
|
||||||
await this.setUtimes(`${this.gradleUserHome}/**/${fileName}`, new Date())
|
|
||||||
}
|
|
||||||
|
|
||||||
private async setUtimes(pattern: string, timestamp: Date): Promise<void> {
|
|
||||||
const globber = await glob.create(pattern, {
|
|
||||||
implicitDescendants: false
|
|
||||||
})
|
|
||||||
for await (const file of globber.globGenerator()) {
|
|
||||||
fs.utimesSync(file, timestamp, timestamp)
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -60,44 +60,19 @@ export async function complete(config: DependencyGraphConfig): Promise<void> {
|
|||||||
return
|
return
|
||||||
case DependencyGraphOption.GenerateAndSubmit:
|
case DependencyGraphOption.GenerateAndSubmit:
|
||||||
case DependencyGraphOption.Clear: // Submit the empty dependency graph
|
case DependencyGraphOption.Clear: // Submit the empty dependency graph
|
||||||
await submitDependencyGraphs(await findDependencyGraphFiles())
|
await findAndSubmitDependencyGraphs(config)
|
||||||
return
|
return
|
||||||
case DependencyGraphOption.GenerateAndUpload:
|
case DependencyGraphOption.GenerateAndUpload:
|
||||||
await uploadDependencyGraphs(await findDependencyGraphFiles(), config)
|
await findAndUploadDependencyGraphs(config)
|
||||||
}
|
}
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
warnOrFail(config, option, e)
|
warnOrFail(config, option, e)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
async function uploadDependencyGraphs(dependencyGraphFiles: string[], config: DependencyGraphConfig): Promise<void> {
|
|
||||||
if (dependencyGraphFiles.length === 0) {
|
|
||||||
core.info('No dependency graph files found to upload.')
|
|
||||||
return
|
|
||||||
}
|
|
||||||
|
|
||||||
if (isRunningInActEnvironment()) {
|
|
||||||
core.info('Dependency graph upload not supported in the ACT environment.')
|
|
||||||
core.info(`Would upload: ${dependencyGraphFiles.join(', ')}`)
|
|
||||||
return
|
|
||||||
}
|
|
||||||
|
|
||||||
const workspaceDirectory = getWorkspaceDirectory()
|
|
||||||
|
|
||||||
const artifactClient = new DefaultArtifactClient()
|
|
||||||
for (const dependencyGraphFile of dependencyGraphFiles) {
|
|
||||||
const relativePath = getRelativePathFromWorkspace(dependencyGraphFile)
|
|
||||||
core.info(`Uploading dependency graph file: ${relativePath}`)
|
|
||||||
const artifactName = `${DEPENDENCY_GRAPH_PREFIX}${path.basename(dependencyGraphFile)}`
|
|
||||||
await artifactClient.uploadArtifact(artifactName, [dependencyGraphFile], workspaceDirectory, {
|
|
||||||
retentionDays: config.getArtifactRetentionDays()
|
|
||||||
})
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
async function downloadAndSubmitDependencyGraphs(config: DependencyGraphConfig): Promise<void> {
|
async function downloadAndSubmitDependencyGraphs(config: DependencyGraphConfig): Promise<void> {
|
||||||
if (isRunningInActEnvironment()) {
|
if (isRunningInActEnvironment()) {
|
||||||
core.info('Dependency graph download and submit not supported in the ACT environment.')
|
core.info('Dependency graph not supported in the ACT environment.')
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -108,53 +83,32 @@ async function downloadAndSubmitDependencyGraphs(config: DependencyGraphConfig):
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
async function submitDependencyGraphs(dependencyGraphFiles: string[]): Promise<void> {
|
async function findAndSubmitDependencyGraphs(config: DependencyGraphConfig): Promise<void> {
|
||||||
if (dependencyGraphFiles.length === 0) {
|
|
||||||
core.info('No dependency graph files found to submit.')
|
|
||||||
return
|
|
||||||
}
|
|
||||||
|
|
||||||
if (isRunningInActEnvironment()) {
|
if (isRunningInActEnvironment()) {
|
||||||
core.info('Dependency graph submit not supported in the ACT environment.')
|
core.info('Dependency graph not supported in the ACT environment.')
|
||||||
core.info(`Would submit: ${dependencyGraphFiles.join(', ')}`)
|
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
for (const dependencyGraphFile of dependencyGraphFiles) {
|
const dependencyGraphFiles = await findDependencyGraphFiles()
|
||||||
|
try {
|
||||||
|
await submitDependencyGraphs(dependencyGraphFiles)
|
||||||
|
} catch (e) {
|
||||||
try {
|
try {
|
||||||
await submitDependencyGraphFile(dependencyGraphFile)
|
await uploadDependencyGraphs(dependencyGraphFiles, config)
|
||||||
} catch (error) {
|
} catch (uploadError) {
|
||||||
if (error instanceof RequestError) {
|
core.info(String(uploadError))
|
||||||
error.message = translateErrorMessage(dependencyGraphFile, error)
|
|
||||||
}
|
|
||||||
throw error
|
|
||||||
}
|
}
|
||||||
|
throw e
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
function translateErrorMessage(jsonFile: string, error: RequestError): string {
|
async function findAndUploadDependencyGraphs(config: DependencyGraphConfig): Promise<void> {
|
||||||
const relativeJsonFile = getRelativePathFromWorkspace(jsonFile)
|
if (isRunningInActEnvironment()) {
|
||||||
const mainWarning = `Dependency submission failed for ${relativeJsonFile}.\n${error.message}`
|
core.info('Dependency graph not supported in the ACT environment.')
|
||||||
if (error.message === 'Resource not accessible by integration') {
|
return
|
||||||
return `${mainWarning}
|
|
||||||
Please ensure that the 'contents: write' permission is available for the workflow job.
|
|
||||||
Note that this permission is never available for a 'pull_request' trigger from a repository fork.
|
|
||||||
`
|
|
||||||
}
|
}
|
||||||
return mainWarning
|
|
||||||
}
|
|
||||||
|
|
||||||
async function submitDependencyGraphFile(jsonFile: string): Promise<void> {
|
await uploadDependencyGraphs(await findDependencyGraphFiles(), config)
|
||||||
const octokit = getOctokit()
|
|
||||||
const jsonContent = fs.readFileSync(jsonFile, 'utf8')
|
|
||||||
|
|
||||||
const jsonObject = JSON.parse(jsonContent)
|
|
||||||
jsonObject.owner = github.context.repo.owner
|
|
||||||
jsonObject.repo = github.context.repo.repo
|
|
||||||
const response = await octokit.request('POST /repos/{owner}/{repo}/dependency-graph/snapshots', jsonObject)
|
|
||||||
|
|
||||||
const relativeJsonFile = getRelativePathFromWorkspace(jsonFile)
|
|
||||||
core.notice(`Submitted ${relativeJsonFile}: ${response.data.message}`)
|
|
||||||
}
|
}
|
||||||
|
|
||||||
async function downloadDependencyGraphs(): Promise<string[]> {
|
async function downloadDependencyGraphs(): Promise<string[]> {
|
||||||
@@ -195,6 +149,67 @@ async function findDependencyGraphFiles(): Promise<string[]> {
|
|||||||
return unprocessedFiles
|
return unprocessedFiles
|
||||||
}
|
}
|
||||||
|
|
||||||
|
async function uploadDependencyGraphs(dependencyGraphFiles: string[], config: DependencyGraphConfig): Promise<void> {
|
||||||
|
if (dependencyGraphFiles.length === 0) {
|
||||||
|
core.info('No dependency graph files found to upload.')
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
const workspaceDirectory = getWorkspaceDirectory()
|
||||||
|
|
||||||
|
const artifactClient = new DefaultArtifactClient()
|
||||||
|
for (const dependencyGraphFile of dependencyGraphFiles) {
|
||||||
|
const relativePath = getRelativePathFromWorkspace(dependencyGraphFile)
|
||||||
|
core.info(`Uploading dependency graph file: ${relativePath}`)
|
||||||
|
const artifactName = `${DEPENDENCY_GRAPH_PREFIX}${path.basename(dependencyGraphFile)}`
|
||||||
|
await artifactClient.uploadArtifact(artifactName, [dependencyGraphFile], workspaceDirectory, {
|
||||||
|
retentionDays: config.getArtifactRetentionDays()
|
||||||
|
})
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
async function submitDependencyGraphs(dependencyGraphFiles: string[]): Promise<void> {
|
||||||
|
if (dependencyGraphFiles.length === 0) {
|
||||||
|
core.info('No dependency graph files found to submit.')
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
for (const dependencyGraphFile of dependencyGraphFiles) {
|
||||||
|
try {
|
||||||
|
await submitDependencyGraphFile(dependencyGraphFile)
|
||||||
|
} catch (error) {
|
||||||
|
if (error instanceof RequestError) {
|
||||||
|
error.message = translateErrorMessage(dependencyGraphFile, error)
|
||||||
|
}
|
||||||
|
throw error
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
function translateErrorMessage(jsonFile: string, error: RequestError): string {
|
||||||
|
const relativeJsonFile = getRelativePathFromWorkspace(jsonFile)
|
||||||
|
const mainWarning = `Dependency submission failed for ${relativeJsonFile}.\n${error.message}`
|
||||||
|
if (error.message === 'Resource not accessible by integration') {
|
||||||
|
return `${mainWarning}
|
||||||
|
Please ensure that the 'contents: write' permission is available for the workflow job.
|
||||||
|
Note that this permission is never available for a 'pull_request' trigger from a repository fork.
|
||||||
|
`
|
||||||
|
}
|
||||||
|
return mainWarning
|
||||||
|
}
|
||||||
|
|
||||||
|
async function submitDependencyGraphFile(jsonFile: string): Promise<void> {
|
||||||
|
const octokit = getOctokit()
|
||||||
|
const jsonContent = fs.readFileSync(jsonFile, 'utf8')
|
||||||
|
|
||||||
|
const jsonObject = JSON.parse(jsonContent)
|
||||||
|
jsonObject.owner = github.context.repo.owner
|
||||||
|
jsonObject.repo = github.context.repo.repo
|
||||||
|
const response = await octokit.request('POST /repos/{owner}/{repo}/dependency-graph/snapshots', jsonObject)
|
||||||
|
|
||||||
|
const relativeJsonFile = getRelativePathFromWorkspace(jsonFile)
|
||||||
|
core.notice(`Submitted ${relativeJsonFile}: ${response.data.message}`)
|
||||||
|
}
|
||||||
function getReportDirectory(): string {
|
function getReportDirectory(): string {
|
||||||
return process.env.DEPENDENCY_GRAPH_REPORT_DIR!
|
return process.env.DEPENDENCY_GRAPH_REPORT_DIR!
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -23,7 +23,7 @@ export async function setup(config: BuildScanConfig): Promise<void> {
|
|||||||
maybeExportVariableNotEmpty('GRADLE_PLUGIN_REPOSITORY_USERNAME', config.getGradlePluginRepositoryUsername())
|
maybeExportVariableNotEmpty('GRADLE_PLUGIN_REPOSITORY_USERNAME', config.getGradlePluginRepositoryUsername())
|
||||||
maybeExportVariableNotEmpty('GRADLE_PLUGIN_REPOSITORY_PASSWORD', config.getGradlePluginRepositoryPassword())
|
maybeExportVariableNotEmpty('GRADLE_PLUGIN_REPOSITORY_PASSWORD', config.getGradlePluginRepositoryPassword())
|
||||||
|
|
||||||
setupToken(config.getDevelocityAccessKey(), config.getDevelocityTokenExpiry())
|
return setupToken(config.getDevelocityAccessKey(), config.getDevelocityTokenExpiry())
|
||||||
}
|
}
|
||||||
|
|
||||||
function maybeExportVariable(variableName: string, value: unknown): void {
|
function maybeExportVariable(variableName: string, value: unknown): void {
|
||||||
|
|||||||
@@ -6,7 +6,7 @@ buildscript {
|
|||||||
def pluginRepositoryUrl = getInputParam('gradle.plugin-repository.url') ?: 'https://plugins.gradle.org/m2'
|
def pluginRepositoryUrl = getInputParam('gradle.plugin-repository.url') ?: 'https://plugins.gradle.org/m2'
|
||||||
def pluginRepositoryUsername = getInputParam('gradle.plugin-repository.username')
|
def pluginRepositoryUsername = getInputParam('gradle.plugin-repository.username')
|
||||||
def pluginRepositoryPassword = getInputParam('gradle.plugin-repository.password')
|
def pluginRepositoryPassword = getInputParam('gradle.plugin-repository.password')
|
||||||
def dependencyGraphPluginVersion = getInputParam('dependency-graph-plugin.version') ?: '1.3.0'
|
def dependencyGraphPluginVersion = getInputParam('dependency-graph-plugin.version') ?: '1.3.1'
|
||||||
|
|
||||||
logger.lifecycle("Resolving dependency graph plugin ${dependencyGraphPluginVersion} from plugin repository: ${pluginRepositoryUrl}")
|
logger.lifecycle("Resolving dependency graph plugin ${dependencyGraphPluginVersion} from plugin repository: ${pluginRepositoryUrl}")
|
||||||
repositories {
|
repositories {
|
||||||
|
|||||||
@@ -1,4 +1,16 @@
|
|||||||
[
|
[
|
||||||
|
{
|
||||||
|
"version": "8.9",
|
||||||
|
"checksum": "498495120a03b9a6ab5d155f5de3c8f0d986a449153702fb80fc80e134484f17"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"version": "8.9-rc-2",
|
||||||
|
"checksum": "498495120a03b9a6ab5d155f5de3c8f0d986a449153702fb80fc80e134484f17"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"version": "8.9-rc-1",
|
||||||
|
"checksum": "498495120a03b9a6ab5d155f5de3c8f0d986a449153702fb80fc80e134484f17"
|
||||||
|
},
|
||||||
{
|
{
|
||||||
"version": "8.8",
|
"version": "8.8",
|
||||||
"checksum": "cb0da6751c2b753a16ac168bb354870ebb1e162e9083f116729cec9c781156b8"
|
"checksum": "cb0da6751c2b753a16ac168bb354870ebb1e162e9083f116729cec9c781156b8"
|
||||||
|
|||||||
@@ -20,7 +20,7 @@ dependencies {
|
|||||||
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.17.1'
|
testImplementation 'com.fasterxml.jackson.dataformat:jackson-dataformat-smile:2.17.2'
|
||||||
}
|
}
|
||||||
|
|
||||||
test {
|
test {
|
||||||
|
|||||||
Binary file not shown.
@@ -1,7 +1,7 @@
|
|||||||
distributionBase=GRADLE_USER_HOME
|
distributionBase=GRADLE_USER_HOME
|
||||||
distributionPath=wrapper/dists
|
distributionPath=wrapper/dists
|
||||||
distributionSha256Sum=a4b4158601f8636cdeeab09bd76afb640030bb5b144aafe261a5e8af027dc612
|
distributionSha256Sum=d725d707bfabd4dfdc958c624003b3c80accc03f7037b5122c4b1d0ef15cecab
|
||||||
distributionUrl=https\://services.gradle.org/distributions/gradle-8.8-bin.zip
|
distributionUrl=https\://services.gradle.org/distributions/gradle-8.9-bin.zip
|
||||||
networkTimeout=10000
|
networkTimeout=10000
|
||||||
validateDistributionUrl=true
|
validateDistributionUrl=true
|
||||||
zipStoreBase=GRADLE_USER_HOME
|
zipStoreBase=GRADLE_USER_HOME
|
||||||
|
|||||||
7
sources/test/init-scripts/gradlew
vendored
7
sources/test/init-scripts/gradlew
vendored
@@ -15,6 +15,8 @@
|
|||||||
# See the License for the specific language governing permissions and
|
# See the License for the specific language governing permissions and
|
||||||
# limitations under the License.
|
# limitations under the License.
|
||||||
#
|
#
|
||||||
|
# SPDX-License-Identifier: Apache-2.0
|
||||||
|
#
|
||||||
|
|
||||||
##############################################################################
|
##############################################################################
|
||||||
#
|
#
|
||||||
@@ -55,7 +57,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/HEAD/subprojects/plugins/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt
|
# https://github.com/gradle/gradle/blob/HEAD/platforms/jvm/plugins-application/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/.
|
||||||
@@ -84,7 +86,8 @@ done
|
|||||||
# shellcheck disable=SC2034
|
# shellcheck disable=SC2034
|
||||||
APP_BASE_NAME=${0##*/}
|
APP_BASE_NAME=${0##*/}
|
||||||
# Discard cd standard output in case $CDPATH is set (https://github.com/gradle/gradle/issues/25036)
|
# Discard cd standard output in case $CDPATH is set (https://github.com/gradle/gradle/issues/25036)
|
||||||
APP_HOME=$( cd "${APP_HOME:-./}" > /dev/null && pwd -P ) || exit
|
APP_HOME=$( cd -P "${APP_HOME:-./}" > /dev/null && printf '%s
|
||||||
|
' "$PWD" ) || exit
|
||||||
|
|
||||||
# Use the maximum available, or set MAX_FD != -1 to use that value.
|
# Use the maximum available, or set MAX_FD != -1 to use that value.
|
||||||
MAX_FD=maximum
|
MAX_FD=maximum
|
||||||
|
|||||||
2
sources/test/init-scripts/gradlew.bat
vendored
2
sources/test/init-scripts/gradlew.bat
vendored
@@ -13,6 +13,8 @@
|
|||||||
@rem See the License for the specific language governing permissions and
|
@rem See the License for the specific language governing permissions and
|
||||||
@rem limitations under the License.
|
@rem limitations under the License.
|
||||||
@rem
|
@rem
|
||||||
|
@rem SPDX-License-Identifier: Apache-2.0
|
||||||
|
@rem
|
||||||
|
|
||||||
@if "%DEBUG%"=="" @echo off
|
@if "%DEBUG%"=="" @echo off
|
||||||
@rem ##########################################################################
|
@rem ##########################################################################
|
||||||
|
|||||||
@@ -27,7 +27,7 @@ class BaseInitScriptTest extends Specification {
|
|||||||
static final TestGradleVersion GRADLE_7_1 = new TestGradleVersion(GradleVersion.version('7.6.2'), 8, 19)
|
static final TestGradleVersion GRADLE_7_1 = new TestGradleVersion(GradleVersion.version('7.6.2'), 8, 19)
|
||||||
static final TestGradleVersion GRADLE_7_X = new TestGradleVersion(GradleVersion.version('7.6.2'), 8, 19)
|
static final TestGradleVersion GRADLE_7_X = new TestGradleVersion(GradleVersion.version('7.6.2'), 8, 19)
|
||||||
static final TestGradleVersion GRADLE_8_0 = new TestGradleVersion(GradleVersion.version('8.0.2'), 8, 19)
|
static final TestGradleVersion GRADLE_8_0 = new TestGradleVersion(GradleVersion.version('8.0.2'), 8, 19)
|
||||||
static final TestGradleVersion GRADLE_8_X = new TestGradleVersion(GradleVersion.version('8.5'), 8, 19)
|
static final TestGradleVersion GRADLE_8_X = new TestGradleVersion(GradleVersion.version('8.9'), 8, 22)
|
||||||
|
|
||||||
static final List<TestGradleVersion> ALL_VERSIONS = [
|
static final List<TestGradleVersion> ALL_VERSIONS = [
|
||||||
GRADLE_3_X, // First version where TestKit supports environment variables
|
GRADLE_3_X, // First version where TestKit supports environment variables
|
||||||
|
|||||||
@@ -146,7 +146,7 @@ class TestDependencyGraph extends BaseInitScriptTest {
|
|||||||
|
|
||||||
then:
|
then:
|
||||||
assert reportFile.exists()
|
assert reportFile.exists()
|
||||||
assert result.output.contains("Resolving dependency graph plugin 1.3.0 from plugin repository: https://plugins.grdev.net/m2")
|
assert result.output.find("Resolving dependency graph plugin [\\d\\.]+ from plugin repository: https://plugins.grdev.net/m2")
|
||||||
|
|
||||||
where:
|
where:
|
||||||
testGradleVersion << DEPENDENCY_GRAPH_VERSIONS
|
testGradleVersion << DEPENDENCY_GRAPH_VERSIONS
|
||||||
@@ -170,7 +170,7 @@ class TestDependencyGraph extends BaseInitScriptTest {
|
|||||||
|
|
||||||
then:
|
then:
|
||||||
assert reportFile.exists()
|
assert reportFile.exists()
|
||||||
assert result.output.contains("Resolving dependency graph plugin 1.3.0 from plugin repository: https://plugins.grdev.net/m2")
|
assert result.output.find("Resolving dependency graph plugin [\\d\\.]+ from plugin repository: https://plugins.grdev.net/m2")
|
||||||
assert result.output.contains("Applying credentials for plugin repository: https://plugins.grdev.net/m2")
|
assert result.output.contains("Applying credentials for plugin repository: https://plugins.grdev.net/m2")
|
||||||
|
|
||||||
where:
|
where:
|
||||||
|
|||||||
@@ -1,5 +1,6 @@
|
|||||||
import * as exec from '@actions/exec'
|
import * as exec from '@actions/exec'
|
||||||
import * as core from '@actions/core'
|
import * as core from '@actions/core'
|
||||||
|
import * as glob from '@actions/glob'
|
||||||
import fs from 'fs'
|
import fs from 'fs'
|
||||||
import path from 'path'
|
import path from 'path'
|
||||||
import {CacheCleaner} from '../../src/caching/cache-cleaner'
|
import {CacheCleaner} from '../../src/caching/cache-cleaner'
|
||||||
@@ -14,7 +15,7 @@ test('will cleanup unused dependency jars and build-cache entries', async () =>
|
|||||||
|
|
||||||
await runGradleBuild(projectRoot, 'build', '3.1')
|
await runGradleBuild(projectRoot, 'build', '3.1')
|
||||||
|
|
||||||
await cacheCleaner.prepare()
|
const timestamp = await cacheCleaner.prepare()
|
||||||
|
|
||||||
await runGradleBuild(projectRoot, 'build', '3.1.1')
|
await runGradleBuild(projectRoot, 'build', '3.1.1')
|
||||||
|
|
||||||
@@ -26,7 +27,7 @@ test('will cleanup unused dependency jars and build-cache entries', async () =>
|
|||||||
expect(fs.existsSync(commonsMath311)).toBe(true)
|
expect(fs.existsSync(commonsMath311)).toBe(true)
|
||||||
expect(fs.readdirSync(buildCacheDir).length).toBe(4) // gc.properties, build-cache-1.lock, and 2 task entries
|
expect(fs.readdirSync(buildCacheDir).length).toBe(4) // gc.properties, build-cache-1.lock, and 2 task entries
|
||||||
|
|
||||||
await cacheCleaner.forceCleanup()
|
await cacheCleaner.forceCleanupFilesOlderThan(timestamp)
|
||||||
|
|
||||||
expect(fs.existsSync(commonsMath31)).toBe(false)
|
expect(fs.existsSync(commonsMath31)).toBe(false)
|
||||||
expect(fs.existsSync(commonsMath311)).toBe(true)
|
expect(fs.existsSync(commonsMath311)).toBe(true)
|
||||||
@@ -42,25 +43,39 @@ test('will cleanup unused gradle versions', async () => {
|
|||||||
// Initialize HOME with 2 different Gradle versions
|
// Initialize HOME with 2 different Gradle versions
|
||||||
await runGradleWrapperBuild(projectRoot, 'build')
|
await runGradleWrapperBuild(projectRoot, 'build')
|
||||||
await runGradleBuild(projectRoot, 'build')
|
await runGradleBuild(projectRoot, 'build')
|
||||||
|
|
||||||
await cacheCleaner.prepare()
|
const timestamp = await cacheCleaner.prepare()
|
||||||
|
|
||||||
// Run with only one of these versions
|
// Run with only one of these versions
|
||||||
await runGradleBuild(projectRoot, 'build')
|
await runGradleBuild(projectRoot, 'build')
|
||||||
|
|
||||||
const gradle802 = path.resolve(gradleUserHome, "caches/8.0.2")
|
const gradle802 = path.resolve(gradleUserHome, "caches/8.0.2")
|
||||||
|
const transforms3 = path.resolve(gradleUserHome, "caches/transforms-3")
|
||||||
|
const metadata100 = path.resolve(gradleUserHome, "caches/modules-2/metadata-2.100")
|
||||||
const wrapper802 = path.resolve(gradleUserHome, "wrapper/dists/gradle-8.0.2-bin")
|
const wrapper802 = path.resolve(gradleUserHome, "wrapper/dists/gradle-8.0.2-bin")
|
||||||
const gradleCurrent = path.resolve(gradleUserHome, "caches/8.8")
|
const gradleCurrent = path.resolve(gradleUserHome, "caches/8.9")
|
||||||
|
const metadataCurrent = path.resolve(gradleUserHome, "caches/modules-2/metadata-2.106")
|
||||||
|
|
||||||
expect(fs.existsSync(gradle802)).toBe(true)
|
expect(fs.existsSync(gradle802)).toBe(true)
|
||||||
|
expect(fs.existsSync(transforms3)).toBe(true)
|
||||||
|
expect(fs.existsSync(metadata100)).toBe(true)
|
||||||
expect(fs.existsSync(wrapper802)).toBe(true)
|
expect(fs.existsSync(wrapper802)).toBe(true)
|
||||||
expect(fs.existsSync(gradleCurrent)).toBe(true)
|
|
||||||
|
|
||||||
await cacheCleaner.forceCleanup()
|
expect(fs.existsSync(gradleCurrent)).toBe(true)
|
||||||
|
expect(fs.existsSync(metadataCurrent)).toBe(true)
|
||||||
|
|
||||||
|
// The wrapper won't be removed if it was recently downloaded. Age it.
|
||||||
|
setUtimes(wrapper802, new Date(Date.now() - 48 * 60 * 60 * 1000))
|
||||||
|
|
||||||
|
await cacheCleaner.forceCleanupFilesOlderThan(timestamp)
|
||||||
|
|
||||||
expect(fs.existsSync(gradle802)).toBe(false)
|
expect(fs.existsSync(gradle802)).toBe(false)
|
||||||
|
expect(fs.existsSync(transforms3)).toBe(false)
|
||||||
|
expect(fs.existsSync(metadata100)).toBe(false)
|
||||||
expect(fs.existsSync(wrapper802)).toBe(false)
|
expect(fs.existsSync(wrapper802)).toBe(false)
|
||||||
|
|
||||||
expect(fs.existsSync(gradleCurrent)).toBe(true)
|
expect(fs.existsSync(gradleCurrent)).toBe(true)
|
||||||
|
expect(fs.existsSync(metadataCurrent)).toBe(true)
|
||||||
})
|
})
|
||||||
|
|
||||||
async function runGradleBuild(projectRoot: string, args: string, version: string = '3.1'): Promise<void> {
|
async function runGradleBuild(projectRoot: string, args: string, version: string = '3.1'): Promise<void> {
|
||||||
@@ -86,3 +101,9 @@ function prepareTestProject(): string {
|
|||||||
return projectRoot
|
return projectRoot
|
||||||
}
|
}
|
||||||
|
|
||||||
|
async function setUtimes(pattern: string, timestamp: Date): Promise<void> {
|
||||||
|
const globber = await glob.create(pattern)
|
||||||
|
for await (const file of globber.globGenerator()) {
|
||||||
|
fs.utimesSync(file, timestamp, timestamp)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user