mirror of
https://github.com/gradle/actions.git
synced 2026-10-16 08:31:34 +00:00
Compare commits
1
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
5d363444d5 |
@@ -3,7 +3,7 @@ name: 'Build and upload distribution'
|
||||
runs:
|
||||
using: "composite"
|
||||
steps:
|
||||
- uses: actions/setup-node@820762786026740c76f36085b0efc47a31fe5020 # v7.0.0
|
||||
- uses: actions/setup-node@53b83947a5a98c8d113130e565377fae1a50d02f # v6.3.0
|
||||
with:
|
||||
node-version: 24
|
||||
cache: npm
|
||||
@@ -23,7 +23,7 @@ runs:
|
||||
cp -r sources/dist .
|
||||
|
||||
- name: Upload distribution
|
||||
uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1
|
||||
uses: actions/upload-artifact@bbbca2ddaa5d8feaa63e36b76fdaad77386f024f # v7.0.0
|
||||
with:
|
||||
name: dist
|
||||
path: dist/
|
||||
|
||||
@@ -10,7 +10,7 @@ runs:
|
||||
using: "composite"
|
||||
steps:
|
||||
- name: Setup Java
|
||||
uses: actions/setup-java@b6effb05e454b25005698d916606bdc6ffcbf961 # v5.7.0
|
||||
uses: actions/setup-java@be666c2fcd27ec809703dec50e508c2fdc7f6654 # v5.2.0
|
||||
with:
|
||||
distribution: 'temurin'
|
||||
java-version: ${{ inputs.java-version }}
|
||||
|
||||
+5
-11
@@ -16,17 +16,11 @@ updates:
|
||||
patterns:
|
||||
- "*"
|
||||
ignore:
|
||||
- dependency-name: "typescript"
|
||||
versions: ["7.x"]
|
||||
- dependency-name: "@types/node"
|
||||
versions: ["25.x", "26.x"]
|
||||
# jest 30.5.0 reworked the ESM module registry, and nock no longer intercepts requests
|
||||
# made through @actions/http-client (undici): every mocked test silently hits the real
|
||||
# network instead. nock 15 does not fix it. Drop these two once they interoperate again.
|
||||
- dependency-name: "jest"
|
||||
versions: [">=30.5.0"]
|
||||
- dependency-name: "@jest/globals"
|
||||
versions: [">=30.5.0"]
|
||||
# Keep actions/cache and actions/artifact major aligned and force actions/cache version to match patch
|
||||
- dependency-name: "*actions/cache*"
|
||||
- dependency-name: "*actions/artifact*"
|
||||
update-types: ["version-update:semver-major", "version-update:semver-minor"]
|
||||
|
||||
- package-ecosystem: "github-actions"
|
||||
# github-actions with directory: "/" only monitors .github/workflows
|
||||
# https://github.com/dependabot/dependabot-core/issues/6345
|
||||
|
||||
@@ -0,0 +1,78 @@
|
||||
{
|
||||
"$schema": "https://docs.renovatebot.com/renovate-schema.json",
|
||||
extends: [
|
||||
"config:recommended",
|
||||
"github>gradle/renovate-agent//presets/dv-automerge-minor.json5",
|
||||
":disableDependencyDashboard",
|
||||
],
|
||||
// Renovate is scoped narrowly here: only the Develocity Gradle plugin (custom regex)
|
||||
// and the Gradle wrappers in selected sample directories.
|
||||
// Everything else (npm, github-actions, Maven coordinates) is managed by Dependabot
|
||||
// via .github/dependabot.yml.
|
||||
enabledManagers: ["custom.regex", "gradle-wrapper"],
|
||||
"gradle-wrapper": {
|
||||
fileMatch: [
|
||||
"^\\.github/workflow-samples/gradle-plugin/gradle/wrapper/gradle-wrapper\\.properties$",
|
||||
"^\\.github/workflow-samples/groovy-dsl/gradle/wrapper/gradle-wrapper\\.properties$",
|
||||
"^\\.github/workflow-samples/java-toolchain/gradle/wrapper/gradle-wrapper\\.properties$",
|
||||
"^\\.github/workflow-samples/kotlin-dsl/gradle/wrapper/gradle-wrapper\\.properties$",
|
||||
"^\\.github/workflow-samples/non-executable-wrapper/gradle/wrapper/gradle-wrapper\\.properties$",
|
||||
"^sources/test/init-scripts/gradle/wrapper/gradle-wrapper\\.properties$",
|
||||
],
|
||||
},
|
||||
customManagers: [
|
||||
{
|
||||
customType: "regex",
|
||||
description: "Bump Develocity Gradle plugin references in files outside Dependabot's coverage",
|
||||
fileMatch: [
|
||||
"^\\.github/workflows/integ-test-inject-develocity\\.yml$",
|
||||
"^sources/src/develocity/build-scan\\.ts$",
|
||||
"^docs/setup-gradle\\.md$",
|
||||
"(^|/)settings\\.gradle$",
|
||||
"(^|/)settings\\.gradle\\.kts$",
|
||||
"(^|/)build\\.gradle$",
|
||||
"(^|/)build\\.gradle\\.kts$",
|
||||
"^sources/test/init-scripts/src/test/groovy/com/gradle/gradlebuildaction/BaseInitScriptTest\\.groovy$",
|
||||
"^sources/test/init-scripts/src/test/groovy/com/gradle/gradlebuildaction/TestBuildResultRecorder\\.groovy$",
|
||||
],
|
||||
// Patterns capture any X.Y(.Z) version. The packageRules below filter to
|
||||
// just the current 4.x line and skip the pinned 3.x legacy refs.
|
||||
// When the plugin's major version changes, edit `matchCurrentVersion` and
|
||||
// `allowedVersions` in the packageRules block below — no regex edits here.
|
||||
matchStrings: [
|
||||
"plugin-version:[^\\n]*'(?<currentValue>\\d+\\.\\d+(?:\\.\\d+)?)'",
|
||||
"DEVELOCITY_PLUGIN_VERSION[^\\n]*'(?<currentValue>\\d+\\.\\d+(?:\\.\\d+)?)'",
|
||||
"`v(?<currentValue>\\d+\\.\\d+(?:\\.\\d+)?)`\\s+of\\s+the\\s+\\[Develocity Gradle plugin",
|
||||
"id\\s+['\"]com\\.gradle\\.develocity['\"]\\s+version\\s+['\"](?<currentValue>\\d+\\.\\d+(?:\\.\\d+)?)['\"]",
|
||||
"id\\(['\"]com\\.gradle\\.develocity['\"]\\)\\s+version\\s+['\"](?<currentValue>\\d+\\.\\d+(?:\\.\\d+)?)['\"]",
|
||||
],
|
||||
depNameTemplate: "com.gradle:develocity-gradle-plugin",
|
||||
datasourceTemplate: "maven",
|
||||
registryUrlTemplate: "https://plugins.gradle.org/m2",
|
||||
},
|
||||
],
|
||||
packageRules: [
|
||||
{
|
||||
// Skip the legacy 3.16.2 references that are intentionally pinned.
|
||||
matchManagers: ["custom.regex"],
|
||||
matchPackageNames: ["com.gradle:develocity-gradle-plugin"],
|
||||
matchCurrentVersion: "<4.0.0",
|
||||
enabled: false,
|
||||
},
|
||||
{
|
||||
// Current 4.x line. To start tracking the next major (5.x), replace `5.0.0`
|
||||
// with `6.0.0` in both fields below — no regex edits needed.
|
||||
matchManagers: ["custom.regex"],
|
||||
matchPackageNames: ["com.gradle:develocity-gradle-plugin"],
|
||||
matchCurrentVersion: ">=4.0.0 <5.0.0",
|
||||
allowedVersions: "<5.0.0",
|
||||
groupName: "Develocity Gradle plugin",
|
||||
groupSlug: "develocity-gradle-plugin",
|
||||
},
|
||||
{
|
||||
matchManagers: ["gradle-wrapper"],
|
||||
groupName: "Gradle wrappers",
|
||||
groupSlug: "gradle-wrappers",
|
||||
},
|
||||
],
|
||||
}
|
||||
@@ -3,6 +3,3 @@
|
||||
|
||||
# Ignore Gradle build output directory
|
||||
build
|
||||
|
||||
# Marker file written when the 'test' task is configured
|
||||
task-configured.txt
|
||||
|
||||
Binary file not shown.
@@ -1,10 +1,8 @@
|
||||
distributionBase=GRADLE_USER_HOME
|
||||
distributionPath=wrapper/dists
|
||||
distributionSha256Sum=acd53f1edaf02f1a8ff99879f8a34b302661a057d9b063ae9e35b552f804d20a
|
||||
distributionUrl=https\://services.gradle.org/distributions/gradle-9.7.1-bin.zip
|
||||
distributionSha256Sum=2ab2958f2a1e51120c326cad6f385153bb11ee93b3c216c5fccebfdfbb7ec6cb
|
||||
distributionUrl=https\://services.gradle.org/distributions/gradle-9.4.1-bin.zip
|
||||
networkTimeout=10000
|
||||
retries=0
|
||||
retryBackOffMs=500
|
||||
validateDistributionUrl=true
|
||||
zipStoreBase=GRADLE_USER_HOME
|
||||
zipStorePath=wrapper/dists
|
||||
|
||||
@@ -20,7 +20,7 @@
|
||||
|
||||
##############################################################################
|
||||
#
|
||||
# gradlew start up script for POSIX generated by Gradle.
|
||||
# Gradle start up script for POSIX generated by Gradle.
|
||||
#
|
||||
# Important for running:
|
||||
#
|
||||
@@ -29,7 +29,7 @@
|
||||
# bash, then to run this script, type that shell name before the whole
|
||||
# command line, like:
|
||||
#
|
||||
# ksh gradlew
|
||||
# ksh Gradle
|
||||
#
|
||||
# Busybox and similar reduced shells will NOT work, because this script
|
||||
# requires all of these POSIX shell features:
|
||||
@@ -57,7 +57,7 @@
|
||||
# Darwin, MinGW, and NonStop.
|
||||
#
|
||||
# (3) This script is generated from the Groovy template
|
||||
# https://github.com/gradle/gradle/blob/3d91ce3b8caaf77ad09f381f43615b715b53f72c/platforms/jvm/plugins-application/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt
|
||||
# https://github.com/gradle/gradle/blob/2d6327017519d23b96af35865dc997fcb544fb40/platforms/jvm/plugins-application/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt
|
||||
# within the Gradle project.
|
||||
#
|
||||
# You can find Gradle at https://github.com/gradle/gradle/.
|
||||
|
||||
@@ -19,12 +19,12 @@
|
||||
@if "%DEBUG%"=="" @echo off
|
||||
@rem ##########################################################################
|
||||
@rem
|
||||
@rem gradlew startup script for Windows
|
||||
@rem Gradle startup script for Windows
|
||||
@rem
|
||||
@rem ##########################################################################
|
||||
|
||||
@rem Set local scope for the variables, and ensure extensions are enabled
|
||||
setlocal EnableExtensions
|
||||
@rem Set local scope for the variables with windows NT shell
|
||||
if "%OS%"=="Windows_NT" setlocal
|
||||
|
||||
set DIRNAME=%~dp0
|
||||
if "%DIRNAME%"=="" set DIRNAME=.
|
||||
@@ -51,7 +51,7 @@ echo. 1>&2
|
||||
echo Please set the JAVA_HOME variable in your environment to match the 1>&2
|
||||
echo location of your Java installation. 1>&2
|
||||
|
||||
"%COMSPEC%" /c exit 1
|
||||
goto fail
|
||||
|
||||
:findJavaFromJavaHome
|
||||
set JAVA_HOME=%JAVA_HOME:"=%
|
||||
@@ -65,18 +65,29 @@ echo. 1>&2
|
||||
echo Please set the JAVA_HOME variable in your environment to match the 1>&2
|
||||
echo location of your Java installation. 1>&2
|
||||
|
||||
"%COMSPEC%" /c exit 1
|
||||
goto fail
|
||||
|
||||
:execute
|
||||
@rem Setup the command line
|
||||
|
||||
|
||||
|
||||
@rem Execute gradlew
|
||||
@rem endlocal doesn't take effect until after the line is parsed and variables are expanded
|
||||
@rem which allows us to clear the local environment before executing the java command
|
||||
endlocal & "%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -jar "%APP_HOME%\gradle\wrapper\gradle-wrapper.jar" %* & call :exitWithErrorLevel
|
||||
@rem Execute Gradle
|
||||
"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -jar "%APP_HOME%\gradle\wrapper\gradle-wrapper.jar" %*
|
||||
|
||||
:exitWithErrorLevel
|
||||
@rem Use "%COMSPEC%" /c exit to allow operators to work properly in scripts
|
||||
"%COMSPEC%" /c exit %ERRORLEVEL%
|
||||
:end
|
||||
@rem End local scope for the variables with windows NT shell
|
||||
if %ERRORLEVEL% equ 0 goto mainEnd
|
||||
|
||||
:fail
|
||||
rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of
|
||||
rem the _cmd.exe /c_ return code!
|
||||
set EXIT_CODE=%ERRORLEVEL%
|
||||
if %EXIT_CODE% equ 0 set EXIT_CODE=1
|
||||
if not ""=="%GRADLE_EXIT_CONSOLE%" exit %EXIT_CODE%
|
||||
exit /b %EXIT_CODE%
|
||||
|
||||
:mainEnd
|
||||
if "%OS%"=="Windows_NT" endlocal
|
||||
|
||||
:omega
|
||||
|
||||
Binary file not shown.
@@ -1,10 +1,8 @@
|
||||
distributionBase=GRADLE_USER_HOME
|
||||
distributionPath=wrapper/dists
|
||||
distributionSha256Sum=acd53f1edaf02f1a8ff99879f8a34b302661a057d9b063ae9e35b552f804d20a
|
||||
distributionUrl=https\://services.gradle.org/distributions/gradle-9.7.1-bin.zip
|
||||
distributionSha256Sum=2ab2958f2a1e51120c326cad6f385153bb11ee93b3c216c5fccebfdfbb7ec6cb
|
||||
distributionUrl=https\://services.gradle.org/distributions/gradle-9.4.1-bin.zip
|
||||
networkTimeout=10000
|
||||
retries=0
|
||||
retryBackOffMs=500
|
||||
validateDistributionUrl=true
|
||||
zipStoreBase=GRADLE_USER_HOME
|
||||
zipStorePath=wrapper/dists
|
||||
|
||||
@@ -20,7 +20,7 @@
|
||||
|
||||
##############################################################################
|
||||
#
|
||||
# gradlew start up script for POSIX generated by Gradle.
|
||||
# Gradle start up script for POSIX generated by Gradle.
|
||||
#
|
||||
# Important for running:
|
||||
#
|
||||
@@ -29,7 +29,7 @@
|
||||
# bash, then to run this script, type that shell name before the whole
|
||||
# command line, like:
|
||||
#
|
||||
# ksh gradlew
|
||||
# ksh Gradle
|
||||
#
|
||||
# Busybox and similar reduced shells will NOT work, because this script
|
||||
# requires all of these POSIX shell features:
|
||||
@@ -57,7 +57,7 @@
|
||||
# Darwin, MinGW, and NonStop.
|
||||
#
|
||||
# (3) This script is generated from the Groovy template
|
||||
# https://github.com/gradle/gradle/blob/3d91ce3b8caaf77ad09f381f43615b715b53f72c/platforms/jvm/plugins-application/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt
|
||||
# https://github.com/gradle/gradle/blob/2d6327017519d23b96af35865dc997fcb544fb40/platforms/jvm/plugins-application/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt
|
||||
# within the Gradle project.
|
||||
#
|
||||
# You can find Gradle at https://github.com/gradle/gradle/.
|
||||
|
||||
@@ -19,12 +19,12 @@
|
||||
@if "%DEBUG%"=="" @echo off
|
||||
@rem ##########################################################################
|
||||
@rem
|
||||
@rem gradlew startup script for Windows
|
||||
@rem Gradle startup script for Windows
|
||||
@rem
|
||||
@rem ##########################################################################
|
||||
|
||||
@rem Set local scope for the variables, and ensure extensions are enabled
|
||||
setlocal EnableExtensions
|
||||
@rem Set local scope for the variables with windows NT shell
|
||||
if "%OS%"=="Windows_NT" setlocal
|
||||
|
||||
set DIRNAME=%~dp0
|
||||
if "%DIRNAME%"=="" set DIRNAME=.
|
||||
@@ -51,7 +51,7 @@ echo. 1>&2
|
||||
echo Please set the JAVA_HOME variable in your environment to match the 1>&2
|
||||
echo location of your Java installation. 1>&2
|
||||
|
||||
"%COMSPEC%" /c exit 1
|
||||
goto fail
|
||||
|
||||
:findJavaFromJavaHome
|
||||
set JAVA_HOME=%JAVA_HOME:"=%
|
||||
@@ -65,18 +65,29 @@ echo. 1>&2
|
||||
echo Please set the JAVA_HOME variable in your environment to match the 1>&2
|
||||
echo location of your Java installation. 1>&2
|
||||
|
||||
"%COMSPEC%" /c exit 1
|
||||
goto fail
|
||||
|
||||
:execute
|
||||
@rem Setup the command line
|
||||
|
||||
|
||||
|
||||
@rem Execute gradlew
|
||||
@rem endlocal doesn't take effect until after the line is parsed and variables are expanded
|
||||
@rem which allows us to clear the local environment before executing the java command
|
||||
endlocal & "%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -jar "%APP_HOME%\gradle\wrapper\gradle-wrapper.jar" %* & call :exitWithErrorLevel
|
||||
@rem Execute Gradle
|
||||
"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -jar "%APP_HOME%\gradle\wrapper\gradle-wrapper.jar" %*
|
||||
|
||||
:exitWithErrorLevel
|
||||
@rem Use "%COMSPEC%" /c exit to allow operators to work properly in scripts
|
||||
"%COMSPEC%" /c exit %ERRORLEVEL%
|
||||
:end
|
||||
@rem End local scope for the variables with windows NT shell
|
||||
if %ERRORLEVEL% equ 0 goto mainEnd
|
||||
|
||||
:fail
|
||||
rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of
|
||||
rem the _cmd.exe /c_ return code!
|
||||
set EXIT_CODE=%ERRORLEVEL%
|
||||
if %EXIT_CODE% equ 0 set EXIT_CODE=1
|
||||
if not ""=="%GRADLE_EXIT_CONSOLE%" exit %EXIT_CODE%
|
||||
exit /b %EXIT_CODE%
|
||||
|
||||
:mainEnd
|
||||
if "%OS%"=="Windows_NT" endlocal
|
||||
|
||||
:omega
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
plugins {
|
||||
id "com.gradle.develocity" version "4.5.1"
|
||||
id "com.gradle.develocity" version "4.4.0"
|
||||
id "com.gradle.common-custom-user-data-gradle-plugin" version "2.4.0"
|
||||
}
|
||||
|
||||
|
||||
Binary file not shown.
@@ -1,10 +1,8 @@
|
||||
distributionBase=GRADLE_USER_HOME
|
||||
distributionPath=wrapper/dists
|
||||
distributionSha256Sum=acd53f1edaf02f1a8ff99879f8a34b302661a057d9b063ae9e35b552f804d20a
|
||||
distributionUrl=https\://services.gradle.org/distributions/gradle-9.7.1-bin.zip
|
||||
distributionSha256Sum=2ab2958f2a1e51120c326cad6f385153bb11ee93b3c216c5fccebfdfbb7ec6cb
|
||||
distributionUrl=https\://services.gradle.org/distributions/gradle-9.4.1-bin.zip
|
||||
networkTimeout=10000
|
||||
retries=0
|
||||
retryBackOffMs=500
|
||||
validateDistributionUrl=true
|
||||
zipStoreBase=GRADLE_USER_HOME
|
||||
zipStorePath=wrapper/dists
|
||||
|
||||
@@ -20,7 +20,7 @@
|
||||
|
||||
##############################################################################
|
||||
#
|
||||
# gradlew start up script for POSIX generated by Gradle.
|
||||
# Gradle start up script for POSIX generated by Gradle.
|
||||
#
|
||||
# Important for running:
|
||||
#
|
||||
@@ -29,7 +29,7 @@
|
||||
# bash, then to run this script, type that shell name before the whole
|
||||
# command line, like:
|
||||
#
|
||||
# ksh gradlew
|
||||
# ksh Gradle
|
||||
#
|
||||
# Busybox and similar reduced shells will NOT work, because this script
|
||||
# requires all of these POSIX shell features:
|
||||
@@ -57,7 +57,7 @@
|
||||
# Darwin, MinGW, and NonStop.
|
||||
#
|
||||
# (3) This script is generated from the Groovy template
|
||||
# https://github.com/gradle/gradle/blob/3d91ce3b8caaf77ad09f381f43615b715b53f72c/platforms/jvm/plugins-application/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt
|
||||
# https://github.com/gradle/gradle/blob/2d6327017519d23b96af35865dc997fcb544fb40/platforms/jvm/plugins-application/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt
|
||||
# within the Gradle project.
|
||||
#
|
||||
# You can find Gradle at https://github.com/gradle/gradle/.
|
||||
|
||||
@@ -19,12 +19,12 @@
|
||||
@if "%DEBUG%"=="" @echo off
|
||||
@rem ##########################################################################
|
||||
@rem
|
||||
@rem gradlew startup script for Windows
|
||||
@rem Gradle startup script for Windows
|
||||
@rem
|
||||
@rem ##########################################################################
|
||||
|
||||
@rem Set local scope for the variables, and ensure extensions are enabled
|
||||
setlocal EnableExtensions
|
||||
@rem Set local scope for the variables with windows NT shell
|
||||
if "%OS%"=="Windows_NT" setlocal
|
||||
|
||||
set DIRNAME=%~dp0
|
||||
if "%DIRNAME%"=="" set DIRNAME=.
|
||||
@@ -51,7 +51,7 @@ echo. 1>&2
|
||||
echo Please set the JAVA_HOME variable in your environment to match the 1>&2
|
||||
echo location of your Java installation. 1>&2
|
||||
|
||||
"%COMSPEC%" /c exit 1
|
||||
goto fail
|
||||
|
||||
:findJavaFromJavaHome
|
||||
set JAVA_HOME=%JAVA_HOME:"=%
|
||||
@@ -65,18 +65,29 @@ echo. 1>&2
|
||||
echo Please set the JAVA_HOME variable in your environment to match the 1>&2
|
||||
echo location of your Java installation. 1>&2
|
||||
|
||||
"%COMSPEC%" /c exit 1
|
||||
goto fail
|
||||
|
||||
:execute
|
||||
@rem Setup the command line
|
||||
|
||||
|
||||
|
||||
@rem Execute gradlew
|
||||
@rem endlocal doesn't take effect until after the line is parsed and variables are expanded
|
||||
@rem which allows us to clear the local environment before executing the java command
|
||||
endlocal & "%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -jar "%APP_HOME%\gradle\wrapper\gradle-wrapper.jar" %* & call :exitWithErrorLevel
|
||||
@rem Execute Gradle
|
||||
"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -jar "%APP_HOME%\gradle\wrapper\gradle-wrapper.jar" %*
|
||||
|
||||
:exitWithErrorLevel
|
||||
@rem Use "%COMSPEC%" /c exit to allow operators to work properly in scripts
|
||||
"%COMSPEC%" /c exit %ERRORLEVEL%
|
||||
:end
|
||||
@rem End local scope for the variables with windows NT shell
|
||||
if %ERRORLEVEL% equ 0 goto mainEnd
|
||||
|
||||
:fail
|
||||
rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of
|
||||
rem the _cmd.exe /c_ return code!
|
||||
set EXIT_CODE=%ERRORLEVEL%
|
||||
if %EXIT_CODE% equ 0 set EXIT_CODE=1
|
||||
if not ""=="%GRADLE_EXIT_CONSOLE%" exit %EXIT_CODE%
|
||||
exit /b %EXIT_CODE%
|
||||
|
||||
:mainEnd
|
||||
if "%OS%"=="Windows_NT" endlocal
|
||||
|
||||
:omega
|
||||
|
||||
Binary file not shown.
@@ -1,10 +1,8 @@
|
||||
distributionBase=GRADLE_USER_HOME
|
||||
distributionPath=wrapper/dists
|
||||
distributionSha256Sum=acd53f1edaf02f1a8ff99879f8a34b302661a057d9b063ae9e35b552f804d20a
|
||||
distributionUrl=https\://services.gradle.org/distributions/gradle-9.7.1-bin.zip
|
||||
distributionSha256Sum=2ab2958f2a1e51120c326cad6f385153bb11ee93b3c216c5fccebfdfbb7ec6cb
|
||||
distributionUrl=https\://services.gradle.org/distributions/gradle-9.4.1-bin.zip
|
||||
networkTimeout=10000
|
||||
retries=0
|
||||
retryBackOffMs=500
|
||||
validateDistributionUrl=true
|
||||
zipStoreBase=GRADLE_USER_HOME
|
||||
zipStorePath=wrapper/dists
|
||||
|
||||
@@ -20,7 +20,7 @@
|
||||
|
||||
##############################################################################
|
||||
#
|
||||
# gradlew start up script for POSIX generated by Gradle.
|
||||
# Gradle start up script for POSIX generated by Gradle.
|
||||
#
|
||||
# Important for running:
|
||||
#
|
||||
@@ -29,7 +29,7 @@
|
||||
# bash, then to run this script, type that shell name before the whole
|
||||
# command line, like:
|
||||
#
|
||||
# ksh gradlew
|
||||
# ksh Gradle
|
||||
#
|
||||
# Busybox and similar reduced shells will NOT work, because this script
|
||||
# requires all of these POSIX shell features:
|
||||
@@ -57,7 +57,7 @@
|
||||
# Darwin, MinGW, and NonStop.
|
||||
#
|
||||
# (3) This script is generated from the Groovy template
|
||||
# https://github.com/gradle/gradle/blob/3d91ce3b8caaf77ad09f381f43615b715b53f72c/platforms/jvm/plugins-application/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt
|
||||
# https://github.com/gradle/gradle/blob/2d6327017519d23b96af35865dc997fcb544fb40/platforms/jvm/plugins-application/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt
|
||||
# within the Gradle project.
|
||||
#
|
||||
# You can find Gradle at https://github.com/gradle/gradle/.
|
||||
|
||||
@@ -19,12 +19,12 @@
|
||||
@if "%DEBUG%"=="" @echo off
|
||||
@rem ##########################################################################
|
||||
@rem
|
||||
@rem gradlew startup script for Windows
|
||||
@rem Gradle startup script for Windows
|
||||
@rem
|
||||
@rem ##########################################################################
|
||||
|
||||
@rem Set local scope for the variables, and ensure extensions are enabled
|
||||
setlocal EnableExtensions
|
||||
@rem Set local scope for the variables with windows NT shell
|
||||
if "%OS%"=="Windows_NT" setlocal
|
||||
|
||||
set DIRNAME=%~dp0
|
||||
if "%DIRNAME%"=="" set DIRNAME=.
|
||||
@@ -51,7 +51,7 @@ echo. 1>&2
|
||||
echo Please set the JAVA_HOME variable in your environment to match the 1>&2
|
||||
echo location of your Java installation. 1>&2
|
||||
|
||||
"%COMSPEC%" /c exit 1
|
||||
goto fail
|
||||
|
||||
:findJavaFromJavaHome
|
||||
set JAVA_HOME=%JAVA_HOME:"=%
|
||||
@@ -65,18 +65,29 @@ echo. 1>&2
|
||||
echo Please set the JAVA_HOME variable in your environment to match the 1>&2
|
||||
echo location of your Java installation. 1>&2
|
||||
|
||||
"%COMSPEC%" /c exit 1
|
||||
goto fail
|
||||
|
||||
:execute
|
||||
@rem Setup the command line
|
||||
|
||||
|
||||
|
||||
@rem Execute gradlew
|
||||
@rem endlocal doesn't take effect until after the line is parsed and variables are expanded
|
||||
@rem which allows us to clear the local environment before executing the java command
|
||||
endlocal & "%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -jar "%APP_HOME%\gradle\wrapper\gradle-wrapper.jar" %* & call :exitWithErrorLevel
|
||||
@rem Execute Gradle
|
||||
"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -jar "%APP_HOME%\gradle\wrapper\gradle-wrapper.jar" %*
|
||||
|
||||
:exitWithErrorLevel
|
||||
@rem Use "%COMSPEC%" /c exit to allow operators to work properly in scripts
|
||||
"%COMSPEC%" /c exit %ERRORLEVEL%
|
||||
:end
|
||||
@rem End local scope for the variables with windows NT shell
|
||||
if %ERRORLEVEL% equ 0 goto mainEnd
|
||||
|
||||
:fail
|
||||
rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of
|
||||
rem the _cmd.exe /c_ return code!
|
||||
set EXIT_CODE=%ERRORLEVEL%
|
||||
if %EXIT_CODE% equ 0 set EXIT_CODE=1
|
||||
if not ""=="%GRADLE_EXIT_CONSOLE%" exit %EXIT_CODE%
|
||||
exit /b %EXIT_CODE%
|
||||
|
||||
:mainEnd
|
||||
if "%OS%"=="Windows_NT" endlocal
|
||||
|
||||
:omega
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
plugins {
|
||||
id("com.gradle.develocity") version "4.5.1"
|
||||
id("com.gradle.develocity") version "4.4.0"
|
||||
id("com.gradle.common-custom-user-data-gradle-plugin") version "2.4.0"
|
||||
}
|
||||
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
plugins {
|
||||
id "com.gradle.develocity" version "4.5.1"
|
||||
id "com.gradle.develocity" version "4.4.0"
|
||||
}
|
||||
|
||||
develocity {
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
plugins {
|
||||
id "com.gradle.develocity" version "4.5.1"
|
||||
id "com.gradle.develocity" version "4.4.0"
|
||||
}
|
||||
|
||||
develocity {
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
plugins {
|
||||
id "com.gradle.develocity" version "4.5.1"
|
||||
id "com.gradle.develocity" version "4.4.0"
|
||||
}
|
||||
|
||||
develocity {
|
||||
|
||||
@@ -18,15 +18,15 @@ jobs:
|
||||
|
||||
steps:
|
||||
- name: Checkout sources
|
||||
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
|
||||
- uses: actions/setup-node@820762786026740c76f36085b0efc47a31fe5020 # v7.0.0
|
||||
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
|
||||
- uses: actions/setup-node@53b83947a5a98c8d113130e565377fae1a50d02f # v6.3.0
|
||||
with:
|
||||
node-version: 24
|
||||
node-version: 20
|
||||
cache: npm
|
||||
cache-dependency-path: sources/package-lock.json
|
||||
- name: Setup Gradle
|
||||
# Use a released version to avoid breakages
|
||||
uses: gradle/actions/setup-gradle@9c971963bec38e04b3d30dcc455b5382be2fdbfb # v6.3.0
|
||||
uses: gradle/actions/setup-gradle@39e147cb9de83bb9910b8ef8bd7fff0ee20fcd6f # v6.0.1
|
||||
env:
|
||||
ALLOWED_GRADLE_WRAPPER_CHECKSUMS: e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855 # Invalid wrapper jar used for testing
|
||||
with:
|
||||
|
||||
@@ -15,13 +15,13 @@ jobs:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Checkout sources
|
||||
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
|
||||
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
|
||||
with:
|
||||
fetch-depth: 0
|
||||
|
||||
- name: Get changed files
|
||||
id: changed-files
|
||||
uses: tj-actions/changed-files@9426d40962ed5378910ee2e21d5f8c6fcbf2dd96 # v47.0.6
|
||||
uses: tj-actions/changed-files@22103cc46bda19c2b464ffe86db46df6922fd323 # v47.0.5
|
||||
with:
|
||||
files: |
|
||||
dist/**
|
||||
|
||||
@@ -31,11 +31,11 @@ jobs:
|
||||
|
||||
steps:
|
||||
- name: Checkout repository
|
||||
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
|
||||
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
|
||||
|
||||
# Initializes the CodeQL tools for scanning.
|
||||
- name: Initialize CodeQL
|
||||
uses: github/codeql-action/init@cdf488f595d80d6e07e03d4674febd5ab45fa938 # v3.29.5
|
||||
uses: github/codeql-action/init@c10b8064de6f491fea524254123dbe5e09572f13 # v3.29.5
|
||||
with:
|
||||
languages: ${{ matrix.language }}
|
||||
config: |
|
||||
@@ -43,4 +43,4 @@ jobs:
|
||||
- sources/src
|
||||
|
||||
- name: Perform CodeQL Analysis
|
||||
uses: github/codeql-action/analyze@cdf488f595d80d6e07e03d4674febd5ab45fa938 # v3.29.5
|
||||
uses: github/codeql-action/analyze@c10b8064de6f491fea524254123dbe5e09572f13 # v3.29.5
|
||||
|
||||
@@ -8,6 +8,10 @@ on:
|
||||
paths-ignore:
|
||||
- 'dist/**'
|
||||
pull_request:
|
||||
paths:
|
||||
- '.github/workflows/ci-init-script-check.yml'
|
||||
- 'sources/src/resources/init-scripts/**'
|
||||
- 'sources/test/init-scripts/**'
|
||||
workflow_dispatch:
|
||||
|
||||
permissions:
|
||||
@@ -18,35 +22,17 @@ jobs:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Checkout sources
|
||||
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
|
||||
with:
|
||||
fetch-depth: 0
|
||||
# Detect whether anything relevant to the init-script tests changed.
|
||||
# The workflow always runs (so it always reports a status check, making it safe
|
||||
# to mark as required), but the heavy steps below are skipped on pull requests
|
||||
# that don't touch the init-scripts. Pushes and manual runs always execute fully.
|
||||
- name: Check for relevant changes
|
||||
id: changes
|
||||
if: github.event_name == 'pull_request'
|
||||
uses: tj-actions/changed-files@9426d40962ed5378910ee2e21d5f8c6fcbf2dd96 # v47.0.6
|
||||
with:
|
||||
files: |
|
||||
.github/workflows/ci-init-script-check.yml
|
||||
sources/src/resources/init-scripts/**
|
||||
sources/test/init-scripts/**
|
||||
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
|
||||
- name: Setup Java
|
||||
if: steps.changes.outputs.any_changed == 'true' || github.event_name != 'pull_request'
|
||||
uses: actions/setup-java@dd06d9cba3e5552c54d9f8ea23572deb30010f7c # v6.0.0
|
||||
uses: actions/setup-java@be666c2fcd27ec809703dec50e508c2fdc7f6654 # v5.2.0
|
||||
with:
|
||||
distribution: temurin
|
||||
java-version: 17
|
||||
- name: Setup Gradle
|
||||
if: steps.changes.outputs.any_changed == 'true' || github.event_name != 'pull_request'
|
||||
# Use a released version to avoid breakages
|
||||
uses: gradle/actions/setup-gradle@9c971963bec38e04b3d30dcc455b5382be2fdbfb # v6.3.0
|
||||
uses: gradle/actions/setup-gradle@39e147cb9de83bb9910b8ef8bd7fff0ee20fcd6f # v6.0.1
|
||||
env:
|
||||
ALLOWED_GRADLE_WRAPPER_CHECKSUMS: e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855 # Invalid wrapper jar used for testing
|
||||
- name: Run integration tests
|
||||
if: steps.changes.outputs.any_changed == 'true' || github.event_name != 'pull_request'
|
||||
working-directory: sources/test/init-scripts
|
||||
run: ./gradlew check
|
||||
|
||||
@@ -14,16 +14,6 @@ permissions:
|
||||
contents: read
|
||||
|
||||
jobs:
|
||||
smoke-tests:
|
||||
uses: ./.github/workflows/suite-smoke-test-caching.yml
|
||||
concurrency:
|
||||
group: CI-smoke-test-caching
|
||||
cancel-in-progress: false
|
||||
with:
|
||||
skip-dist: true
|
||||
runner-os: '["ubuntu-latest", "windows-latest"]'
|
||||
secrets: inherit
|
||||
|
||||
caching-integ-tests:
|
||||
uses: ./.github/workflows/suite-integ-test-caching.yml
|
||||
concurrency:
|
||||
@@ -36,7 +26,6 @@ jobs:
|
||||
other-integ-tests:
|
||||
permissions:
|
||||
contents: write
|
||||
actions: read
|
||||
needs: caching-integ-tests
|
||||
uses: ./.github/workflows/suite-integ-test-other.yml
|
||||
concurrency:
|
||||
|
||||
@@ -19,26 +19,16 @@ jobs:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Checkout sources
|
||||
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
|
||||
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
|
||||
- name: Build and upload distribution
|
||||
if: ${{ needs.determine-suite.outputs.suite != 'full' }}
|
||||
uses: ./.github/actions/build-dist
|
||||
|
||||
smoke-tests:
|
||||
needs: build-distribution
|
||||
uses: ./.github/workflows/suite-smoke-test-caching.yml
|
||||
concurrency:
|
||||
group: CI-smoke-test-caching-${{ github.ref }}
|
||||
cancel-in-progress: false
|
||||
with:
|
||||
skip-dist: false
|
||||
runner-os: '["ubuntu-latest", "windows-latest"]'
|
||||
secrets: inherit
|
||||
|
||||
caching-integ-tests:
|
||||
needs: build-distribution
|
||||
uses: ./.github/workflows/suite-integ-test-caching.yml
|
||||
concurrency:
|
||||
group: CI-integ-test-caching-${{ github.ref }}
|
||||
group: CI-integ-test-caching
|
||||
cancel-in-progress: false
|
||||
with:
|
||||
skip-dist: false
|
||||
@@ -47,11 +37,10 @@ jobs:
|
||||
other-integ-tests:
|
||||
permissions:
|
||||
contents: write
|
||||
actions: read
|
||||
needs: caching-integ-tests
|
||||
uses: ./.github/workflows/suite-integ-test-other.yml
|
||||
concurrency:
|
||||
group: CI-integ-test-other-${{ github.ref }}
|
||||
group: CI-integ-test-other
|
||||
cancel-in-progress: false
|
||||
with:
|
||||
skip-dist: false
|
||||
@@ -63,31 +52,8 @@ jobs:
|
||||
needs: other-integ-tests
|
||||
uses: ./.github/workflows/suite-integ-test-dependency-submission.yml
|
||||
concurrency:
|
||||
group: CI-integ-test-dependency-submission-${{ github.ref }}
|
||||
group: CI-integ-test-dependency-submission
|
||||
cancel-in-progress: false
|
||||
with:
|
||||
skip-dist: false
|
||||
secrets: inherit
|
||||
|
||||
# Aggregate gate: a single check that succeeds only when all integ-test jobs succeed.
|
||||
# Require this one check in branch protection instead of every fanned-out matrix job.
|
||||
integ-test-success:
|
||||
if: ${{ always() }}
|
||||
needs:
|
||||
- build-distribution
|
||||
- smoke-tests
|
||||
- caching-integ-tests
|
||||
- other-integ-tests
|
||||
- dependency-submission-integ-tests
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Fail if any integ-test job failed or was cancelled
|
||||
if: ${{ contains(needs.*.result, 'failure') || contains(needs.*.result, 'cancelled') }}
|
||||
run: |
|
||||
echo "One or more integ-test jobs did not succeed:"
|
||||
echo " build-distribution: ${{ needs.build-distribution.result }}"
|
||||
echo " smoke-tests: ${{ needs.smoke-tests.result }}"
|
||||
echo " caching-integ-tests: ${{ needs.caching-integ-tests.result }}"
|
||||
echo " other-integ-tests: ${{ needs.other-integ-tests.result }}"
|
||||
echo " dependency-submission-integ-tests: ${{ needs.dependency-submission-integ-tests.result }}"
|
||||
exit 1
|
||||
|
||||
@@ -21,13 +21,13 @@ jobs:
|
||||
|
||||
steps:
|
||||
- name: 'Checkout code'
|
||||
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
|
||||
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
|
||||
with:
|
||||
persist-credentials: false
|
||||
show-progress: false
|
||||
|
||||
- name: 'Run analysis'
|
||||
uses: ossf/scorecard-action@2d1146689b8cda280b9bc96326124645441f03bc # v2.4.4
|
||||
uses: ossf/scorecard-action@4eaacf0543bb3f2c246792bd56e8cdeffafb205a # v2.4.3
|
||||
with:
|
||||
results_file: results.sarif
|
||||
results_format: sarif
|
||||
@@ -44,7 +44,7 @@ jobs:
|
||||
# Upload the results as artifacts (optional). Commenting out will disable uploads of run results in SARIF
|
||||
# format to the repository Actions tab.
|
||||
- name: 'Upload artifact'
|
||||
uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1
|
||||
uses: actions/upload-artifact@bbbca2ddaa5d8feaa63e36b76fdaad77386f024f # v7.0.0
|
||||
with:
|
||||
name: SARIF file
|
||||
path: results.sarif
|
||||
|
||||
@@ -23,14 +23,14 @@ jobs:
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
|
||||
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
|
||||
with:
|
||||
token: ${{ secrets.BOT_GITHUB_TOKEN }}
|
||||
|
||||
- name: Set up Node.js
|
||||
uses: actions/setup-node@820762786026740c76f36085b0efc47a31fe5020 # v7.0.0
|
||||
uses: actions/setup-node@53b83947a5a98c8d113130e565377fae1a50d02f # v6.3.0
|
||||
with:
|
||||
node-version: 24
|
||||
node-version: 20
|
||||
cache: npm
|
||||
cache-dependency-path: sources/package-lock.json
|
||||
|
||||
@@ -73,7 +73,7 @@ jobs:
|
||||
# Important: The push event will not trigger any other workflows, see
|
||||
# https://github.com/stefanzweifel/git-auto-commit-action?tab=readme-ov-file#commits-made-by-this-action-do-not-trigger-new-workflow-runs
|
||||
- name: Commit & push changes
|
||||
uses: stefanzweifel/git-auto-commit-action@4a55954c782fc1ea30b9056cd3e7a2b40ca8887d # v7.2.0
|
||||
uses: stefanzweifel/git-auto-commit-action@04702edda442b2e678b25b537cec683a1493fcb9 # v7.1.0
|
||||
with:
|
||||
commit_author: bot-githubaction <[email protected]>
|
||||
commit_user_name: bot-githubaction
|
||||
|
||||
@@ -15,7 +15,7 @@ jobs:
|
||||
validate-typings:
|
||||
runs-on: "ubuntu-latest"
|
||||
steps:
|
||||
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
|
||||
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
|
||||
- uses: typesafegithub/github-actions-typing@9ddf35b71a482be7d8922b28e8d00df16b77e315 # v2.2.2
|
||||
with:
|
||||
ignored-action-files: |
|
||||
|
||||
@@ -11,7 +11,7 @@ jobs:
|
||||
validation:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
|
||||
- uses: gradle/actions/wrapper-validation@9c971963bec38e04b3d30dcc455b5382be2fdbfb # v6.3.0
|
||||
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
|
||||
- uses: gradle/actions/wrapper-validation@39e147cb9de83bb9910b8ef8bd7fff0ee20fcd6f # v6.0.1
|
||||
with:
|
||||
allow-checksums: e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855
|
||||
|
||||
@@ -11,7 +11,7 @@ jobs:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Checkout sources
|
||||
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
|
||||
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
|
||||
- name: Build and upload distribution
|
||||
uses: ./.github/actions/build-dist
|
||||
|
||||
@@ -20,7 +20,7 @@ jobs:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Checkout sources
|
||||
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
|
||||
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
|
||||
- name: Initialize integ-test
|
||||
uses: ./.github/actions/init-integ-test
|
||||
|
||||
@@ -46,7 +46,7 @@ jobs:
|
||||
run: |
|
||||
./gradlew tasks --no-daemon
|
||||
./gradlew help check
|
||||
./gradlew :wrapper --gradle-version 8.7 --gradle-distribution-sha256-sum 544c35d6bd849ae8a5ed0bcea39ba677dc40f49df7d1835561582da2009b961d
|
||||
./gradlew wrapper --gradle-version 8.7 --gradle-distribution-sha256-sum 544c35d6bd849ae8a5ed0bcea39ba677dc40f49df7d1835561582da2009b961d
|
||||
- name: Fail groovy-dsl project
|
||||
working-directory: .github/workflow-samples/groovy-dsl
|
||||
continue-on-error: true
|
||||
@@ -57,85 +57,12 @@ jobs:
|
||||
build-root-directory: .github/workflow-samples/groovy-dsl
|
||||
dependency-graph: generate-and-upload
|
||||
|
||||
# Exercises every Gradle version support status in a single Job Summary: end-of-life versions all
|
||||
# share one expandable section and are each marked with a warning sign, out-of-date versions share
|
||||
# a single info sign and legend, and the current version is left unmarked.
|
||||
# Three end-of-life versions and two out-of-date ones exercise the plural wording throughout, and
|
||||
# the two 7.x versions alongside a 6.x one check that each affected release line is named once,
|
||||
# as "Gradle 6.x and 7.x releases".
|
||||
# Versions are picked relative to Gradle 9.x being current; revisit once Gradle 10 is released.
|
||||
support-status-eol-and-outdated:
|
||||
needs: build-distribution
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Checkout sources
|
||||
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
|
||||
# Java 11, since Gradle 6.x cannot run on the Java 17 used elsewhere in this workflow.
|
||||
- name: Initialize integ-test
|
||||
uses: ./.github/actions/init-integ-test
|
||||
with:
|
||||
java-version: '11'
|
||||
|
||||
- name: Setup Gradle 6.9.4 (end-of-life)
|
||||
uses: ./setup-gradle
|
||||
with:
|
||||
gradle-version: '6.9.4'
|
||||
- name: Build with Gradle 6.9.4
|
||||
working-directory: .github/workflow-samples/no-wrapper
|
||||
run: gradle help
|
||||
|
||||
- name: Setup Gradle 7.4 (end-of-life)
|
||||
uses: ./setup-gradle
|
||||
with:
|
||||
gradle-version: '7.4'
|
||||
- name: Build with Gradle 7.4
|
||||
working-directory: .github/workflow-samples/no-wrapper
|
||||
run: gradle help
|
||||
|
||||
- name: Setup Gradle 7.6.6 (end-of-life)
|
||||
uses: ./setup-gradle
|
||||
with:
|
||||
gradle-version: '7.6.6'
|
||||
- name: Build with Gradle 7.6.6
|
||||
working-directory: .github/workflow-samples/no-wrapper
|
||||
run: gradle help
|
||||
|
||||
- name: Setup Gradle 8.0.2 (out of date)
|
||||
uses: ./setup-gradle
|
||||
with:
|
||||
gradle-version: '8.0.2'
|
||||
- name: Build with Gradle 8.0.2
|
||||
working-directory: .github/workflow-samples/no-wrapper
|
||||
run: gradle help
|
||||
|
||||
- name: Setup Gradle 8.14.5 (out of date)
|
||||
uses: ./setup-gradle
|
||||
with:
|
||||
gradle-version: '8.14.5'
|
||||
- name: Build with Gradle 8.14.5
|
||||
working-directory: .github/workflow-samples/no-wrapper
|
||||
run: gradle help
|
||||
|
||||
# Gradle 9 and later require Java 17
|
||||
- name: Setup Java 17
|
||||
uses: actions/setup-java@dd06d9cba3e5552c54d9f8ea23572deb30010f7c # v6.0.0
|
||||
with:
|
||||
distribution: temurin
|
||||
java-version: 17
|
||||
- name: Setup Gradle current (no status reported)
|
||||
uses: ./setup-gradle
|
||||
with:
|
||||
gradle-version: current
|
||||
- name: Build with the current Gradle version
|
||||
working-directory: .github/workflow-samples/no-wrapper
|
||||
run: gradle help
|
||||
|
||||
successful-builds-with-no-summary:
|
||||
needs: build-distribution
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Checkout sources
|
||||
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
|
||||
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
|
||||
- name: Initialize integ-test
|
||||
uses: ./.github/actions/init-integ-test
|
||||
|
||||
@@ -155,7 +82,7 @@ jobs:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Checkout sources
|
||||
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
|
||||
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
|
||||
- name: Initialize integ-test
|
||||
uses: ./.github/actions/init-integ-test
|
||||
|
||||
@@ -176,7 +103,7 @@ jobs:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Checkout sources
|
||||
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
|
||||
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
|
||||
- name: Initialize integ-test
|
||||
uses: ./.github/actions/init-integ-test
|
||||
|
||||
@@ -193,7 +120,7 @@ jobs:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Checkout sources
|
||||
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
|
||||
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
|
||||
- name: Initialize integ-test
|
||||
uses: ./.github/actions/init-integ-test
|
||||
|
||||
@@ -205,29 +132,12 @@ jobs:
|
||||
working-directory: .github/workflow-samples/kotlin-dsl
|
||||
run: ./gradlew assemble
|
||||
|
||||
cache-provider-external:
|
||||
needs: build-distribution
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Checkout sources
|
||||
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
|
||||
- name: Initialize integ-test
|
||||
uses: ./.github/actions/init-integ-test
|
||||
|
||||
- name: Setup Gradle
|
||||
uses: ./setup-gradle
|
||||
with:
|
||||
cache-provider: external
|
||||
- name: Build kotlin-dsl project
|
||||
working-directory: .github/workflow-samples/kotlin-dsl
|
||||
run: ./gradlew assemble
|
||||
|
||||
basic-caching:
|
||||
needs: build-distribution
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Checkout sources
|
||||
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
|
||||
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
|
||||
- name: Initialize integ-test
|
||||
uses: ./.github/actions/init-integ-test
|
||||
|
||||
@@ -244,7 +154,7 @@ jobs:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Checkout sources
|
||||
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
|
||||
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
|
||||
- name: Initialize integ-test
|
||||
uses: ./.github/actions/init-integ-test
|
||||
|
||||
@@ -262,7 +172,7 @@ jobs:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Checkout sources
|
||||
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
|
||||
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
|
||||
- name: Initialize integ-test
|
||||
uses: ./.github/actions/init-integ-test
|
||||
|
||||
|
||||
@@ -11,7 +11,7 @@ jobs:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Checkout sources
|
||||
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
|
||||
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
|
||||
- name: Build and upload distribution
|
||||
uses: ./.github/actions/build-dist
|
||||
|
||||
@@ -22,7 +22,7 @@ jobs:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Checkout sources
|
||||
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
|
||||
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
|
||||
- name: Initialize integ-test
|
||||
uses: ./.github/actions/init-integ-test
|
||||
|
||||
@@ -42,7 +42,7 @@ jobs:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Checkout sources
|
||||
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
|
||||
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
|
||||
- name: Initialize integ-test
|
||||
uses: ./.github/actions/init-integ-test
|
||||
|
||||
@@ -62,7 +62,7 @@ jobs:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Checkout sources
|
||||
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
|
||||
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
|
||||
- name: Initialize integ-test
|
||||
uses: ./.github/actions/init-integ-test
|
||||
|
||||
|
||||
+5
-8
@@ -1,4 +1,4 @@
|
||||
name: Smoke test basic caching
|
||||
name: Test basic cache provider
|
||||
|
||||
on:
|
||||
workflow_call:
|
||||
@@ -15,7 +15,7 @@ on:
|
||||
|
||||
env:
|
||||
SKIP_DIST: ${{ inputs.skip-dist }}
|
||||
GRADLE_BUILD_ACTION_CACHE_KEY_PREFIX: smoke-test-basic-caching-${{ inputs.cache-key-prefix }}
|
||||
GRADLE_BUILD_ACTION_CACHE_KEY_PREFIX: basic-cache-provider-${{ inputs.cache-key-prefix }}
|
||||
|
||||
permissions:
|
||||
contents: read
|
||||
@@ -30,7 +30,7 @@ jobs:
|
||||
runs-on: ${{ matrix.os }}
|
||||
steps:
|
||||
- name: Checkout sources
|
||||
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
|
||||
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
|
||||
- name: Initialize integ-test
|
||||
uses: ./.github/actions/init-integ-test
|
||||
|
||||
@@ -39,12 +39,9 @@ jobs:
|
||||
with:
|
||||
cache-provider: basic
|
||||
cache-read-only: false # For testing, allow writing cache entries on non-default branches
|
||||
# Basic caching does no daemon management, so the workflow must ensure no daemon is left
|
||||
# holding locks on the Gradle User Home when the post-action save runs. Without this, `tar`
|
||||
# cannot read the Gradle '*.lock' files on Windows and the cache entry is never saved.
|
||||
- name: Build kotlin-dsl project
|
||||
working-directory: .github/workflow-samples/kotlin-dsl
|
||||
run: ./gradlew build --no-daemon
|
||||
run: ./gradlew build
|
||||
|
||||
basic-cache-verify-build:
|
||||
needs: basic-cache-seed-build
|
||||
@@ -56,7 +53,7 @@ jobs:
|
||||
runs-on: ${{ matrix.os }}
|
||||
steps:
|
||||
- name: Checkout sources
|
||||
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
|
||||
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
|
||||
- name: Initialize integ-test
|
||||
uses: ./.github/actions/init-integ-test
|
||||
|
||||
@@ -41,7 +41,7 @@ jobs:
|
||||
runs-on: ${{ matrix.os }}
|
||||
steps:
|
||||
- name: Checkout sources
|
||||
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
|
||||
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
|
||||
- name: Initialize integ-test
|
||||
uses: ./.github/actions/init-integ-test
|
||||
with:
|
||||
@@ -62,7 +62,7 @@ jobs:
|
||||
run: gradle help
|
||||
- name: Check Build Scan url
|
||||
if: ${{ !steps.gradle.outputs.build-scan-url }}
|
||||
uses: actions/github-script@3a2844b7e9c422d3c10d287c895573f7108da1b3 # v9.0.0
|
||||
uses: actions/github-script@ed597411d8f924073f98dfc5c65a23a2325f34cd # v8.0.0
|
||||
with:
|
||||
script: |
|
||||
core.setFailed('No Build Scan detected')
|
||||
|
||||
@@ -32,7 +32,7 @@ jobs:
|
||||
runs-on: ${{ matrix.os }}
|
||||
steps:
|
||||
- name: Checkout sources
|
||||
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
|
||||
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
|
||||
- name: Initialize integ-test
|
||||
uses: ./.github/actions/init-integ-test
|
||||
|
||||
@@ -57,7 +57,7 @@ jobs:
|
||||
runs-on: ${{ matrix.os }}
|
||||
steps:
|
||||
- name: Checkout sources
|
||||
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
|
||||
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
|
||||
- name: Initialize integ-test
|
||||
uses: ./.github/actions/init-integ-test
|
||||
|
||||
@@ -83,7 +83,7 @@ jobs:
|
||||
runs-on: ${{ matrix.os }}
|
||||
steps:
|
||||
- name: Checkout sources
|
||||
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
|
||||
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
|
||||
- name: Initialize integ-test
|
||||
uses: ./.github/actions/init-integ-test
|
||||
|
||||
|
||||
@@ -30,7 +30,7 @@ jobs:
|
||||
runs-on: ${{ matrix.os }}
|
||||
steps:
|
||||
- name: Checkout sources
|
||||
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
|
||||
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
|
||||
- name: Initialize integ-test
|
||||
uses: ./.github/actions/init-integ-test
|
||||
|
||||
@@ -62,7 +62,7 @@ jobs:
|
||||
runs-on: ${{ matrix.os }}
|
||||
steps:
|
||||
- name: Checkout sources
|
||||
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
|
||||
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
|
||||
- name: Initialize integ-test
|
||||
uses: ./.github/actions/init-integ-test
|
||||
|
||||
@@ -91,7 +91,7 @@ jobs:
|
||||
runs-on: ${{ matrix.os }}
|
||||
steps:
|
||||
- name: Checkout sources
|
||||
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
|
||||
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
|
||||
- name: Initialize integ-test
|
||||
uses: ./.github/actions/init-integ-test
|
||||
|
||||
@@ -105,7 +105,7 @@ jobs:
|
||||
run: ./gradlew help
|
||||
- name: Check Build Scan url is captured
|
||||
if: ${{ !steps.gradle.outputs.build-scan-url }}
|
||||
uses: actions/github-script@3a2844b7e9c422d3c10d287c895573f7108da1b3 # v9.0.0
|
||||
uses: actions/github-script@ed597411d8f924073f98dfc5c65a23a2325f34cd # v8.0.0
|
||||
with:
|
||||
script: |
|
||||
core.setFailed('No Build Scan detected')
|
||||
@@ -115,7 +115,7 @@ jobs:
|
||||
runs-on: ubuntu-latest # This test only runs on Ubuntu
|
||||
steps:
|
||||
- name: Checkout sources
|
||||
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
|
||||
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
|
||||
- name: Initialize integ-test
|
||||
uses: ./.github/actions/init-integ-test
|
||||
|
||||
@@ -129,31 +129,7 @@ jobs:
|
||||
run: ./gradlew help
|
||||
- name: Check Build Scan url is captured
|
||||
if: ${{ !steps.gradle.outputs.build-scan-url }}
|
||||
uses: actions/github-script@3a2844b7e9c422d3c10d287c895573f7108da1b3 # v9.0.0
|
||||
with:
|
||||
script: |
|
||||
core.setFailed('No Build Scan detected')
|
||||
|
||||
# Test that build scans are captured when caching is external
|
||||
caching-config-cache-provider-external:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Checkout sources
|
||||
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
|
||||
- name: Initialize integ-test
|
||||
uses: ./.github/actions/init-integ-test
|
||||
|
||||
- name: Setup Gradle
|
||||
uses: ./setup-gradle
|
||||
with:
|
||||
cache-provider: external
|
||||
- name: Build using Gradle wrapper
|
||||
id: gradle
|
||||
working-directory: .github/workflow-samples/groovy-dsl
|
||||
run: ./gradlew help
|
||||
- name: Check Build Scan url is captured
|
||||
if: ${{ !steps.gradle.outputs.build-scan-url }}
|
||||
uses: actions/github-script@3a2844b7e9c422d3c10d287c895573f7108da1b3 # v9.0.0
|
||||
uses: actions/github-script@ed597411d8f924073f98dfc5c65a23a2325f34cd # v8.0.0
|
||||
with:
|
||||
script: |
|
||||
core.setFailed('No Build Scan detected')
|
||||
@@ -170,7 +146,7 @@ jobs:
|
||||
runs-on: ${{ matrix.os }}
|
||||
steps:
|
||||
- name: Checkout sources
|
||||
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
|
||||
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
|
||||
- name: Initialize integ-test
|
||||
uses: ./.github/actions/init-integ-test
|
||||
|
||||
@@ -194,7 +170,7 @@ jobs:
|
||||
runs-on: ${{ matrix.os }}
|
||||
steps:
|
||||
- name: Checkout sources
|
||||
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
|
||||
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
|
||||
- name: Initialize integ-test
|
||||
uses: ./.github/actions/init-integ-test
|
||||
|
||||
|
||||
@@ -26,7 +26,7 @@ jobs:
|
||||
runs-on: "ubuntu-latest"
|
||||
steps:
|
||||
- name: Checkout sources
|
||||
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
|
||||
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
|
||||
- name: Initialize integ-test
|
||||
uses: ./.github/actions/init-integ-test
|
||||
|
||||
@@ -45,7 +45,7 @@ jobs:
|
||||
runs-on: "ubuntu-latest"
|
||||
steps:
|
||||
- name: Checkout sources
|
||||
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
|
||||
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
|
||||
- name: Initialize integ-test
|
||||
uses: ./.github/actions/init-integ-test
|
||||
|
||||
@@ -62,7 +62,7 @@ jobs:
|
||||
runs-on: "ubuntu-latest"
|
||||
steps:
|
||||
- name: Checkout sources
|
||||
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
|
||||
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
|
||||
- name: Initialize integ-test
|
||||
uses: ./.github/actions/init-integ-test
|
||||
|
||||
@@ -80,7 +80,7 @@ jobs:
|
||||
runs-on: "ubuntu-latest"
|
||||
steps:
|
||||
- name: Checkout sources
|
||||
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
|
||||
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
|
||||
- name: Initialize integ-test
|
||||
uses: ./.github/actions/init-integ-test
|
||||
|
||||
@@ -123,7 +123,7 @@ jobs:
|
||||
runs-on: ubuntu-latest # Test is not compatible with Windows
|
||||
steps:
|
||||
- name: Checkout sources
|
||||
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
|
||||
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
|
||||
- name: Initialize integ-test
|
||||
uses: ./.github/actions/init-integ-test
|
||||
|
||||
@@ -160,7 +160,7 @@ jobs:
|
||||
runs-on: "ubuntu-latest"
|
||||
steps:
|
||||
- name: Checkout sources
|
||||
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
|
||||
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
|
||||
- name: Initialize integ-test
|
||||
uses: ./.github/actions/init-integ-test
|
||||
|
||||
|
||||
@@ -26,7 +26,7 @@ jobs:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Checkout sources
|
||||
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
|
||||
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
|
||||
- name: Initialize integ-test
|
||||
uses: ./.github/actions/init-integ-test
|
||||
|
||||
@@ -55,7 +55,7 @@ jobs:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Checkout sources
|
||||
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
|
||||
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
|
||||
- name: Initialize integ-test
|
||||
uses: ./.github/actions/init-integ-test
|
||||
|
||||
@@ -86,7 +86,7 @@ jobs:
|
||||
contents: read
|
||||
steps:
|
||||
- name: Checkout sources
|
||||
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
|
||||
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
|
||||
- name: Initialize integ-test
|
||||
uses: ./.github/actions/init-integ-test
|
||||
|
||||
|
||||
@@ -33,7 +33,7 @@ jobs:
|
||||
runs-on: ${{ matrix.os }}
|
||||
steps:
|
||||
- name: Checkout sources
|
||||
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
|
||||
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
|
||||
- name: Initialize integ-test
|
||||
uses: ./.github/actions/init-integ-test
|
||||
|
||||
@@ -58,7 +58,7 @@ jobs:
|
||||
runs-on: ${{ matrix.os }}
|
||||
steps:
|
||||
- name: Checkout sources
|
||||
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
|
||||
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
|
||||
- name: Initialize integ-test
|
||||
uses: ./.github/actions/init-integ-test
|
||||
|
||||
@@ -82,7 +82,7 @@ jobs:
|
||||
runs-on: ${{ matrix.os }}
|
||||
steps:
|
||||
- name: Checkout sources
|
||||
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
|
||||
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
|
||||
- name: Initialize integ-test
|
||||
uses: ./.github/actions/init-integ-test
|
||||
|
||||
@@ -104,7 +104,7 @@ jobs:
|
||||
runs-on: ${{ matrix.os }}
|
||||
steps:
|
||||
- name: Checkout sources
|
||||
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
|
||||
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
|
||||
- name: Initialize integ-test
|
||||
uses: ./.github/actions/init-integ-test
|
||||
|
||||
@@ -124,7 +124,7 @@ jobs:
|
||||
runs-on: ${{ matrix.os }}
|
||||
steps:
|
||||
- name: Checkout sources
|
||||
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
|
||||
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
|
||||
- name: Initialize integ-test
|
||||
uses: ./.github/actions/init-integ-test
|
||||
|
||||
@@ -172,7 +172,7 @@ jobs:
|
||||
runs-on: ${{ matrix.os }}
|
||||
steps:
|
||||
- name: Checkout sources
|
||||
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
|
||||
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
|
||||
- name: Initialize integ-test
|
||||
uses: ./.github/actions/init-integ-test
|
||||
|
||||
@@ -193,7 +193,7 @@ jobs:
|
||||
runs-on: ubuntu-latest # Test is not compatible with Windows
|
||||
steps:
|
||||
- name: Checkout sources
|
||||
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
|
||||
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
|
||||
- name: Initialize integ-test
|
||||
uses: ./.github/actions/init-integ-test
|
||||
|
||||
@@ -255,7 +255,7 @@ jobs:
|
||||
runs-on: ${{ matrix.os }}
|
||||
steps:
|
||||
- name: Checkout sources
|
||||
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
|
||||
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
|
||||
- name: Initialize integ-test
|
||||
uses: ./.github/actions/init-integ-test
|
||||
with:
|
||||
@@ -272,7 +272,7 @@ jobs:
|
||||
runs-on: ubuntu-latest # Test is not compatible with Windows
|
||||
steps:
|
||||
- name: Checkout sources
|
||||
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
|
||||
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
|
||||
- name: Initialize integ-test
|
||||
uses: ./.github/actions/init-integ-test
|
||||
|
||||
@@ -309,7 +309,7 @@ jobs:
|
||||
runs-on: ubuntu-latest # Test is not compatible with Windows
|
||||
steps:
|
||||
- name: Checkout sources
|
||||
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
|
||||
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
|
||||
- name: Initialize integ-test
|
||||
uses: ./.github/actions/init-integ-test
|
||||
|
||||
@@ -350,7 +350,7 @@ jobs:
|
||||
runs-on: ${{ matrix.os }}
|
||||
steps:
|
||||
- name: Checkout sources
|
||||
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
|
||||
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
|
||||
- name: Initialize integ-test
|
||||
uses: ./.github/actions/init-integ-test
|
||||
|
||||
@@ -382,7 +382,7 @@ jobs:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Checkout sources
|
||||
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
|
||||
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
|
||||
- name: Initialize integ-test
|
||||
uses: ./.github/actions/init-integ-test
|
||||
|
||||
@@ -401,7 +401,7 @@ jobs:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Checkout sources
|
||||
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
|
||||
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
|
||||
- name: Initialize integ-test
|
||||
uses: ./.github/actions/init-integ-test
|
||||
|
||||
|
||||
@@ -30,7 +30,7 @@ jobs:
|
||||
runs-on: ${{ matrix.os }}
|
||||
steps:
|
||||
- name: Checkout sources
|
||||
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
|
||||
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
|
||||
- name: Initialize integ-test
|
||||
uses: ./.github/actions/init-integ-test
|
||||
|
||||
@@ -60,24 +60,20 @@ jobs:
|
||||
runs-on: ${{ matrix.os }}
|
||||
steps:
|
||||
- name: Checkout sources
|
||||
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
|
||||
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
|
||||
- name: Initialize integ-test
|
||||
uses: ./.github/actions/init-integ-test
|
||||
|
||||
- name: Setup Java 16
|
||||
uses: actions/setup-java@dd06d9cba3e5552c54d9f8ea23572deb30010f7c # v6.0.0
|
||||
uses: actions/setup-java@be666c2fcd27ec809703dec50e508c2fdc7f6654 # v5.2.0
|
||||
with:
|
||||
distribution: 'temurin'
|
||||
java-version: 16
|
||||
# Temurin 16 is EOL and publishes no signatures: setup-java v6 enables verify-signature by default
|
||||
verify-signature: false
|
||||
- name: Setup Java 20
|
||||
uses: actions/setup-java@dd06d9cba3e5552c54d9f8ea23572deb30010f7c # v6.0.0
|
||||
uses: actions/setup-java@be666c2fcd27ec809703dec50e508c2fdc7f6654 # v5.2.0
|
||||
with:
|
||||
distribution: 'temurin'
|
||||
java-version: 20
|
||||
# Temurin 20 is EOL and publishes no signatures: setup-java v6 enables verify-signature by default
|
||||
verify-signature: false
|
||||
- name: Setup Gradle
|
||||
uses: ./setup-gradle
|
||||
- name: List detected toolchains
|
||||
|
||||
@@ -1,148 +0,0 @@
|
||||
name: Test Gradle support status reporting
|
||||
|
||||
on:
|
||||
workflow_call:
|
||||
inputs:
|
||||
cache-key-prefix:
|
||||
type: string
|
||||
default: '0'
|
||||
skip-dist:
|
||||
type: boolean
|
||||
default: false
|
||||
|
||||
env:
|
||||
SKIP_DIST: ${{ inputs.skip-dist }}
|
||||
GRADLE_BUILD_ACTION_CACHE_KEY_PREFIX: gradle-support-status-${{ inputs.cache-key-prefix }}
|
||||
|
||||
permissions:
|
||||
contents: read
|
||||
|
||||
jobs:
|
||||
report-outdated-versions:
|
||||
runs-on: ubuntu-latest
|
||||
outputs:
|
||||
prev-oldest: ${{ steps.versions.outputs.prev-oldest }}
|
||||
prev-newest: ${{ steps.versions.outputs.prev-newest }}
|
||||
steps:
|
||||
- name: Checkout sources
|
||||
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
|
||||
- name: Initialize integ-test
|
||||
uses: ./.github/actions/init-integ-test
|
||||
|
||||
# Derived from the bundled release data so the expectations cannot drift from the action's own view.
|
||||
- name: Determine versions for each support status
|
||||
id: versions
|
||||
run: |
|
||||
set -euo pipefail
|
||||
eval "$(jq -r '
|
||||
[ .[].version
|
||||
| select(test("^[0-9]+\\.[0-9]+(\\.[0-9]+)?$"))
|
||||
| {v: ., k: (((split(".") | map(tonumber)) + [0, 0, 0]) | .[0:3])}
|
||||
]
|
||||
| sort_by(.k) as $finals
|
||||
| ($finals | last) as $latest
|
||||
| [$finals[] | select(.k[0] == $latest.k[0] - 1)] as $prev
|
||||
| "KNOWN_LATEST=\($latest.v)",
|
||||
"PREV_OLDEST=\($prev | first | .v)",
|
||||
"PREV_NEWEST=\($prev | last | .v)"
|
||||
' sources/src/wrapper-validation/wrapper-checksums.json)"
|
||||
|
||||
echo "Known latest : ${KNOWN_LATEST}"
|
||||
echo "Previous major, oldest : ${PREV_OLDEST}"
|
||||
echo "Previous major, newest : ${PREV_NEWEST}"
|
||||
|
||||
{
|
||||
echo "prev-oldest=${PREV_OLDEST}"
|
||||
echo "prev-newest=${PREV_NEWEST}"
|
||||
} >> "$GITHUB_OUTPUT"
|
||||
|
||||
- name: Setup Gradle with an end-of-life version
|
||||
uses: ./setup-gradle
|
||||
with:
|
||||
cache-read-only: false
|
||||
gradle-version: '7.6.4'
|
||||
- name: Build with the end-of-life version
|
||||
working-directory: .github/workflow-samples/no-wrapper
|
||||
run: gradle help "-DgradleVersionCheck=7.6.4"
|
||||
|
||||
- name: Setup Gradle with the oldest release of the previous major
|
||||
uses: ./setup-gradle
|
||||
with:
|
||||
gradle-version: ${{ steps.versions.outputs.prev-oldest }}
|
||||
- name: Build with the oldest release of the previous major
|
||||
working-directory: .github/workflow-samples/no-wrapper
|
||||
run: gradle help "-DgradleVersionCheck=${{ steps.versions.outputs.prev-oldest }}"
|
||||
|
||||
- name: Setup Gradle with the newest release of the previous major
|
||||
uses: ./setup-gradle
|
||||
with:
|
||||
gradle-version: ${{ steps.versions.outputs.prev-newest }}
|
||||
- name: Build with the newest release of the previous major
|
||||
working-directory: .github/workflow-samples/no-wrapper
|
||||
run: gradle help "-DgradleVersionCheck=${{ steps.versions.outputs.prev-newest }}"
|
||||
|
||||
verify-report:
|
||||
needs: report-outdated-versions
|
||||
runs-on: ubuntu-latest
|
||||
permissions:
|
||||
contents: read
|
||||
actions: read
|
||||
steps:
|
||||
- name: Check the support-status report was emitted
|
||||
env:
|
||||
GH_TOKEN: ${{ github.token }}
|
||||
PREV_OLDEST: ${{ needs.report-outdated-versions.outputs.prev-oldest }}
|
||||
PREV_NEWEST: ${{ needs.report-outdated-versions.outputs.prev-newest }}
|
||||
run: |
|
||||
set -euo pipefail
|
||||
|
||||
job_id=$(gh api \
|
||||
"/repos/${GITHUB_REPOSITORY}/actions/runs/${GITHUB_RUN_ID}/attempts/${GITHUB_RUN_ATTEMPT}/jobs" \
|
||||
--paginate --jq '.jobs[] | select(.name | endswith("report-outdated-versions")) | .id')
|
||||
if [ -z "$job_id" ]; then
|
||||
echo "Could not find the 'report-outdated-versions' Job in this workflow run"
|
||||
exit 1
|
||||
fi
|
||||
gh api --allow-escape-sequences "/repos/${GITHUB_REPOSITORY}/actions/jobs/${job_id}/logs" > job.log
|
||||
|
||||
assert_logged() {
|
||||
if ! grep -qF -- "$1" job.log; then
|
||||
echo "Expected the Job log to contain: $1"
|
||||
echo "--- support-status output found instead ---"
|
||||
grep -E '##\[(warning|notice)\]|<summary>:warning:|consider upgrading' job.log || echo "(none)"
|
||||
exit 1
|
||||
fi
|
||||
}
|
||||
refute_logged() {
|
||||
if grep -qF -- "$1" job.log; then
|
||||
echo "Did not expect the Job log to contain: $1"
|
||||
exit 1
|
||||
fi
|
||||
}
|
||||
|
||||
# The runner renders '::warning::'/'::notice::' into the log as '##[warning]'/'##[notice]'.
|
||||
assert_logged "##[warning]Gradle 7.6.4 is end-of-life"
|
||||
assert_logged "##[notice]Gradle ${PREV_OLDEST} is out of date: consider updating to the latest Gradle version."
|
||||
assert_logged "##[notice]Gradle ${PREV_NEWEST} is out of date: consider updating to the latest Gradle version."
|
||||
|
||||
# Out-of-date versions get a notice, never a warning.
|
||||
refute_logged "##[warning]Gradle ${PREV_OLDEST}"
|
||||
refute_logged "##[warning]Gradle ${PREV_NEWEST}"
|
||||
|
||||
# The job summary is echoed to the log, so the rendered report can be checked directly.
|
||||
assert_logged "<summary>:warning: Gradle 7.6.4 is end-of-life</summary>"
|
||||
assert_logged "Update to the latest Gradle version."
|
||||
assert_logged "<a href=\"https://gradle.org/security-subscription/?utm_source=github-action\">Gradle Security Subscription</a>"
|
||||
|
||||
# Table signs: a warning for end-of-life, the info sign for everything still supported.
|
||||
assert_logged "<td align='center'>7.6.4 :warning:</td>"
|
||||
assert_logged "<td align='center'>${PREV_OLDEST} :information_source:</td>"
|
||||
assert_logged "<td align='center'>${PREV_NEWEST} :information_source:</td>"
|
||||
|
||||
# One legend for the whole job, no matter how many versions carry the info sign.
|
||||
legends=$(grep -cF -- "consider upgrading" job.log || true)
|
||||
if [ "$legends" != "1" ]; then
|
||||
echo "Expected exactly one upgrade legend, found ${legends}"
|
||||
exit 1
|
||||
fi
|
||||
assert_logged "<p>:information_source: Gradle version is out of date — consider upgrading. See <a href=\"https://docs.gradle.org/current/userguide/feature_lifecycle.html#eol_support\">Gradle release lifecycle</a></p>"
|
||||
@@ -30,7 +30,7 @@ jobs:
|
||||
matrix:
|
||||
gradle: ['current', '8.14.3', '7.6.2', '6.9.4', '5.6.4']
|
||||
os: ${{fromJSON(inputs.runner-os)}}
|
||||
plugin-version: ['3.16.2', '4.5.1']
|
||||
plugin-version: ['3.16.2', '4.4.0']
|
||||
include:
|
||||
- java-version: 17
|
||||
- gradle: '8.14.3'
|
||||
@@ -43,7 +43,7 @@ jobs:
|
||||
java-version: 11
|
||||
- plugin-version: '3.16.2'
|
||||
accessKeyEnv: GRADLE_ENTERPRISE_ACCESS_KEY
|
||||
- plugin-version: '4.5.1'
|
||||
- plugin-version: '4.4.0'
|
||||
accessKeyEnv: DEVELOCITY_ACCESS_KEY
|
||||
runs-on: ${{ matrix.os }}
|
||||
env:
|
||||
@@ -55,7 +55,7 @@ jobs:
|
||||
|
||||
steps:
|
||||
- name: Checkout sources
|
||||
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
|
||||
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
|
||||
- name: Initialize integ-test
|
||||
uses: ./.github/actions/init-integ-test
|
||||
with:
|
||||
@@ -72,7 +72,7 @@ jobs:
|
||||
run: gradle help
|
||||
- name: Check Build Scan url
|
||||
if: ${{ !steps.gradle.outputs.build-scan-url }}
|
||||
uses: actions/github-script@3a2844b7e9c422d3c10d287c895573f7108da1b3 # v9.0.0
|
||||
uses: actions/github-script@ed597411d8f924073f98dfc5c65a23a2325f34cd # v8.0.0
|
||||
with:
|
||||
script: |
|
||||
core.setFailed('No Build Scan detected')
|
||||
@@ -92,7 +92,7 @@ jobs:
|
||||
matrix:
|
||||
gradle: ['current', '8.14.3', '7.6.2', '6.9.4', '5.6.4']
|
||||
os: ${{fromJSON(inputs.runner-os)}}
|
||||
plugin-version: ['3.16.2', '4.5.1']
|
||||
plugin-version: ['3.16.2', '4.4.0']
|
||||
include:
|
||||
- java-version: 17
|
||||
- gradle: '8.14.3'
|
||||
@@ -106,7 +106,7 @@ jobs:
|
||||
runs-on: ${{ matrix.os }}
|
||||
steps:
|
||||
- name: Checkout sources
|
||||
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
|
||||
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
|
||||
- name: Initialize integ-test
|
||||
uses: ./.github/actions/init-integ-test
|
||||
with:
|
||||
@@ -129,7 +129,7 @@ jobs:
|
||||
run: "[ ${#GRADLE_ENTERPRISE_ACCESS_KEY} -gt 500 ] || (echo 'GRADLE_ENTERPRISE_ACCESS_KEY does not look like a short lived token'; exit 1)"
|
||||
- name: Check Build Scan url
|
||||
if: ${{ !steps.gradle.outputs.build-scan-url }}
|
||||
uses: actions/github-script@3a2844b7e9c422d3c10d287c895573f7108da1b3 # v9.0.0
|
||||
uses: actions/github-script@ed597411d8f924073f98dfc5c65a23a2325f34cd # v8.0.0
|
||||
with:
|
||||
script: |
|
||||
core.setFailed('No Build Scan detected')
|
||||
@@ -148,7 +148,7 @@ jobs:
|
||||
matrix:
|
||||
gradle: ['current', '8.14.3', '7.6.2', '6.9.4', '5.6.4']
|
||||
os: ${{fromJSON(inputs.runner-os)}}
|
||||
plugin-version: [ '3.16.2', '4.5.1' ]
|
||||
plugin-version: [ '3.16.2', '4.4.0' ]
|
||||
include:
|
||||
- java-version: 17
|
||||
- gradle: '8.14.3'
|
||||
@@ -162,7 +162,7 @@ jobs:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Checkout sources
|
||||
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
|
||||
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
|
||||
- name: Initialize integ-test
|
||||
uses: ./.github/actions/init-integ-test
|
||||
with:
|
||||
@@ -191,7 +191,7 @@ jobs:
|
||||
matrix:
|
||||
gradle: ['current', '8.14.3', '7.6.2', '6.9.4', '5.6.4']
|
||||
os: ${{fromJSON(inputs.runner-os)}}
|
||||
plugin-version: [ '3.16.2', '4.5.1' ]
|
||||
plugin-version: [ '3.16.2', '4.4.0' ]
|
||||
include:
|
||||
- java-version: 17
|
||||
- gradle: '8.14.3'
|
||||
@@ -205,7 +205,7 @@ jobs:
|
||||
runs-on: ${{ matrix.os }}
|
||||
steps:
|
||||
- name: Checkout sources
|
||||
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
|
||||
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
|
||||
- name: Initialize integ-test
|
||||
uses: ./.github/actions/init-integ-test
|
||||
with:
|
||||
@@ -225,7 +225,7 @@ jobs:
|
||||
run: gradle help
|
||||
- name: Check Build Scan url
|
||||
if: ${{ !steps.gradle.outputs.build-scan-url }}
|
||||
uses: actions/github-script@3a2844b7e9c422d3c10d287c895573f7108da1b3 # v9.0.0
|
||||
uses: actions/github-script@ed597411d8f924073f98dfc5c65a23a2325f34cd # v8.0.0
|
||||
with:
|
||||
script: |
|
||||
core.setFailed('No Build Scan detected')
|
||||
|
||||
@@ -33,7 +33,7 @@ jobs:
|
||||
runs-on: ${{ matrix.os }}
|
||||
steps:
|
||||
- name: Checkout sources
|
||||
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
|
||||
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
|
||||
- name: Initialize integ-test
|
||||
uses: ./.github/actions/init-integ-test
|
||||
with:
|
||||
@@ -56,7 +56,7 @@ jobs:
|
||||
run: gradle help "-DgradleVersionCheck=7.1.1"
|
||||
# Configure JDK 17 for Gradle 9 and later
|
||||
- name: Setup Java
|
||||
uses: actions/setup-java@dd06d9cba3e5552c54d9f8ea23572deb30010f7c # v6.0.0
|
||||
uses: actions/setup-java@be666c2fcd27ec809703dec50e508c2fdc7f6654 # v5.2.0
|
||||
with:
|
||||
distribution: temurin
|
||||
java-version: 17
|
||||
@@ -77,7 +77,7 @@ jobs:
|
||||
run: gradle help
|
||||
- name: Check current version output parameter
|
||||
if: ${{ !startsWith(steps.gradle-current.outputs.gradle-version , '9.') }}
|
||||
uses: actions/github-script@3a2844b7e9c422d3c10d287c895573f7108da1b3 # v9.0.0
|
||||
uses: actions/github-script@ed597411d8f924073f98dfc5c65a23a2325f34cd # v8.0.0
|
||||
with:
|
||||
script: |
|
||||
core.setFailed('Gradle version parameter not set correctly: value was "${{ steps.gradle-current.outputs.gradle-version }}"')
|
||||
@@ -105,12 +105,12 @@ jobs:
|
||||
runs-on: ${{ matrix.os }}
|
||||
steps:
|
||||
- name: Checkout sources
|
||||
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
|
||||
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
|
||||
- name: Initialize integ-test
|
||||
uses: ./.github/actions/init-integ-test
|
||||
|
||||
- name: Setup Java
|
||||
uses: actions/setup-java@dd06d9cba3e5552c54d9f8ea23572deb30010f7c # v6.0.0
|
||||
uses: actions/setup-java@be666c2fcd27ec809703dec50e508c2fdc7f6654 # v5.2.0
|
||||
with:
|
||||
distribution: temurin
|
||||
java-version: ${{ matrix.java-version }}
|
||||
@@ -122,7 +122,7 @@ jobs:
|
||||
gradle-version: ${{ matrix.gradle }}
|
||||
- name: Check output parameter
|
||||
if: ${{ steps.setup-gradle.outputs.gradle-version != matrix.gradle }}
|
||||
uses: actions/github-script@3a2844b7e9c422d3c10d287c895573f7108da1b3 # v9.0.0
|
||||
uses: actions/github-script@ed597411d8f924073f98dfc5c65a23a2325f34cd # v8.0.0
|
||||
with:
|
||||
script: |
|
||||
core.setFailed('Gradle version parameter not set correctly: value was "${{ steps.setup-gradle.outputs.gradle-version }}"')
|
||||
@@ -132,7 +132,7 @@ jobs:
|
||||
run: gradle help "-DgradleVersionCheck=${{matrix.gradle}}"
|
||||
- name: Check Build Scan url
|
||||
if: ${{ !steps.gradle.outputs.build-scan-url }}
|
||||
uses: actions/github-script@3a2844b7e9c422d3c10d287c895573f7108da1b3 # v9.0.0
|
||||
uses: actions/github-script@ed597411d8f924073f98dfc5c65a23a2325f34cd # v8.0.0
|
||||
with:
|
||||
script: |
|
||||
core.setFailed('No Build Scan detected')
|
||||
|
||||
@@ -24,7 +24,7 @@ jobs:
|
||||
container: fedora:latest
|
||||
steps:
|
||||
- name: Checkout sources
|
||||
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
|
||||
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
|
||||
- name: Initialize integ-test
|
||||
uses: ./.github/actions/init-integ-test
|
||||
|
||||
@@ -43,7 +43,7 @@ jobs:
|
||||
container: fedora:latest
|
||||
steps:
|
||||
- name: Checkout sources
|
||||
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
|
||||
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
|
||||
- name: Initialize integ-test
|
||||
uses: ./.github/actions/init-integ-test
|
||||
|
||||
|
||||
@@ -23,7 +23,7 @@ jobs:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Checkout sources
|
||||
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
|
||||
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
|
||||
- name: Initialize integ-test
|
||||
uses: ./.github/actions/init-integ-test
|
||||
|
||||
@@ -45,7 +45,7 @@ jobs:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Checkout sources
|
||||
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
|
||||
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
|
||||
- name: Initialize integ-test
|
||||
uses: ./.github/actions/init-integ-test
|
||||
|
||||
@@ -67,7 +67,7 @@ jobs:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Checkout sources
|
||||
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
|
||||
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
|
||||
- name: Initialize integ-test
|
||||
uses: ./.github/actions/init-integ-test
|
||||
|
||||
|
||||
@@ -31,7 +31,7 @@ jobs:
|
||||
runs-on: ${{ matrix.os }}
|
||||
steps:
|
||||
- name: Checkout sources
|
||||
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
|
||||
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
|
||||
- name: Initialize integ-test
|
||||
uses: ./.github/actions/init-integ-test
|
||||
|
||||
@@ -43,6 +43,29 @@ jobs:
|
||||
working-directory: .github/workflow-samples/groovy-dsl
|
||||
run: ./gradlew test
|
||||
|
||||
# Test that the gradle-user-home cache will cache dependencies, by running build with --offline
|
||||
restore-gradle-home-dependencies-cache:
|
||||
needs: restore-gradle-home-seed-build
|
||||
strategy:
|
||||
max-parallel: 1
|
||||
fail-fast: false
|
||||
matrix:
|
||||
os: ${{fromJSON(inputs.runner-os)}}
|
||||
runs-on: ${{ matrix.os }}
|
||||
steps:
|
||||
- name: Checkout sources
|
||||
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
|
||||
- name: Initialize integ-test
|
||||
uses: ./.github/actions/init-integ-test
|
||||
|
||||
- name: Setup Gradle
|
||||
uses: ./setup-gradle
|
||||
with:
|
||||
cache-read-only: true
|
||||
- name: Execute Gradle build with --offline
|
||||
working-directory: .github/workflow-samples/groovy-dsl
|
||||
run: ./gradlew test --offline
|
||||
|
||||
# Test that the gradle-user-home cache will cache and restore local build-cache
|
||||
restore-gradle-home-build-cache:
|
||||
needs: restore-gradle-home-seed-build
|
||||
@@ -54,7 +77,7 @@ jobs:
|
||||
runs-on: ${{ matrix.os }}
|
||||
steps:
|
||||
- name: Checkout sources
|
||||
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
|
||||
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
|
||||
- name: Initialize integ-test
|
||||
uses: ./.github/actions/init-integ-test
|
||||
|
||||
@@ -77,7 +100,7 @@ jobs:
|
||||
runs-on: ${{ matrix.os }}
|
||||
steps:
|
||||
- name: Checkout sources
|
||||
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
|
||||
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
|
||||
- name: Initialize integ-test
|
||||
uses: ./.github/actions/init-integ-test
|
||||
|
||||
@@ -102,7 +125,7 @@ jobs:
|
||||
runs-on: ${{ matrix.os }}
|
||||
steps:
|
||||
- name: Checkout sources
|
||||
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
|
||||
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
|
||||
- name: Initialize integ-test
|
||||
uses: ./.github/actions/init-integ-test
|
||||
|
||||
|
||||
@@ -31,7 +31,7 @@ jobs:
|
||||
runs-on: ${{ matrix.os }}
|
||||
steps:
|
||||
- name: Checkout sources
|
||||
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
|
||||
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
|
||||
- name: Initialize integ-test
|
||||
uses: ./.github/actions/init-integ-test
|
||||
with:
|
||||
@@ -56,7 +56,7 @@ jobs:
|
||||
runs-on: ${{ matrix.os }}
|
||||
steps:
|
||||
- name: Checkout sources
|
||||
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
|
||||
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
|
||||
- name: Initialize integ-test
|
||||
uses: ./.github/actions/init-integ-test
|
||||
with:
|
||||
|
||||
@@ -30,7 +30,7 @@ jobs:
|
||||
runs-on: ${{ matrix.os }}
|
||||
steps:
|
||||
- name: Checkout sources
|
||||
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
|
||||
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
|
||||
- name: Initialize integ-test
|
||||
uses: ./.github/actions/init-integ-test
|
||||
|
||||
@@ -52,7 +52,7 @@ jobs:
|
||||
runs-on: ${{ matrix.os }}
|
||||
steps:
|
||||
- name: Checkout sources
|
||||
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
|
||||
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
|
||||
- name: Initialize integ-test
|
||||
uses: ./.github/actions/init-integ-test
|
||||
|
||||
|
||||
@@ -30,7 +30,7 @@ jobs:
|
||||
runs-on: ${{ matrix.os }}
|
||||
steps:
|
||||
- name: Checkout sources
|
||||
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
|
||||
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
|
||||
- name: Initialize integ-test
|
||||
uses: ./.github/actions/init-integ-test
|
||||
|
||||
@@ -52,7 +52,7 @@ jobs:
|
||||
runs-on: ${{ matrix.os }}
|
||||
steps:
|
||||
- name: Checkout sources
|
||||
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
|
||||
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
|
||||
- name: Initialize integ-test
|
||||
uses: ./.github/actions/init-integ-test
|
||||
|
||||
|
||||
@@ -26,7 +26,7 @@ jobs:
|
||||
runs-on: ${{ matrix.os }}
|
||||
steps:
|
||||
- name: Checkout sources
|
||||
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
|
||||
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
|
||||
- name: Initialize integ-test
|
||||
uses: ./.github/actions/init-integ-test
|
||||
|
||||
@@ -49,7 +49,7 @@ jobs:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Checkout sources
|
||||
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
|
||||
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
|
||||
- name: Initialize integ-test
|
||||
uses: ./.github/actions/init-integ-test
|
||||
|
||||
@@ -78,7 +78,7 @@ jobs:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Checkout sources
|
||||
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
|
||||
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
|
||||
- name: Initialize integ-test
|
||||
uses: ./.github/actions/init-integ-test
|
||||
|
||||
@@ -111,7 +111,7 @@ jobs:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Checkout sources
|
||||
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
|
||||
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
|
||||
with:
|
||||
sparse-checkout: |
|
||||
.github
|
||||
@@ -145,7 +145,7 @@ jobs:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Checkout sources
|
||||
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v4.2.2 # Checkout the repository with no wrappers
|
||||
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v4.2.2 # Checkout the repository with no wrappers
|
||||
with:
|
||||
sparse-checkout: |
|
||||
.github/actions
|
||||
|
||||
@@ -1,67 +0,0 @@
|
||||
name: Smoke test enhanced caching
|
||||
|
||||
on:
|
||||
workflow_call:
|
||||
inputs:
|
||||
cache-key-prefix:
|
||||
type: string
|
||||
default: '0'
|
||||
runner-os:
|
||||
type: string
|
||||
default: '["ubuntu-latest"]'
|
||||
skip-dist:
|
||||
type: boolean
|
||||
default: false
|
||||
|
||||
env:
|
||||
SKIP_DIST: ${{ inputs.skip-dist }}
|
||||
GRADLE_BUILD_ACTION_CACHE_KEY_PREFIX: smoke-test-enhanced-caching-${{ inputs.cache-key-prefix }}
|
||||
GRADLE_BUILD_ACTION_CACHE_KEY_JOB: smoke-test-enhanced-caching
|
||||
|
||||
permissions:
|
||||
contents: read
|
||||
|
||||
jobs:
|
||||
enhanced-cache-seed-build:
|
||||
strategy:
|
||||
max-parallel: 1
|
||||
fail-fast: false
|
||||
matrix:
|
||||
os: ${{fromJSON(inputs.runner-os)}}
|
||||
runs-on: ${{ matrix.os }}
|
||||
steps:
|
||||
- name: Checkout sources
|
||||
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
|
||||
- name: Initialize integ-test
|
||||
uses: ./.github/actions/init-integ-test
|
||||
|
||||
- name: Setup Gradle
|
||||
uses: ./setup-gradle
|
||||
with:
|
||||
cache-read-only: false # For testing, allow writing cache entries on non-default branches
|
||||
- name: Build using Gradle wrapper
|
||||
working-directory: .github/workflow-samples/groovy-dsl
|
||||
run: ./gradlew test
|
||||
|
||||
# Test that the gradle-user-home cache will cache dependencies, by running build with --offline
|
||||
enhanced-cache-verify-build:
|
||||
needs: enhanced-cache-seed-build
|
||||
strategy:
|
||||
max-parallel: 1
|
||||
fail-fast: false
|
||||
matrix:
|
||||
os: ${{fromJSON(inputs.runner-os)}}
|
||||
runs-on: ${{ matrix.os }}
|
||||
steps:
|
||||
- name: Checkout sources
|
||||
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
|
||||
- name: Initialize integ-test
|
||||
uses: ./.github/actions/init-integ-test
|
||||
|
||||
- name: Setup Gradle
|
||||
uses: ./setup-gradle
|
||||
with:
|
||||
cache-read-only: true
|
||||
- name: Execute Gradle build with --offline
|
||||
working-directory: .github/workflow-samples/groovy-dsl
|
||||
run: ./gradlew test --offline
|
||||
@@ -57,3 +57,9 @@ jobs:
|
||||
with:
|
||||
runner-os: '${{ inputs.runner-os }}'
|
||||
skip-dist: ${{ inputs.skip-dist }}
|
||||
|
||||
basic-cache-provider:
|
||||
uses: ./.github/workflows/integ-test-basic-cache-provider.yml
|
||||
with:
|
||||
runner-os: '${{ inputs.runner-os }}'
|
||||
skip-dist: ${{ inputs.skip-dist }}
|
||||
|
||||
@@ -28,14 +28,6 @@ jobs:
|
||||
secrets:
|
||||
DEVELOCITY_ACCESS_KEY: ${{ secrets.DV_SOLUTIONS_ACCESS_KEY }}
|
||||
|
||||
gradle-support-status:
|
||||
permissions:
|
||||
contents: read
|
||||
actions: read
|
||||
uses: ./.github/workflows/integ-test-gradle-support-status.yml
|
||||
with:
|
||||
skip-dist: ${{ inputs.skip-dist }}
|
||||
|
||||
provision-gradle-versions:
|
||||
uses: ./.github/workflows/integ-test-provision-gradle-versions.yml
|
||||
with:
|
||||
|
||||
@@ -1,27 +0,0 @@
|
||||
name: suite-smoke-test-caching
|
||||
|
||||
on:
|
||||
workflow_call:
|
||||
inputs:
|
||||
runner-os:
|
||||
type: string
|
||||
default: '["ubuntu-latest"]'
|
||||
skip-dist:
|
||||
type: boolean
|
||||
default: false
|
||||
|
||||
permissions:
|
||||
contents: read
|
||||
|
||||
jobs:
|
||||
enhanced-caching:
|
||||
uses: ./.github/workflows/smoke-test-enhanced-caching.yml
|
||||
with:
|
||||
runner-os: '${{ inputs.runner-os }}'
|
||||
skip-dist: ${{ inputs.skip-dist }}
|
||||
|
||||
basic-caching:
|
||||
uses: ./.github/workflows/smoke-test-basic-caching.yml
|
||||
with:
|
||||
runner-os: '${{ inputs.runner-os }}'
|
||||
skip-dist: ${{ inputs.skip-dist }}
|
||||
@@ -19,12 +19,12 @@ jobs:
|
||||
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
|
||||
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
|
||||
|
||||
- name: Set up Node.js
|
||||
uses: actions/setup-node@820762786026740c76f36085b0efc47a31fe5020 # v7.0.0
|
||||
uses: actions/setup-node@53b83947a5a98c8d113130e565377fae1a50d02f # v6.3.0
|
||||
with:
|
||||
node-version: 24
|
||||
node-version: 20
|
||||
cache: npm
|
||||
cache-dependency-path: sources/package-lock.json
|
||||
|
||||
@@ -48,7 +48,7 @@ jobs:
|
||||
|
||||
# If there are no changes, this action will not create a pull request
|
||||
- name: Create or update pull request
|
||||
uses: peter-evans/create-pull-request@5f6978faf089d4d20b00c7766989d076bb2fc7f1 # v8.1.1
|
||||
uses: peter-evans/create-pull-request@c0f553fe549906ede9cf27b5156039d195d2ece0 # v8.1.0
|
||||
with:
|
||||
branch: bot/wrapper-checksums-update
|
||||
author: bot-githubaction <[email protected]>
|
||||
|
||||
@@ -1,4 +1,3 @@
|
||||
.git
|
||||
.vscode
|
||||
.claude
|
||||
.idea
|
||||
|
||||
+3
-3
@@ -1,4 +1,4 @@
|
||||
# Configuration file for asdf version manager
|
||||
nodejs 24.18.0
|
||||
gradle 9.7.1
|
||||
java liberica-17.0.14+10
|
||||
nodejs 24.3.0
|
||||
gradle 8.14.2
|
||||
java liberica-11.0.26+9
|
||||
|
||||
+5
-24
@@ -9,39 +9,20 @@
|
||||
- If new features have been added, bump the minor version (eg `4.1.1` → `4.2.0`)
|
||||
- If a new major release is required, bump the major version (eg `4.1.1` → `5.0.0`)
|
||||
- Note: The gradle actions follow the GitHub Actions convention of including a .0 patch number for the first release of a minor version, unlike the Gradle convention which omits the trailing .0.
|
||||
- Release immutability is a one-time repository setting (Settings → General → Releases → "Enable release immutability"), and applies to every release published thereafter.
|
||||
|
||||
## Release gradle/actions
|
||||
|
||||
> [!IMPORTANT]
|
||||
> Releases in this repository are [immutable](https://docs.github.com/en/code-security/concepts/supply-chain-security/immutable-releases).
|
||||
> Once a release is published, its Git tag is permanently locked to a commit and its assets can no
|
||||
> longer be changed. Deleting the release does not release the tag name for reuse — a mistake in
|
||||
> `v6.3.0` means the next release must be `v6.3.1`. Everything below is ordered so that the tag is
|
||||
> correct *before* anything is published.
|
||||
>
|
||||
> Drafts are exempt: a draft release, and its tag, can still be edited or deleted freely.
|
||||
|
||||
- Create and push the tag for the release **before** drafting it. The tag should have the format `v6.2.0`
|
||||
- Your HEAD must point at the commit to be released.
|
||||
- From CLI: `git tag -s -m "v6.2.0" v6.2.0 && git push --tags`
|
||||
- Create a tag for the release. The tag should have the format `v5.0.0`
|
||||
- From CLI: `git tag -s -m "v5.0.0" v5.0.0 && git push --tags`
|
||||
- Note that we sign the tag and set the commit message for the tag to the newly released version.
|
||||
- Do **not** let GitHub create the tag when the release is published. It creates an unsigned,
|
||||
lightweight tag pointing at whatever `main` resolves to at that moment — so anything merged
|
||||
while the draft was open is silently included. Immutability makes both permanent.
|
||||
- Go to https://github.com/gradle/actions/releases and "Draft new release"
|
||||
- Select the existing tag — do not use "Create new tag on publish" — and copy the tag name exactly as the release title.
|
||||
- Use the newly created tag and copy the tag name exactly as the release title.
|
||||
- Craft release notes content based on issues closed, PRs merged and commits
|
||||
- Include a Full changelog link in the format https://github.com/gradle/actions/compare/v2.12.0...v3.0.0
|
||||
- Finalize the notes now, while the release is still a draft.
|
||||
- Publish the release.
|
||||
- Confirm immutability took effect: `gh api repos/gradle/actions/releases/tags/v6.2.0 --jq .immutable` should print `true`.
|
||||
- Force push the `v6` tag (or current major version) to point to the new release. It is conventional for users to bind to a major release version using this tag.
|
||||
- From CLI: `git tag -f -s -a -m "v6.2.0" v6 && git push -f --tags`
|
||||
- Force push the `v5` tag (or current major version) to point to the new release. It is conventional for users to bind to a major release version using this tag.
|
||||
- From CLI: `git tag -f -s -a -m "v5.0.0" v5 && git push -f --tags`
|
||||
- Note that we sign the tag and set the commit message for the tag to the newly released version.
|
||||
- Your HEAD must point at the commit to be tagged.
|
||||
- Never attach a GitHub release to the `v6` tag. Immutability locks only those tags that have a
|
||||
release of their own, so the major tag remains movable precisely as long as it has none.
|
||||
|
||||
## Post release steps
|
||||
|
||||
|
||||
@@ -8,16 +8,10 @@ inputs:
|
||||
type: string
|
||||
|
||||
dependency-resolution-task:
|
||||
type: list
|
||||
separator: ' '
|
||||
list-item:
|
||||
type: string
|
||||
type: string
|
||||
|
||||
additional-arguments:
|
||||
type: list
|
||||
separator: ' '
|
||||
list-item:
|
||||
type: string
|
||||
type: string
|
||||
|
||||
# Cache configuration
|
||||
cache-provider:
|
||||
@@ -121,7 +115,7 @@ inputs:
|
||||
build-scan-terms-of-use-agree:
|
||||
type: enum
|
||||
allowed-values:
|
||||
- yes
|
||||
- 'yes'
|
||||
|
||||
develocity-access-key:
|
||||
type: string
|
||||
|
||||
@@ -31,7 +31,6 @@ inputs:
|
||||
Specifies the caching implementation to use.
|
||||
'enhanced' (default) uses the full-featured commercial caching service (gradle-actions-caching).
|
||||
'basic' uses a simple open-source caching implementation based on GitHub Actions cache.
|
||||
'external' disables Gradle User Home caching by this action, for use when Gradle User Home is already saved and restored by another mechanism (e.g. Develocity Artifact Cache).
|
||||
required: false
|
||||
default: 'enhanced'
|
||||
|
||||
|
||||
+170
-184
File diff suppressed because one or more lines are too long
+4
-4
File diff suppressed because one or more lines are too long
+145
-219
File diff suppressed because one or more lines are too long
+4
-4
File diff suppressed because one or more lines are too long
Vendored
+168
-181
File diff suppressed because one or more lines are too long
Vendored
+4
-4
File diff suppressed because one or more lines are too long
Vendored
+175
-249
File diff suppressed because one or more lines are too long
Vendored
+4
-4
File diff suppressed because one or more lines are too long
+91
-111
File diff suppressed because one or more lines are too long
+4
-4
File diff suppressed because one or more lines are too long
+2
-56
@@ -133,7 +133,6 @@ You choose which provider to use via the `cache-provider` input:
|
||||
|
||||
- **`enhanced`** (default): Uses the full-featured commercial `gradle-actions-caching` library. Provides advanced features like fine-grained cache entries, intelligent cache cleanup, and deduplication. See [Enhanced Caching](#enhanced-caching) for details.
|
||||
- **`basic`**: A fully open-source (MIT) caching implementation built on the standard GitHub Actions cache (`@actions/cache`). Uses the same caching strategy as `actions/setup-java` with `cache: gradle`. See [Basic Caching](#basic-caching) for details.
|
||||
- **`external`**: Disables Gradle User Home caching by this action, for use when another mechanism already saves and restores Gradle User Home. See [Using an external cache provider](#using-an-external-cache-provider) for details.
|
||||
|
||||
```yaml
|
||||
# Use the open-source basic cache provider
|
||||
@@ -186,17 +185,7 @@ Specifically:
|
||||
- Avoid using `actions/cache` configured to cache the Gradle User Home, [as described in this example](https://github.com/actions/cache/blob/main/examples.md#java---gradle).
|
||||
- Avoid using `actions/setup-java` with the `cache: gradle` option, [as described here](https://github.com/actions/setup-java#caching-gradle-dependencies).
|
||||
|
||||
Using either of these mechanisms may interfere with the caching provided by this action. If you choose to use a different mechanism to save and restore the Gradle User Home, you should disable the caching provided by this action, as described above, or [use `cache-provider: external`](#using-an-external-cache-provider) if that mechanism is a dedicated Gradle User Home cache.
|
||||
|
||||
#### Using an external cache provider
|
||||
|
||||
If Gradle User Home is already saved and restored by another mechanism — for example the [Develocity Artifact Cache](https://github.com/gradle/actions-caching) — set `cache-provider: external` rather than `cache-disabled: true`.
|
||||
|
||||
Both settings stop `setup-gradle` from restoring or saving Gradle User Home, but `cache-provider: external` reflects the actual reason: caching is still happening, just not through this action. It also updates the Job Summary to say that caching was handled externally, rather than implying that caching was turned off.
|
||||
|
||||
```yaml
|
||||
cache-provider: external
|
||||
```
|
||||
Using either of these mechanisms may interfere with the caching provided by this action. If you choose to use a different mechanism to save and restore the Gradle User Home, you should disable the caching provided by this action, as described above.
|
||||
|
||||
## Enhanced Caching
|
||||
|
||||
@@ -518,30 +507,6 @@ so that a Job Summary is never generated, or so that a Job Summary is only gener
|
||||
add-job-summary: 'on-failure' # Valid values are 'always' (default), 'never', and 'on-failure'
|
||||
```
|
||||
|
||||
### Gradle version support status
|
||||
|
||||
The Job Summary reports the support status of each Gradle version used in the workflow, and the action adds a
|
||||
Job annotation for any version that is no longer current. The latest Gradle release is determined from release data
|
||||
bundled with the action, so no network access is required.
|
||||
|
||||
A version is reported when it is:
|
||||
- **End-of-life** — two or more major versions behind the latest release. Each such version is marked with :warning:
|
||||
in the build results table, a single expandable section below the table explains that the affected release lines
|
||||
receive no further fixes (security fixes included), and a warning annotation is added to the Job for each version.
|
||||
If you cannot upgrade, the [Gradle Security Subscription](https://gradle.org/security-subscription/) offers
|
||||
continued support for older versions.
|
||||
- **Out of date** — one major version behind the latest release, or more than two minor versions behind on the current
|
||||
major. The version is marked with :information_source: in the build results table and a notice annotation is added to
|
||||
the Job. Note that a version one major behind is still in "maintenance only" support and receives critical bug fixes
|
||||
and security fixes; an older minor of the current major has simply been superseded. See
|
||||
[Gradle release lifecycle](https://docs.gradle.org/current/userguide/feature_lifecycle.html#eol_support) for details.
|
||||
|
||||
Patch releases are not reported: only the major and minor version are considered. Release candidates, milestones and
|
||||
snapshots are never reported, so testing against a pre-release build will not produce annotations.
|
||||
|
||||
Note that these annotations are always emitted, independent of the `add-job-summary` setting. Setting
|
||||
`add-job-summary: 'never'` suppresses the Job Summary itself, but the warning and notice annotations remain.
|
||||
|
||||
### Excluding specific Gradle builds from Job Summary
|
||||
|
||||
The Job Summary works by installing an init-script in Gradle User Home which will record details of any Gradle execution during the workflow.
|
||||
@@ -583,11 +548,6 @@ jobs:
|
||||
- run: ./gradlew build --scan
|
||||
```
|
||||
|
||||
When a comment is added, any earlier Job Summary comments posted by the same job on that Pull Request are
|
||||
automatically minimized, so only the most recent result remains expanded. This also applies when
|
||||
`add-job-summary-as-pr-comment: 'on-failure'` is used: once a later run of the job succeeds, the previous
|
||||
failure comment is collapsed.
|
||||
|
||||
Note that to add a Pull Request comment, the workflow must be configured with the `pull-requests: write` permission.
|
||||
|
||||
|
||||
@@ -956,7 +916,7 @@ Here's a minimal example:
|
||||
run: ./gradlew build
|
||||
```
|
||||
|
||||
This configuration will automatically apply `v4.5.1` of the [Develocity Gradle plugin](https://docs.gradle.com/develocity/gradle-plugin/), and publish build scans to https://develocity.your-server.com.
|
||||
This configuration will automatically apply `v4.4.0` of the [Develocity Gradle plugin](https://docs.gradle.com/develocity/gradle-plugin/), and publish build scans to https://develocity.your-server.com.
|
||||
|
||||
This example assumes that the `develocity.your-server.com` server allows anonymous publishing of build scans.
|
||||
In the likely scenario that your Develocity server requires authentication, you will also need to pass a valid [Develocity access key](https://docs.gradle.com/develocity/gradle-plugin/#via_environment_variable) taken from a secret:
|
||||
@@ -1040,19 +1000,5 @@ Each of the plugins is signed by Gradle, and you can simply add the following sn
|
||||
<trusting group="com.gradle"/>
|
||||
<trusting group="org.gradle"/>
|
||||
</trusted-key>
|
||||
<trusted-key id="E2879931BCA1A42E55F2D64DD9B2DFBD9F3298BA">
|
||||
<trusting group="org.gradle"/>
|
||||
</trusted-key>
|
||||
</trusted-keys>
|
||||
```
|
||||
|
||||
Two keys are listed because Gradle has rotated its signing key, and the plugins applied by these actions
|
||||
are not all signed with the same one:
|
||||
- `E2879931BCA1A42E55F2D64DD9B2DFBD9F3298BA` is the current signing subkey. The
|
||||
`github-dependency-graph-gradle-plugin` used for Dependency Graph generation is signed with it from
|
||||
version `1.5.0` onward.
|
||||
- `7B79ADD11F8A779FE90FD3D0893A028475557671` is the older key, which has since been revoked. It is still
|
||||
required: the Develocity Gradle plugin (`com.gradle`) is signed with it, as are `org.gradle` plugin
|
||||
versions released before the rotation.
|
||||
|
||||
Keep both entries unless you pin plugin versions and have confirmed which key each one uses.
|
||||
|
||||
@@ -111,7 +111,7 @@ we highly recommend that you reach out to us at [[email protected]](mailto:sec
|
||||
#### Unverifiable Wrapper Jars
|
||||
Wrapper Jars generated by Gradle versions `3.3` to `4.0` are not verifiable because those files were dynamically generated by Gradle in a non-reproducible way. It's not possible to verify the `gradle-wrapper.jar` for those versions are legitimate using a hash comparison. If you have a validation failure, you should try to determine if the `gradle-wrapper.jar` was generated by one of these versions before running the build.
|
||||
|
||||
- If the Gradle version in `gradle-wrapper.properties` is outside of this range, you can regenerate the `gradle-wrapper.jar` by running `./gradlew :wrapper`. This will generate a new, verifiable wrapper jar.
|
||||
- If the Gradle version in `gradle-wrapper.properties` is outside of this range, you can regenerate the `gradle-wrapper.jar` by running `./gradlew wrapper`. This will generate a new, verifiable wrapper jar.
|
||||
- If you need to run your build with a version of Gradle between 3.3 and 4.0, you can use a newer version of Gradle to generate the `gradle-wrapper.jar`.
|
||||
|
||||
#### Wrapper Jar stored with Git LFS
|
||||
|
||||
@@ -69,7 +69,6 @@ inputs:
|
||||
- disabled
|
||||
- generate
|
||||
- generate-and-submit
|
||||
- generate-submit-and-upload
|
||||
- generate-and-upload
|
||||
- download-and-submit
|
||||
|
||||
@@ -107,7 +106,7 @@ inputs:
|
||||
build-scan-terms-of-use-agree:
|
||||
type: enum
|
||||
allowed-values:
|
||||
- yes
|
||||
- 'yes'
|
||||
|
||||
develocity-access-key:
|
||||
type: string
|
||||
@@ -154,10 +153,7 @@ inputs:
|
||||
|
||||
# Deprecated action inputs
|
||||
arguments:
|
||||
type: list
|
||||
separator: ' '
|
||||
list-item:
|
||||
type: string
|
||||
type: string
|
||||
|
||||
# Experimental action inputs
|
||||
gradle-home-cache-strict-match:
|
||||
|
||||
@@ -14,7 +14,6 @@ inputs:
|
||||
Specifies the caching implementation to use.
|
||||
'enhanced' (default) uses the full-featured commercial caching service (gradle-actions-caching).
|
||||
'basic' uses a simple open-source caching implementation based on GitHub Actions cache.
|
||||
'external' disables Gradle User Home caching by this action, for use when Gradle User Home is already saved and restored by another mechanism (e.g. Develocity Artifact Cache).
|
||||
required: false
|
||||
default: 'enhanced'
|
||||
|
||||
|
||||
@@ -0,0 +1 @@
|
||||
v16
|
||||
Generated
+1826
-2630
File diff suppressed because it is too large
Load Diff
+26
-18
@@ -35,36 +35,44 @@
|
||||
"node": ">=24.0.0"
|
||||
},
|
||||
"dependencies": {
|
||||
"@actions/artifact": "6.2.1",
|
||||
"@actions/cache": "6.2.0",
|
||||
"@actions/core": "3.0.1",
|
||||
"@actions/artifact": "6.1.0",
|
||||
"@actions/cache": "6.0.0",
|
||||
"@actions/core": "3.0.0",
|
||||
"@actions/exec": "3.0.0",
|
||||
"@actions/github": "9.1.1",
|
||||
"@actions/glob": "0.7.0",
|
||||
"@actions/http-client": "4.0.1",
|
||||
"@actions/github": "9.0.0",
|
||||
"@actions/glob": "0.6.1",
|
||||
"@actions/http-client": "4.0.0",
|
||||
"@actions/tool-cache": "4.0.0",
|
||||
"@octokit/webhooks-types": "7.6.1",
|
||||
"cheerio": "1.2.0",
|
||||
"semver": "7.7.4",
|
||||
"string-argv": "0.3.2",
|
||||
"unhomoglyph": "1.0.6",
|
||||
"which": "7.0.0"
|
||||
"which": "6.0.1"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@jest/globals": "30.4.1",
|
||||
"@jest/globals": "30.3.0",
|
||||
"@types/jest": "30.0.0",
|
||||
"@types/node": "24.13.3",
|
||||
"@types/node": "25.5.0",
|
||||
"@types/semver": "7.7.1",
|
||||
"@types/unzipper": "0.10.11",
|
||||
"@types/which": "3.0.4",
|
||||
"@typescript-eslint/eslint-plugin": "8.69.0",
|
||||
"@typescript-eslint/eslint-plugin": "8.58.0",
|
||||
"dedent": "1.7.2",
|
||||
"esbuild": "0.28.2",
|
||||
"eslint": "10.10.0",
|
||||
"globals": "17.12.0",
|
||||
"jest": "30.4.2",
|
||||
"nock": "14.0.17",
|
||||
"esbuild": "0.28.0",
|
||||
"eslint": "10.1.0",
|
||||
"globals": "17.4.0",
|
||||
"jest": "30.3.0",
|
||||
"nock": "15.0.0",
|
||||
"npm-run-all": "4.1.5",
|
||||
"prettier": "3.9.6",
|
||||
"ts-jest": "29.4.12",
|
||||
"typescript": "6.0.3"
|
||||
"prettier": "3.8.1",
|
||||
"ts-jest": "29.4.9",
|
||||
"typescript": "5.9.3"
|
||||
},
|
||||
"overrides": {
|
||||
"@azure/logger": "1.1.4",
|
||||
"@octokit/request": "8.4.1",
|
||||
"@octokit/request-error": "5.1.1",
|
||||
"@octokit/plugin-paginate-rest": "9.2.2"
|
||||
}
|
||||
}
|
||||
|
||||
@@ -47,7 +47,6 @@ export async function run(): Promise<void> {
|
||||
-Dorg.gradle.configureondemand=false
|
||||
-Dorg.gradle.dependency.verification=off
|
||||
-Dorg.gradle.unsafe.isolated-projects=false
|
||||
-Dorg.gradle.isolated-projects=false
|
||||
${taskList}
|
||||
${additionalArgs}
|
||||
`
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import * as setupGradle from '../../setup-gradle'
|
||||
|
||||
import {CacheConfig, DevelocityConfig, SummaryConfig} from '../../configuration'
|
||||
import {CacheConfig, SummaryConfig} from '../../configuration'
|
||||
import {handlePostActionError} from '../../errors'
|
||||
import {forceExit} from '../../force-exit'
|
||||
|
||||
@@ -14,7 +14,7 @@ process.on('uncaughtException', e => handlePostActionError(e))
|
||||
*/
|
||||
export async function run(): Promise<void> {
|
||||
try {
|
||||
await setupGradle.complete(new CacheConfig(), new DevelocityConfig(), new SummaryConfig())
|
||||
await setupGradle.complete(new CacheConfig(), new SummaryConfig())
|
||||
} catch (error) {
|
||||
handlePostActionError(error)
|
||||
}
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import * as setupGradle from '../../setup-gradle'
|
||||
import * as dependencyGraph from '../../dependency-graph'
|
||||
|
||||
import {CacheConfig, DependencyGraphConfig, DevelocityConfig, SummaryConfig} from '../../configuration'
|
||||
import {CacheConfig, DependencyGraphConfig, SummaryConfig} from '../../configuration'
|
||||
import {handlePostActionError} from '../../errors'
|
||||
import {emitDeprecationWarnings, restoreDeprecationState} from '../../deprecation-collector'
|
||||
import {forceExit} from '../../force-exit'
|
||||
@@ -19,7 +19,7 @@ export async function run(): Promise<void> {
|
||||
restoreDeprecationState()
|
||||
emitDeprecationWarnings()
|
||||
|
||||
if (await setupGradle.complete(new CacheConfig(), new DevelocityConfig(), new SummaryConfig())) {
|
||||
if (await setupGradle.complete(new CacheConfig(), new SummaryConfig())) {
|
||||
// Only submit the dependency graphs once per job
|
||||
await dependencyGraph.complete(new DependencyGraphConfig())
|
||||
}
|
||||
|
||||
@@ -4,9 +4,7 @@ import * as glob from '@actions/glob'
|
||||
import * as path from 'path'
|
||||
|
||||
import {BuildResult} from './build-results'
|
||||
import {CacheEntryReport, CacheOptions, CacheReport, CacheService} from './cache-service'
|
||||
|
||||
const ENTRY_NAME = 'Gradle User Home'
|
||||
import {CacheOptions, CacheService} from './cache-service'
|
||||
|
||||
const PRIMARY_KEY_STATE = 'BASIC_CACHE_PRIMARY_KEY'
|
||||
const RESTORED_KEY_STATE = 'BASIC_CACHE_RESTORED_KEY'
|
||||
@@ -42,117 +40,36 @@ export class BasicCacheService implements CacheService {
|
||||
}
|
||||
}
|
||||
|
||||
async save(gradleUserHome: string, _buildResults: BuildResult[], cacheOptions: CacheOptions): Promise<CacheReport> {
|
||||
async save(gradleUserHome: string, _buildResults: BuildResult[], cacheOptions: CacheOptions): Promise<string> {
|
||||
if (cacheOptions.readOnly) {
|
||||
const restoredKey = core.getState(RESTORED_KEY_STATE)
|
||||
if (restoredKey) {
|
||||
return `Basic caching was read-only. Restored from cache key \`${restoredKey}\`.`
|
||||
}
|
||||
return 'Basic caching was read-only. No cache entry was found to restore.'
|
||||
}
|
||||
|
||||
const primaryKey = core.getState(PRIMARY_KEY_STATE)
|
||||
const restoredKey = core.getState(RESTORED_KEY_STATE)
|
||||
|
||||
if (cacheOptions.readOnly) {
|
||||
return {
|
||||
status: 'read-only',
|
||||
entries: [
|
||||
entryReport({
|
||||
primaryKey,
|
||||
restoredKey,
|
||||
restoredOutcome: restoredKey
|
||||
? '(Entry restored: exact match found)'
|
||||
: '(Entry not restored: no match found)',
|
||||
savedOutcome: '(Entry not saved: cache is read-only)'
|
||||
})
|
||||
]
|
||||
}
|
||||
}
|
||||
|
||||
if (restoredKey === primaryKey) {
|
||||
core.info(`Basic caching restored entry with key \`${primaryKey}\`. Save was skipped.`)
|
||||
return {
|
||||
status: 'enabled',
|
||||
entries: [
|
||||
entryReport({
|
||||
primaryKey,
|
||||
restoredKey,
|
||||
restoredOutcome: '(Entry restored: exact match found)',
|
||||
savedOutcome: '(Entry not saved: entry with key already exists)'
|
||||
})
|
||||
]
|
||||
}
|
||||
return `Basic caching restored entry with key \`${primaryKey}\`. Save was skipped.`
|
||||
}
|
||||
|
||||
const cachePaths = getCachePaths(gradleUserHome)
|
||||
|
||||
try {
|
||||
// A cacheId of -1 means the save failed: `saveCache` reports the underlying cause and returns
|
||||
// normally, rather than throwing. Warn and continue: caching failures should not fail the build.
|
||||
const cacheId = await cache.saveCache(cachePaths, primaryKey)
|
||||
if (cacheId === -1) {
|
||||
core.warning(
|
||||
`Basic caching failed to save entry with key \`${primaryKey}\`. See preceding log output for the cause.`
|
||||
)
|
||||
return {
|
||||
status: 'enabled',
|
||||
entries: [
|
||||
entryReport({
|
||||
primaryKey,
|
||||
restoredKey,
|
||||
restoredOutcome: restoredKey
|
||||
? '(Entry restored: exact match found)'
|
||||
: '(Entry not restored: no match found)',
|
||||
savedOutcome: '(Entry not saved: save failed)'
|
||||
})
|
||||
]
|
||||
}
|
||||
}
|
||||
|
||||
await cache.saveCache(cachePaths, primaryKey)
|
||||
core.info(`Basic caching saved entry with key: ${primaryKey}`)
|
||||
return {
|
||||
status: 'enabled',
|
||||
entries: [
|
||||
entryReport({
|
||||
primaryKey,
|
||||
restoredKey,
|
||||
savedKey: primaryKey,
|
||||
restoredOutcome: restoredKey
|
||||
? '(Entry restored: exact match found)'
|
||||
: '(Entry not restored: no match found)',
|
||||
savedOutcome: '(Entry saved)'
|
||||
})
|
||||
]
|
||||
}
|
||||
return `Basic caching saved entry with key \`${primaryKey}\`.`
|
||||
} catch (error) {
|
||||
core.warning(`Basic caching failed to save entry with key \`${primaryKey}\`: ${error}`)
|
||||
return {
|
||||
status: 'enabled',
|
||||
entries: [
|
||||
entryReport({
|
||||
primaryKey,
|
||||
restoredKey,
|
||||
restoredOutcome: restoredKey
|
||||
? '(Entry restored: exact match found)'
|
||||
: '(Entry not restored: no match found)',
|
||||
savedOutcome: `(Entry not saved: ${error})`
|
||||
})
|
||||
]
|
||||
}
|
||||
return `Basic caching save failed: ${error}`
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
function entryReport(opts: {
|
||||
primaryKey: string
|
||||
restoredKey?: string
|
||||
savedKey?: string
|
||||
restoredOutcome: string
|
||||
savedOutcome: string
|
||||
}): CacheEntryReport {
|
||||
return {
|
||||
entryName: ENTRY_NAME,
|
||||
requestedKey: opts.primaryKey || undefined,
|
||||
restoredKey: opts.restoredKey || undefined,
|
||||
restoredOutcome: opts.restoredOutcome,
|
||||
savedKey: opts.savedKey || undefined,
|
||||
savedOutcome: opts.savedOutcome
|
||||
}
|
||||
}
|
||||
|
||||
function getCachePaths(gradleUserHome: string): string[] {
|
||||
return [path.join(gradleUserHome, 'caches'), path.join(gradleUserHome, 'wrapper')]
|
||||
}
|
||||
|
||||
@@ -5,60 +5,78 @@ import {pathToFileURL} from 'url'
|
||||
import {CacheConfig, CacheProvider} from './configuration'
|
||||
import {BasicCacheService} from './cache-service-basic'
|
||||
import {BuildResult} from './build-results'
|
||||
import {CacheOptions, CacheReport, CacheService, CacheStatus} from './cache-service'
|
||||
import {ProviderNote} from './caching-report'
|
||||
import {CacheOptions, CacheService} from './cache-service'
|
||||
|
||||
const NOOP_CACHING_REPORT = `
|
||||
[Cache was disabled](https://github.com/gradle/actions/blob/main/docs/setup-gradle.md#disabling-caching). Gradle User Home was not restored from or saved to the cache.
|
||||
`
|
||||
|
||||
const ENHANCED_CACHE_MESSAGE = `Enhanced Caching: This build is using the proprietary 'gradle-actions-caching' provider for optimized caching support. See https://github.com/gradle/actions/blob/main/DISTRIBUTION.md for terms of use and opt-out instructions.`
|
||||
|
||||
const BASIC_CACHE_MESSAGE = `Basic Caching: This build uses the basic open-source caching provider. For faster builds and advanced features, consider switching to the Enhanced Caching provider. See https://github.com/gradle/actions/blob/main/DISTRIBUTION.md for details.`
|
||||
const ENHANCED_CACHE_SUMMARY = `
|
||||
> [!NOTE]
|
||||
> ### ⚡️ Enhanced Caching enabled
|
||||
> This build provides optimized caching support via the proprietary **gradle-actions-caching** provider.
|
||||
> See [DISTRIBUTION.md](https://github.com/gradle/actions/blob/main/DISTRIBUTION.md) for terms of use and opt-out instructions.
|
||||
`
|
||||
|
||||
const EXTERNAL_CACHE_MESSAGE = `External Caching: Gradle User Home is managed by an external caching provider. This action will not restore or save Gradle User Home.`
|
||||
const BASIC_CACHE_MESSAGE = `Basic Caching: This build uses the open-source caching provider for reliable, path-based caching of Gradle dependencies. Upgrade available: for faster builds and advanced features, consider switching to the Enhanced Caching provider. See https://github.com/gradle/actions/blob/main/DISTRIBUTION.md for details.`
|
||||
|
||||
const BASIC_CACHE_SUMMARY = `
|
||||
> [!NOTE]
|
||||
> ### 🛡️ Basic Caching enabled
|
||||
> This build uses the open-source caching provider for reliable, path-based caching of Gradle dependencies.
|
||||
>
|
||||
> **Upgrade Available:** For faster builds and advanced features, consider switching to the **Enhanced Caching** provider.
|
||||
> See [DISTRIBUTION.md](https://github.com/gradle/actions/blob/main/DISTRIBUTION.md) for details.`
|
||||
|
||||
class NoOpCacheService implements CacheService {
|
||||
constructor(private readonly status: CacheStatus) {}
|
||||
|
||||
async restore(_gradleUserHome: string, _cacheOptions: CacheOptions): Promise<void> {
|
||||
return
|
||||
}
|
||||
|
||||
async save(
|
||||
_gradleUserHome: string,
|
||||
_buildResults: BuildResult[],
|
||||
_cacheOptions: CacheOptions
|
||||
): Promise<CacheReport> {
|
||||
return {status: this.status, entries: []}
|
||||
async save(_gradleUserHome: string, _buildResults: BuildResult[], _cacheOptions: CacheOptions): Promise<string> {
|
||||
return NOOP_CACHING_REPORT
|
||||
}
|
||||
}
|
||||
|
||||
class LicenseWarningCacheService implements CacheService {
|
||||
private delegate: CacheService
|
||||
private summary: string
|
||||
|
||||
constructor(delegate: CacheService, summary: string) {
|
||||
this.delegate = delegate
|
||||
this.summary = summary
|
||||
}
|
||||
|
||||
async restore(gradleUserHome: string, cacheOptions: CacheOptions): Promise<void> {
|
||||
await this.delegate.restore(gradleUserHome, cacheOptions)
|
||||
}
|
||||
|
||||
async save(gradleUserHome: string, buildResults: BuildResult[], cacheOptions: CacheOptions): Promise<string> {
|
||||
const cachingReport = await this.delegate.save(gradleUserHome, buildResults, cacheOptions)
|
||||
return `${cachingReport}\n${this.summary}`
|
||||
}
|
||||
}
|
||||
|
||||
export async function getCacheService(cacheConfig: CacheConfig): Promise<CacheService> {
|
||||
if (cacheConfig.getCacheProvider() === CacheProvider.External) {
|
||||
logCacheMessage(EXTERNAL_CACHE_MESSAGE)
|
||||
return new NoOpCacheService('external')
|
||||
}
|
||||
|
||||
if (cacheConfig.isCacheDisabled()) {
|
||||
logCacheMessage('Cache is disabled: will not restore state from previous builds.')
|
||||
return new NoOpCacheService('disabled')
|
||||
return new NoOpCacheService()
|
||||
}
|
||||
|
||||
if (cacheConfig.getCacheProvider() === CacheProvider.Basic) {
|
||||
logCacheMessage(BASIC_CACHE_MESSAGE)
|
||||
return new BasicCacheService()
|
||||
return new LicenseWarningCacheService(new BasicCacheService(), BASIC_CACHE_SUMMARY)
|
||||
}
|
||||
|
||||
logCacheMessage(ENHANCED_CACHE_MESSAGE)
|
||||
return loadVendoredCacheService()
|
||||
}
|
||||
|
||||
/**
|
||||
* Identifies the caching provider for the Job Summary. Returns `undefined` when
|
||||
* caching is disabled or managed externally, since no provider is engaged in that case.
|
||||
*/
|
||||
export function getProviderNote(cacheConfig: CacheConfig): ProviderNote | undefined {
|
||||
if (cacheConfig.isCacheDisabled() || cacheConfig.getCacheProvider() === CacheProvider.External) {
|
||||
return undefined
|
||||
const cacheService = await loadVendoredCacheService()
|
||||
if (cacheConfig.isCacheLicenseAccepted()) {
|
||||
return cacheService
|
||||
}
|
||||
return cacheConfig.getCacheProvider() === CacheProvider.Basic ? {kind: 'basic'} : {kind: 'enhanced'}
|
||||
|
||||
return new LicenseWarningCacheService(cacheService, ENHANCED_CACHE_SUMMARY)
|
||||
}
|
||||
|
||||
export async function loadVendoredCacheService(): Promise<CacheService> {
|
||||
|
||||
@@ -8,60 +8,11 @@ export interface CacheOptions {
|
||||
strictMatch: boolean
|
||||
cleanup: string
|
||||
encryptionKey?: string
|
||||
develocityAccessToken?: string
|
||||
develocityServerUrl?: string
|
||||
includes: string[]
|
||||
excludes: string[]
|
||||
}
|
||||
|
||||
export type CacheStatus =
|
||||
| 'enabled' // Gradle User Home was restored from and saved to the cache
|
||||
| 'read-only' // restored from the cache, but not saved
|
||||
| 'write-only' // saved to the cache, but not restored
|
||||
| 'disabled' // caching was turned off via the cache-disabled parameter
|
||||
| 'disabled-existing-home' // a pre-existing Gradle User Home was found, so caching was skipped
|
||||
| 'not-available' // the GitHub Actions cache service could not be reached
|
||||
| 'external' // Gradle User Home is cached by an external provider, not by this action
|
||||
|
||||
export type CacheCleanupStatus =
|
||||
| 'enabled' // stale files were purged from Gradle User Home before saving
|
||||
| 'disabled-param' // disabled via action parameter
|
||||
| 'disabled-failure' // skipped due to a build failure
|
||||
| 'disabled-config-cache-hit' // skipped due to configuration-cache reuse
|
||||
| 'disabled-readonly' // always disabled when the cache is read-only
|
||||
|
||||
export type ProjectCacheStatus =
|
||||
| 'not-enabled' // the hidden opt-in env var was not set (rendered as nothing)
|
||||
| 'trial-expired' // past the hard trial expiry
|
||||
| 'trial-not-licensed' // Develocity trial token missing or invalid
|
||||
| 'no-encryption-key' // Cannot store due to missing encryption key
|
||||
| 'enabled' // Trial in effect: will attempt to save project state
|
||||
|
||||
export interface CacheEntryReport {
|
||||
entryName: string
|
||||
requestedKey?: string
|
||||
restoredKey?: string
|
||||
restoredSize?: number
|
||||
restoredTime?: number
|
||||
restoredOutcome: string
|
||||
savedKey?: string
|
||||
savedSize?: number
|
||||
savedTime?: number
|
||||
savedOutcome: string
|
||||
}
|
||||
|
||||
/**
|
||||
* Structured result of a cache save operation. Rendering this into a human-readable
|
||||
* Job Summary is handled centrally by `caching-report.ts`.
|
||||
*/
|
||||
export interface CacheReport {
|
||||
status: CacheStatus
|
||||
cleanup?: CacheCleanupStatus
|
||||
projectCache?: ProjectCacheStatus
|
||||
entries: CacheEntryReport[]
|
||||
}
|
||||
|
||||
export interface CacheService {
|
||||
restore(gradleUserHome: string, cacheOptions: CacheOptions): Promise<void>
|
||||
save(gradleUserHome: string, buildResults: BuildResult[], cacheOptions: CacheOptions): Promise<CacheReport>
|
||||
save(gradleUserHome: string, buildResults: BuildResult[], cacheOptions: CacheOptions): Promise<string>
|
||||
}
|
||||
|
||||
@@ -1,189 +0,0 @@
|
||||
import {CacheCleanupStatus, CacheEntryReport, CacheReport, CacheStatus, ProjectCacheStatus} from './cache-service'
|
||||
|
||||
const DOCS = 'https://github.com/gradle/actions/blob/main/docs/setup-gradle.md'
|
||||
const DISTRIBUTION = 'https://github.com/gradle/actions/blob/main/DISTRIBUTION.md'
|
||||
|
||||
/**
|
||||
* Identifies the caching provider in use, so the report can attribute the cache
|
||||
* and surface the relevant terms-of-use / upgrade information.
|
||||
*/
|
||||
export interface ProviderNote {
|
||||
kind: 'enhanced' | 'basic'
|
||||
}
|
||||
|
||||
const STATUS_COPY: Record<CacheStatus, string> = {
|
||||
enabled: `[Cache was enabled](${DOCS}#caching-build-state-between-jobs) — Gradle User Home was restored from the cache and saved for use by subsequent jobs.`,
|
||||
'read-only': `[Cache was read-only](${DOCS}#using-the-cache-read-only) — by default, the action only writes to the cache for jobs running on the default branch.`,
|
||||
'write-only': `[Cache was write-only](${DOCS}#using-the-cache-write-only) — Gradle User Home was not restored from the cache.`,
|
||||
disabled: `[Caching was disabled](${DOCS}#disabling-caching) — Gradle User Home was not restored from or saved to the cache.`,
|
||||
'disabled-existing-home': `⚠️ [Caching was skipped](${DOCS}#overwriting-an-existing-gradle-user-home) — a pre-existing Gradle User Home was found, so the cache was not restored or saved.`,
|
||||
'not-available': `Caching is not available — the GitHub Actions cache service could not be reached, so Gradle User Home was not restored or saved.`,
|
||||
external: `[Gradle User Home is cached externally](${DOCS}#using-an-external-cache-provider) — this action did not restore or save the Gradle User Home.`
|
||||
}
|
||||
|
||||
const CLEANUP_COPY: Record<CacheCleanupStatus, string> = {
|
||||
enabled: `[Cache cleanup](${DOCS}#configuring-cache-cleanup) purged stale files from Gradle User Home before saving.`,
|
||||
'disabled-param': `[Cache cleanup](${DOCS}#configuring-cache-cleanup) was disabled via action parameter.`,
|
||||
'disabled-failure': `[Cache cleanup](${DOCS}#configuring-cache-cleanup) was skipped due to a build failure. Use \`cache-cleanup: always\` to override.`,
|
||||
'disabled-config-cache-hit': `[Cache cleanup](${DOCS}#configuring-cache-cleanup) was skipped due to configuration-cache reuse.`,
|
||||
'disabled-readonly': `[Cache cleanup](${DOCS}#configuring-cache-cleanup) is always disabled when the cache is read-only.`
|
||||
}
|
||||
|
||||
const PROJECT_CACHE_COPY: Record<ProjectCacheStatus, string> = {
|
||||
'not-enabled': ``,
|
||||
'trial-expired': `Project state (build-logic and configuration cache) was not cached - the Develocity caching trial has expired.`,
|
||||
'trial-not-licensed': `Project state (build-logic and configuration cache) was not cached - a develocity-access-key and develocity-server-url is required.`,
|
||||
'no-encryption-key': `Project state (build-logic and configuration cache) was not cached - a [cache-encryption-key](${DOCS}#cache-encryption-key) is required.`,
|
||||
enabled: `Caching of project state (build-logic and configuration cache) was enabled.`
|
||||
}
|
||||
|
||||
/**
|
||||
* Renders a cache report into the unified Job Summary markdown, with a consistent
|
||||
* skeleton across every variant: a section heading, a status line, an integrated
|
||||
* provider note, and (when there are entries) an expandable details section.
|
||||
*/
|
||||
export function renderCachingReport(report: CacheReport, providerNote?: ProviderNote): string {
|
||||
if (!isActive(report.status)) {
|
||||
// Disabled / skipped / unavailable: a compact heading + status line, no expandable section.
|
||||
return `${renderHeading(report.status, providerNote)}\n\n${STATUS_COPY[report.status]}\n`
|
||||
}
|
||||
const sections = [
|
||||
renderHeading(report.status, providerNote),
|
||||
renderProviderNote(providerNote),
|
||||
// Status and cleanup messages live inside the details expando; if there are no entries
|
||||
// to expand, fall back to showing the status line directly.
|
||||
report.entries.length > 0 ? renderDetails(report) : STATUS_COPY[report.status]
|
||||
]
|
||||
return `${sections.filter(section => section !== undefined && section !== '').join('\n\n')}\n`
|
||||
}
|
||||
|
||||
function isActive(status: CacheStatus): boolean {
|
||||
return status === 'enabled' || status === 'read-only' || status === 'write-only'
|
||||
}
|
||||
|
||||
function renderHeading(status: CacheStatus, providerNote?: ProviderNote): string {
|
||||
if (!isActive(status)) {
|
||||
const label =
|
||||
status === 'disabled-existing-home'
|
||||
? 'Skipped'
|
||||
: status === 'not-available'
|
||||
? 'Unavailable'
|
||||
: status === 'external'
|
||||
? 'External'
|
||||
: 'Disabled'
|
||||
return `<h4>Gradle State Caching - ${label}</h4>`
|
||||
}
|
||||
|
||||
const icon = providerNote?.kind === 'basic' ? '🛡️' : '⚡'
|
||||
const provider = providerNote?.kind === 'basic' ? 'Basic' : 'Enhanced'
|
||||
const suffix = status === 'read-only' ? ' (read-only)' : status === 'write-only' ? ' (write-only)' : ''
|
||||
return `<h4>Gradle State Caching - ${icon} ${provider}${suffix}</h4>`
|
||||
}
|
||||
|
||||
function renderCleanupLine(cleanup?: CacheCleanupStatus): string | undefined {
|
||||
return cleanup ? CLEANUP_COPY[cleanup] : undefined
|
||||
}
|
||||
|
||||
function renderProjectCacheLine(projectCache?: ProjectCacheStatus): string | undefined {
|
||||
// PROJECT_CACHE_COPY['not-enabled'] is '', which the .filter(Boolean) at the call site drops.
|
||||
return projectCache ? PROJECT_CACHE_COPY[projectCache] : undefined
|
||||
}
|
||||
|
||||
function renderProviderNote(providerNote?: ProviderNote): string | undefined {
|
||||
if (!providerNote) {
|
||||
return undefined
|
||||
}
|
||||
if (providerNote.kind === 'enhanced') {
|
||||
return `**[Enhanced Caching](${DOCS}#enhanced-caching)** uses the proprietary \`gradle-actions-caching\` provider. See [DISTRIBUTION.md](${DISTRIBUTION}) for terms of use and opt-out instructions.`
|
||||
}
|
||||
return `**[Basic Caching](${DOCS}#basic-caching)** uses the basic open-source caching provider. For faster builds and advanced features, consider the **[Enhanced Caching](${DOCS}#enhanced-caching)** provider.`
|
||||
}
|
||||
|
||||
function renderDetails(report: CacheReport): string {
|
||||
const entries = report.entries
|
||||
const restored = entries.filter(entry => entry.restoredKey).length
|
||||
const saved = entries.filter(entry => entry.savedKey).length
|
||||
const summary = hasMetrics(entries)
|
||||
? `Entries: ${restored} restored (${getSize(entries, e => e.restoredSize)}Mb), ${saved} saved (${getSize(entries, e => e.savedSize)}Mb) - Expand for more details`
|
||||
: `Entries: ${restored} restored, ${saved} saved - Expand for more details`
|
||||
|
||||
const cleanup = report.status === 'enabled' ? renderCleanupLine(report.cleanup) : undefined
|
||||
const projectCache = renderProjectCacheLine(report.projectCache)
|
||||
const table = renderEntryTable(report.entries)
|
||||
const pre = `<pre>\n${renderEntryDetails(report.entries)}</pre>`
|
||||
const body = [STATUS_COPY[report.status], cleanup, projectCache, table, pre].filter(Boolean).join('\n\n')
|
||||
|
||||
return `<details>
|
||||
<summary>${summary}</summary>
|
||||
|
||||
${body}
|
||||
</details>`
|
||||
}
|
||||
|
||||
function hasMetrics(entries: CacheEntryReport[]): boolean {
|
||||
return entries.some(entry => entry.restoredSize || entry.restoredTime || entry.savedSize || entry.savedTime)
|
||||
}
|
||||
|
||||
function renderEntryTable(entries: CacheEntryReport[]): string {
|
||||
if (!hasMetrics(entries)) {
|
||||
return ''
|
||||
}
|
||||
return `<table>
|
||||
<tr><td></td><th>Count</th><th>Total Size (Mb)</th><th>Total Time (ms)</th></tr>
|
||||
<tr><td>Entries Restored</td>
|
||||
<td>${getCount(entries, e => e.restoredSize)}</td>
|
||||
<td>${getSize(entries, e => e.restoredSize)}</td>
|
||||
<td>${getTime(entries, e => e.restoredTime)}</td>
|
||||
</tr>
|
||||
<tr><td>Entries Saved</td>
|
||||
<td>${getCount(entries, e => e.savedSize)}</td>
|
||||
<td>${getSize(entries, e => e.savedSize)}</td>
|
||||
<td>${getTime(entries, e => e.savedTime)}</td>
|
||||
</tr>
|
||||
</table>`
|
||||
}
|
||||
|
||||
function renderEntryDetails(entries: CacheEntryReport[]): string {
|
||||
return entries
|
||||
.map(
|
||||
entry => `Entry: ${entry.entryName}
|
||||
Requested Key : ${entry.requestedKey ?? ''}
|
||||
Restored Key : ${entry.restoredKey ?? ''}
|
||||
Size: ${formatSize(entry.restoredSize)}
|
||||
Time: ${formatTime(entry.restoredTime)}
|
||||
${entry.restoredOutcome}
|
||||
Saved Key : ${entry.savedKey ?? ''}
|
||||
Size: ${formatSize(entry.savedSize)}
|
||||
Time: ${formatTime(entry.savedTime)}
|
||||
${entry.savedOutcome}
|
||||
`
|
||||
)
|
||||
.join('---\n')
|
||||
}
|
||||
|
||||
function getCount(entries: CacheEntryReport[], predicate: (value: CacheEntryReport) => number | undefined): number {
|
||||
return entries.filter(e => predicate(e)).length
|
||||
}
|
||||
|
||||
function getSize(entries: CacheEntryReport[], predicate: (value: CacheEntryReport) => number | undefined): number {
|
||||
const bytes = entries.map(e => predicate(e) ?? 0).reduce((p, v) => p + v, 0)
|
||||
return Math.round(bytes / (1024 * 1024))
|
||||
}
|
||||
|
||||
function getTime(entries: CacheEntryReport[], predicate: (value: CacheEntryReport) => number | undefined): number {
|
||||
return entries.map(e => predicate(e) ?? 0).reduce((p, v) => p + v, 0)
|
||||
}
|
||||
|
||||
function formatSize(bytes: number | undefined): string {
|
||||
if (bytes === undefined || bytes === 0) {
|
||||
return ''
|
||||
}
|
||||
return `${Math.round(bytes / (1024 * 1024))} MB (${bytes} B)`
|
||||
}
|
||||
|
||||
function formatTime(ms: number | undefined): string {
|
||||
if (ms === undefined || ms === 0) {
|
||||
return ''
|
||||
}
|
||||
return `${ms} ms`
|
||||
}
|
||||
@@ -167,6 +167,11 @@ export class CacheConfig {
|
||||
return core.getMultilineInput('gradle-home-cache-excludes')
|
||||
}
|
||||
|
||||
isCacheLicenseAccepted(): boolean {
|
||||
const dvConfig = new DevelocityConfig()
|
||||
return dvConfig.getDevelocityAccessKey() !== '' || dvConfig.hasTermsOfUseAgreement()
|
||||
}
|
||||
|
||||
getCacheProvider(): CacheProvider {
|
||||
const val = core.getInput('cache-provider')
|
||||
switch (val.toLowerCase().trim()) {
|
||||
@@ -175,19 +180,14 @@ export class CacheConfig {
|
||||
case 'enhanced':
|
||||
case '':
|
||||
return CacheProvider.Enhanced
|
||||
case 'external':
|
||||
return CacheProvider.External
|
||||
}
|
||||
throw TypeError(
|
||||
`The value '${val}' is not valid for 'cache-provider'. Valid values are: [basic, enhanced, external].`
|
||||
)
|
||||
throw TypeError(`The value '${val}' is not valid for 'cache-provider'. Valid values are: [basic, enhanced].`)
|
||||
}
|
||||
}
|
||||
|
||||
export enum CacheProvider {
|
||||
Basic = 'basic',
|
||||
Enhanced = 'enhanced',
|
||||
External = 'external'
|
||||
Enhanced = 'enhanced'
|
||||
}
|
||||
|
||||
export enum CacheCleanupOption {
|
||||
@@ -206,10 +206,6 @@ export class SummaryConfig {
|
||||
return this.shouldAddJobSummary(this.getJobSummaryOption(), hasFailure)
|
||||
}
|
||||
|
||||
canAddPRComment(): boolean {
|
||||
return this.getPRCommentOption() !== JobSummaryOption.Never
|
||||
}
|
||||
|
||||
shouldAddPRComment(hasFailure: boolean): boolean {
|
||||
return this.shouldAddJobSummary(this.getPRCommentOption(), hasFailure)
|
||||
}
|
||||
|
||||
@@ -1,7 +1,8 @@
|
||||
import * as core from '@actions/core'
|
||||
import {DevelocityConfig} from '../configuration'
|
||||
import {setupToken} from './short-lived-token'
|
||||
|
||||
export function setup(config: DevelocityConfig): void {
|
||||
export async function setup(config: DevelocityConfig): Promise<void> {
|
||||
maybeExportVariable('DEVELOCITY_INJECTION_INIT_SCRIPT_NAME', 'gradle-actions.inject-develocity.init.gradle')
|
||||
maybeExportVariable('DEVELOCITY_INJECTION_CUSTOM_VALUE', 'gradle-actions')
|
||||
|
||||
@@ -33,11 +34,17 @@ export function setup(config: DevelocityConfig): void {
|
||||
// except if they are defined in the configuration
|
||||
if (config.getBuildScanPublishEnabled()) {
|
||||
maybeExportVariable('DEVELOCITY_INJECTION_ENABLED', 'true')
|
||||
maybeExportVariable('DEVELOCITY_INJECTION_DEVELOCITY_PLUGIN_VERSION', '4.5.1')
|
||||
maybeExportVariable('DEVELOCITY_INJECTION_DEVELOCITY_PLUGIN_VERSION', '4.4.0')
|
||||
maybeExportVariable('DEVELOCITY_INJECTION_CCUD_PLUGIN_VERSION', '2.1')
|
||||
maybeExportVariable('DEVELOCITY_INJECTION_TERMS_OF_USE_URL', config.getTermsOfUseUrl())
|
||||
maybeExportVariable('DEVELOCITY_INJECTION_TERMS_OF_USE_AGREE', config.getTermsOfUseAgree())
|
||||
}
|
||||
|
||||
return setupToken(
|
||||
config.getDevelocityAccessKey(),
|
||||
config.getDevelocityAllowUntrustedServer(),
|
||||
config.getDevelocityTokenExpiry()
|
||||
)
|
||||
}
|
||||
|
||||
function maybeExportVariable(variableName: string, value: unknown): void {
|
||||
|
||||
@@ -3,41 +3,28 @@ import * as httpm from '@actions/http-client'
|
||||
import {DevelocityConfig} from '../configuration'
|
||||
import {recordDeprecation} from '../deprecation-collector'
|
||||
|
||||
/**
|
||||
* Exchange the configured Develocity access key(s) for short-lived tokens, export them as the access
|
||||
* key env vars, and return the short-lived token matching the configured Develocity server URL (for
|
||||
* use as the `develocityAccessToken` cache option). Returns `undefined` when there is no access key,
|
||||
* token fetching fails, or no token matches the configured server.
|
||||
*/
|
||||
export async function setupToken(config: DevelocityConfig): Promise<string | undefined> {
|
||||
const develocityAccessKey = config.getDevelocityAccessKey()
|
||||
if (!develocityAccessKey) {
|
||||
return undefined
|
||||
}
|
||||
try {
|
||||
core.debug('Fetching short-lived token...')
|
||||
const tokens = await getToken(
|
||||
develocityAccessKey,
|
||||
config.getDevelocityAllowUntrustedServer(),
|
||||
config.getDevelocityTokenExpiry()
|
||||
)
|
||||
if (tokens != null && !tokens.isEmpty()) {
|
||||
core.debug(`Got token(s), setting the access key env vars`)
|
||||
const token = tokens.raw()
|
||||
core.setSecret(token)
|
||||
exportAccessKeyEnvVars(token)
|
||||
for (const k of tokens.keys) {
|
||||
core.setSecret(k.key)
|
||||
export async function setupToken(
|
||||
develocityAccessKey: string,
|
||||
develocityAllowUntrustedServer: boolean | undefined,
|
||||
develocityTokenExpiry: string
|
||||
): Promise<void> {
|
||||
if (develocityAccessKey) {
|
||||
try {
|
||||
core.debug('Fetching short-lived token...')
|
||||
const tokens = await getToken(develocityAccessKey, develocityAllowUntrustedServer, develocityTokenExpiry)
|
||||
if (tokens != null && !tokens.isEmpty()) {
|
||||
core.debug(`Got token(s), setting the access key env vars`)
|
||||
const token = tokens.raw()
|
||||
core.setSecret(token)
|
||||
exportAccessKeyEnvVars(token)
|
||||
} else {
|
||||
handleMissingAccessToken()
|
||||
}
|
||||
const serverUrl = config.getDevelocityUrl()
|
||||
return serverUrl ? resolveTokenForServer(tokens, serverUrl) : undefined
|
||||
} catch (e) {
|
||||
handleMissingAccessToken()
|
||||
core.warning(`Failed to fetch short-lived token, reason: ${e}`)
|
||||
}
|
||||
handleMissingAccessToken()
|
||||
} catch (e) {
|
||||
handleMissingAccessToken()
|
||||
core.warning(`Failed to fetch short-lived token, reason: ${e}`)
|
||||
}
|
||||
return undefined
|
||||
}
|
||||
|
||||
function exportAccessKeyEnvVars(value: string): void {
|
||||
@@ -147,6 +134,7 @@ type HostnameAccessKey = {
|
||||
}
|
||||
|
||||
export class DevelocityAccessCredentials {
|
||||
static readonly accessKeyRegexp = /^([^;=\s]+=\w+)(;[^;=\s]+=\w+)*$/
|
||||
readonly keys: HostnameAccessKey[]
|
||||
|
||||
private constructor(allKeys: HostnameAccessKey[]) {
|
||||
@@ -159,63 +147,17 @@ export class DevelocityAccessCredentials {
|
||||
|
||||
private static readonly keyDelimiter = ';'
|
||||
private static readonly hostDelimiter = '='
|
||||
private static readonly whitespace = /\s/
|
||||
|
||||
/**
|
||||
* Parse a `host=key[;host=key]*` access key value.
|
||||
*
|
||||
* Only the structure needed to split the value is validated: entries are separated by `;`, and
|
||||
* each entry is a hostname followed by `=` and a key, where the hostname contains no `=`, `;` or
|
||||
* whitespace, and the key is non-empty and contains no `;` or whitespace. Nothing else is
|
||||
* assumed about the key: it may be an OIDC token containing `.`, `-`, `_` and `=` padding, so
|
||||
* each entry is split on its _first_ `=` only.
|
||||
*
|
||||
* Returns `null` if the value doesn't match, emitting a warning that describes what is wrong.
|
||||
*/
|
||||
static parse(rawKey: string): DevelocityAccessCredentials | null {
|
||||
const trimmedKey = rawKey.trim()
|
||||
if (!trimmedKey) {
|
||||
if (!this.isValid(rawKey)) {
|
||||
return null
|
||||
}
|
||||
const keys = new Array<HostnameAccessKey>()
|
||||
const entries = trimmedKey.split(this.keyDelimiter)
|
||||
for (const [index, entry] of entries.entries()) {
|
||||
const separatorIndex = entry.indexOf(this.hostDelimiter)
|
||||
if (separatorIndex === -1) {
|
||||
return this.warnBadlyFormed(index, entries.length, `no '${this.hostDelimiter}' separator`)
|
||||
}
|
||||
const hostname = entry.substring(0, separatorIndex)
|
||||
const key = entry.substring(separatorIndex + 1)
|
||||
if (!hostname) {
|
||||
return this.warnBadlyFormed(index, entries.length, 'empty server name')
|
||||
}
|
||||
if (!key) {
|
||||
return this.warnBadlyFormed(index, entries.length, 'empty key')
|
||||
}
|
||||
if (this.whitespace.test(hostname)) {
|
||||
return this.warnBadlyFormed(index, entries.length, 'whitespace in the server name')
|
||||
}
|
||||
if (this.whitespace.test(key)) {
|
||||
return this.warnBadlyFormed(index, entries.length, 'whitespace in the key')
|
||||
}
|
||||
keys.push({hostname, key})
|
||||
}
|
||||
return new DevelocityAccessCredentials(keys)
|
||||
}
|
||||
|
||||
/**
|
||||
* Warn that an access key value is badly formed and cannot be parsed. Reports only the position
|
||||
* of the offending entry and the reason: the value is a secret, and is not yet registered for
|
||||
* masking at this point, so no part of it is ever included in the message.
|
||||
*/
|
||||
private static warnBadlyFormed(index: number, entryCount: number, reason: string): null {
|
||||
const location = entryCount > 1 ? `entry ${index + 1} of ${entryCount}` : 'the value'
|
||||
core.warning(
|
||||
`Ignoring badly formed Develocity access key: ${reason} in ${location}. ` +
|
||||
`The expected format is 'server${this.hostDelimiter}key` +
|
||||
`[${this.keyDelimiter}server${this.hostDelimiter}key]*'.`
|
||||
return new DevelocityAccessCredentials(
|
||||
rawKey.split(this.keyDelimiter).map(hostKey => {
|
||||
const pair = hostKey.split(this.hostDelimiter)
|
||||
return {hostname: pair[0], key: pair[1]}
|
||||
})
|
||||
)
|
||||
return null
|
||||
}
|
||||
|
||||
isEmpty(): boolean {
|
||||
@@ -227,21 +169,8 @@ export class DevelocityAccessCredentials {
|
||||
.map(k => `${k.hostname}${DevelocityAccessCredentials.hostDelimiter}${k.key}`)
|
||||
.join(DevelocityAccessCredentials.keyDelimiter)
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Resolve the token whose hostname matches a given Develocity server URL. Returns `undefined`
|
||||
* (fail-closed) when the server URL is empty or no token matches the server's host.
|
||||
*/
|
||||
export function resolveTokenForServer(tokens: DevelocityAccessCredentials, serverUrl: string): string | undefined {
|
||||
if (!serverUrl) {
|
||||
return undefined
|
||||
private static isValid(allKeys: string): boolean {
|
||||
return this.accessKeyRegexp.test(allKeys)
|
||||
}
|
||||
let host: string
|
||||
try {
|
||||
host = new URL(serverUrl).hostname
|
||||
} catch {
|
||||
host = serverUrl // tolerate a bare hostname (no scheme)
|
||||
}
|
||||
return tokens.keys.find(k => k.hostname === host)?.key
|
||||
}
|
||||
|
||||
@@ -2,6 +2,7 @@ import * as core from '@actions/core'
|
||||
import * as exec from '@actions/exec'
|
||||
|
||||
import which from 'which'
|
||||
import * as semver from 'semver'
|
||||
import * as provisioner from './provision'
|
||||
import * as gradlew from './gradlew'
|
||||
|
||||
@@ -33,6 +34,48 @@ async function executeGradleBuild(executable: string | undefined, root: string,
|
||||
}
|
||||
}
|
||||
|
||||
export function versionIsAtLeast(actualVersion: string, requiredVersion: string): boolean {
|
||||
if (actualVersion === requiredVersion) {
|
||||
return true
|
||||
}
|
||||
|
||||
const actual = new GradleVersion(actualVersion)
|
||||
const required = new GradleVersion(requiredVersion)
|
||||
|
||||
const actualSemver = semver.coerce(actual.versionPart)!
|
||||
const comparisonSemver = semver.coerce(required.versionPart)!
|
||||
|
||||
if (semver.gt(actualSemver, comparisonSemver)) {
|
||||
return true // Actual version is greater than comparison. So it's at least as new.
|
||||
}
|
||||
if (semver.lt(actualSemver, comparisonSemver)) {
|
||||
return false // Actual version is less than comparison. So it's not as new.
|
||||
}
|
||||
|
||||
// Actual and required version numbers are equal, so compare the other parts
|
||||
|
||||
if (actual.snapshotPart || required.snapshotPart) {
|
||||
if (actual.snapshotPart && !required.snapshotPart && !required.stagePart) {
|
||||
return false // Actual has a snapshot, but required is a plain version. Required is newer.
|
||||
}
|
||||
if (required.snapshotPart && !actual.snapshotPart && !actual.stagePart) {
|
||||
return true // Required has a snapshot, but actual is a plain version. Actual is newer.
|
||||
}
|
||||
|
||||
return false // Cannot compare case where both versions have a snapshot or stage
|
||||
}
|
||||
|
||||
if (actual.stagePart) {
|
||||
if (required.stagePart) {
|
||||
return actual.stagePart >= required.stagePart // Compare stages for newer
|
||||
}
|
||||
|
||||
return false // Actual has a stage, but required does not. So required is always newer.
|
||||
}
|
||||
|
||||
return true // Actual has no stage part or snapshot part, so it cannot be older than required.
|
||||
}
|
||||
|
||||
export async function findGradleExecutableOnPath(): Promise<string | null> {
|
||||
return await which('gradle', {nothrow: true})
|
||||
}
|
||||
@@ -47,3 +90,22 @@ export function parseGradleVersionFromOutput(output: string): string | undefined
|
||||
const versionString = output.match(regex)?.[1]
|
||||
return versionString
|
||||
}
|
||||
|
||||
class GradleVersion {
|
||||
static PATTERN = /((\d+)(\.\d+)+)(-([a-z]+)-(\w+))?(-(SNAPSHOT|\d{14}([-+]\d{4})?))?/
|
||||
|
||||
versionPart: string
|
||||
stagePart: string
|
||||
snapshotPart: string
|
||||
|
||||
constructor(readonly version: string) {
|
||||
const matcher = GradleVersion.PATTERN.exec(version)
|
||||
if (!matcher) {
|
||||
throw new Error(`'${version}' is not a valid Gradle version string (examples: '1.0', '1.0-rc-1')`)
|
||||
}
|
||||
|
||||
this.versionPart = matcher[1]
|
||||
this.stagePart = matcher[4]
|
||||
this.snapshotPart = matcher[7]
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,152 +0,0 @@
|
||||
import * as core from '@actions/core'
|
||||
|
||||
import {GradleVersion} from './gradle-version'
|
||||
import wrapperChecksums from './wrapper-validation/wrapper-checksums.json'
|
||||
|
||||
/** Minor lines behind the latest that stay unreported on the current major. */
|
||||
const MINOR_GRACE = 2
|
||||
|
||||
const SECURITY_SUBSCRIPTION = 'https://gradle.org/security-subscription/?utm_source=github-action'
|
||||
const FEATURE_LIFECYCLE_DOC = 'https://docs.gradle.org/current/userguide/feature_lifecycle.html#eol_support'
|
||||
|
||||
enum SupportStatus {
|
||||
Current = 'current',
|
||||
Behind = 'behind',
|
||||
Eol = 'eol'
|
||||
}
|
||||
|
||||
/** The sign shown beside a version in the build-results table; Current has nothing to say. */
|
||||
const SIGN: Record<SupportStatus, string> = {
|
||||
[SupportStatus.Current]: '',
|
||||
[SupportStatus.Behind]: ':information_source:',
|
||||
[SupportStatus.Eol]: ':warning:'
|
||||
}
|
||||
|
||||
const UPGRADE_LEGEND =
|
||||
`<p>${SIGN[SupportStatus.Behind]} Gradle version is out of date — consider upgrading. ` +
|
||||
`See <a href="${FEATURE_LIFECYCLE_DOC}">Gradle release lifecycle</a></p>`
|
||||
|
||||
/**
|
||||
* Wording shared by the end-of-life annotation, which names a single version, and the end-of-life
|
||||
* section of the Job Summary, which covers every flagged version at once.
|
||||
*/
|
||||
const eolHeadline = (versions: GradleVersion[]): string =>
|
||||
versions.length === 1
|
||||
? `Gradle ${versions[0].version} is end-of-life`
|
||||
: `Gradle ${andList(versions.map(version => version.version))} are end-of-life`
|
||||
const eolDetail = (versions: GradleVersion[]): string =>
|
||||
`Gradle ${andList([...new Set(versions.map(version => `${version.major}.x`))])} releases receive ` +
|
||||
`no further fixes, security fixes included. Update to the latest Gradle version.`
|
||||
|
||||
/** Joins for prose: 'a', 'a and b', 'a, b and c'. */
|
||||
function andList(items: string[]): string {
|
||||
return items.length <= 1 ? (items[0] ?? '') : `${items.slice(0, -1).join(', ')} and ${items.at(-1)}`
|
||||
}
|
||||
|
||||
class ReleaseIndex {
|
||||
private readonly latest: GradleVersion
|
||||
|
||||
constructor(releasedVersions: string[]) {
|
||||
const finalReleases = releasedVersions
|
||||
.map(version => new GradleVersion(version))
|
||||
.filter(version => version.isFinalRelease())
|
||||
|
||||
if (finalReleases.length === 0) {
|
||||
throw new Error('The Gradle release data contains no final release')
|
||||
}
|
||||
|
||||
this.latest = finalReleases.reduce((max, version) => (max.compareTo(version) >= 0 ? max : version))
|
||||
}
|
||||
|
||||
private classifyVersion(version: GradleVersion): SupportStatus {
|
||||
if (!version.isFinalRelease()) {
|
||||
return SupportStatus.Current
|
||||
}
|
||||
|
||||
const majorsBehind = this.latest.major - version.major
|
||||
if (majorsBehind >= 2) {
|
||||
return SupportStatus.Eol
|
||||
}
|
||||
if (majorsBehind === 1) {
|
||||
return SupportStatus.Behind
|
||||
}
|
||||
if (version.major > this.latest.major) {
|
||||
return SupportStatus.Current // newer than the bundled data knows about
|
||||
}
|
||||
// Same major as the latest release: only the minor distance matters, so a newer patch is never reported.
|
||||
return this.latest.minor - version.minor > MINOR_GRACE ? SupportStatus.Behind : SupportStatus.Current
|
||||
}
|
||||
|
||||
/** Support status of a single version; an unparseable string is treated as current. */
|
||||
classify(gradleVersion: string): SupportStatus {
|
||||
const version = GradleVersion.parseUntrusted(gradleVersion)
|
||||
return version ? this.classifyVersion(version) : SupportStatus.Current
|
||||
}
|
||||
|
||||
/** The flagged versions grouped by status (Current omitted). */
|
||||
classified(gradleVersions: string[]): Map<SupportStatus, GradleVersion[]> {
|
||||
const byStatus = new Map<SupportStatus, GradleVersion[]>()
|
||||
const parsed = [...new Set(gradleVersions)]
|
||||
.map(version => GradleVersion.parseUntrusted(version))
|
||||
.filter((version): version is GradleVersion => version !== undefined)
|
||||
.sort(GradleVersion.compare)
|
||||
|
||||
for (const version of parsed) {
|
||||
const status = this.classifyVersion(version)
|
||||
if (status !== SupportStatus.Current) {
|
||||
byStatus.set(status, [...(byStatus.get(status) ?? []), version])
|
||||
}
|
||||
}
|
||||
return byStatus
|
||||
}
|
||||
}
|
||||
|
||||
const RELEASES = new ReleaseIndex(wrapperChecksums.map(entry => entry.version))
|
||||
|
||||
/** The status sign shown beside a version in the build-results table, or '' when there is nothing to say. */
|
||||
export function supportStatusSign(gradleVersion: string): string {
|
||||
return SIGN[RELEASES.classify(gradleVersion)]
|
||||
}
|
||||
|
||||
/** Job annotations: a warning for each end-of-life version, a notice for each version merely out of date. */
|
||||
export function reportSupportStatus(gradleVersions: string[]): void {
|
||||
const byStatus = RELEASES.classified(gradleVersions)
|
||||
for (const version of byStatus.get(SupportStatus.Eol) ?? []) {
|
||||
core.warning(
|
||||
`${eolHeadline([version])}. ${eolDetail([version])} If you cannot upgrade, see ${SECURITY_SUBSCRIPTION} for options`,
|
||||
{title: 'End-of-life Gradle version'}
|
||||
)
|
||||
}
|
||||
for (const version of byStatus.get(SupportStatus.Behind) ?? []) {
|
||||
core.notice(
|
||||
`Gradle ${version.version} is out of date: consider updating to the latest Gradle version. See ${FEATURE_LIFECYCLE_DOC}`,
|
||||
{title: 'Out-of-date Gradle version'}
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
/** The fold-and-paragraph report placed under the build-results table. */
|
||||
export function renderSupportStatus(gradleVersions: string[]): string {
|
||||
const byStatus = RELEASES.classified(gradleVersions)
|
||||
const blocks: string[] = []
|
||||
|
||||
const eol = byStatus.get(SupportStatus.Eol) ?? []
|
||||
if (eol.length > 0) {
|
||||
// One section however many versions are end-of-life; the table already marks which they are.
|
||||
blocks.push(renderEolSection(eol))
|
||||
}
|
||||
if (byStatus.has(SupportStatus.Behind)) {
|
||||
blocks.push(UPGRADE_LEGEND)
|
||||
}
|
||||
|
||||
// The leading blank line closes the preceding HTML block, so each rendering stands on its own.
|
||||
return blocks.length > 0 ? `\n${blocks.join('\n')}\n` : ''
|
||||
}
|
||||
|
||||
function renderEolSection(versions: GradleVersion[]): string {
|
||||
return `<details>
|
||||
<summary>${SIGN[SupportStatus.Eol]} ${eolHeadline(versions)}</summary>
|
||||
<p>${eolDetail(versions)}</p>
|
||||
<p>If you cannot upgrade, see the <a href="${SECURITY_SUBSCRIPTION}">Gradle Security Subscription</a> for options.</p>
|
||||
</details>`
|
||||
}
|
||||
@@ -1,134 +0,0 @@
|
||||
interface Stage {
|
||||
readonly rank: number
|
||||
readonly number: number
|
||||
readonly patchNo: string
|
||||
}
|
||||
|
||||
/**
|
||||
* A Gradle version, parsed and ordered the same way Gradle's own `org.gradle.util.GradleVersion` does
|
||||
*/
|
||||
export class GradleVersion {
|
||||
private static readonly PATTERN = /^((\d+)(\.\d+)+)(-([a-zA-Z]+)-(\w+))?(-(SNAPSHOT|\d{14}([-+]\d{4})?))?$/
|
||||
|
||||
// Ranks match Gradle's stage numbers; anything unrecognised sits between milestone and preview.
|
||||
private static readonly STAGE_RANK: Record<string, number> = {milestone: 0, preview: 2, rc: 3}
|
||||
private static readonly STAGE_UNKNOWN = 1
|
||||
|
||||
readonly major: number
|
||||
readonly minor: number
|
||||
readonly patch: number
|
||||
|
||||
private readonly versionPart: string
|
||||
private readonly stage: Stage | undefined
|
||||
private readonly snapshot: number | undefined
|
||||
|
||||
constructor(readonly version: string) {
|
||||
const matcher = GradleVersion.PATTERN.exec(version)
|
||||
if (!matcher) {
|
||||
throw new Error(`'${version}' is not a valid Gradle version string (examples: '1.0', '1.0-rc-1')`)
|
||||
}
|
||||
|
||||
this.versionPart = matcher[1]
|
||||
this.stage = GradleVersion.parseStage(matcher[5], matcher[6])
|
||||
this.snapshot = GradleVersion.parseSnapshot(matcher[8], matcher[9])
|
||||
|
||||
const parts = this.versionPart.split('.')
|
||||
this.major = Number(parts[0])
|
||||
this.minor = Number(parts[1])
|
||||
this.patch = parts.length > 2 ? Number(parts[2]) : 0
|
||||
}
|
||||
|
||||
isFinalRelease(): boolean {
|
||||
return this.stage === undefined && this.snapshot === undefined
|
||||
}
|
||||
|
||||
compareTo(other: GradleVersion): number {
|
||||
const parts = this.versionPart.split('.')
|
||||
const otherParts = other.versionPart.split('.')
|
||||
for (let i = 0; i < parts.length && i < otherParts.length; i++) {
|
||||
if (Number(parts[i]) !== Number(otherParts[i])) {
|
||||
return Math.sign(Number(parts[i]) - Number(otherParts[i]))
|
||||
}
|
||||
}
|
||||
if (parts.length !== otherParts.length) {
|
||||
return Math.sign(parts.length - otherParts.length)
|
||||
}
|
||||
|
||||
if (this.stage && other.stage) {
|
||||
const stageDiff = GradleVersion.compareStages(this.stage, other.stage)
|
||||
if (stageDiff !== 0) {
|
||||
return stageDiff
|
||||
}
|
||||
} else if (this.stage) {
|
||||
return -1 // a staged version precedes the final release of the same base
|
||||
} else if (other.stage) {
|
||||
return 1
|
||||
}
|
||||
|
||||
// A version with no snapshot is newer than any snapshot of the same base.
|
||||
const thisSnapshot = this.snapshot ?? Number.MAX_SAFE_INTEGER
|
||||
const otherSnapshot = other.snapshot ?? Number.MAX_SAFE_INTEGER
|
||||
if (thisSnapshot !== otherSnapshot) {
|
||||
return Math.sign(thisSnapshot - otherSnapshot)
|
||||
}
|
||||
return this.version < other.version ? -1 : this.version > other.version ? 1 : 0
|
||||
}
|
||||
|
||||
static parseUntrusted(version: string): GradleVersion | undefined {
|
||||
try {
|
||||
return new GradleVersion(version)
|
||||
} catch {
|
||||
return undefined
|
||||
}
|
||||
}
|
||||
|
||||
/** Comparator for sorting; `this: void` marks it safe to pass detached, as `Array.sort` does. */
|
||||
static compare(this: void, a: GradleVersion, b: GradleVersion): number {
|
||||
return a.compareTo(b)
|
||||
}
|
||||
|
||||
private static parseStage(name: string | undefined, numberPart: string | undefined): Stage | undefined {
|
||||
if (name === undefined) {
|
||||
return undefined
|
||||
}
|
||||
// Stage names are matched exactly, as Gradle does: 'RC' is not 'rc', and ranks as unknown.
|
||||
const rank = GradleVersion.STAGE_RANK[name] ?? GradleVersion.STAGE_UNKNOWN
|
||||
// The whole stage string must be a number with an optional letter suffix; anything else ranks as 0,
|
||||
// leaving versions such as branch names to be separated by the version string itself.
|
||||
const match = /^(\d+)([a-z])?$/.exec(numberPart ?? '')
|
||||
return {rank, number: match ? Number(match[1]) : 0, patchNo: match?.[2] ?? '_'}
|
||||
}
|
||||
|
||||
private static parseSnapshot(snapshot: string | undefined, timezone: string | undefined): number | undefined {
|
||||
if (snapshot === undefined) {
|
||||
return undefined
|
||||
}
|
||||
if (snapshot === 'SNAPSHOT') {
|
||||
return 0
|
||||
}
|
||||
// A 14-digit timestamp (yyyyMMddHHmmss), optionally with a timezone offset like +0000 (UTC when absent).
|
||||
const date = `${snapshot.slice(0, 4)}-${snapshot.slice(4, 6)}-${snapshot.slice(6, 8)}`
|
||||
const time = `${snapshot.slice(8, 10)}:${snapshot.slice(10, 12)}:${snapshot.slice(12, 14)}`
|
||||
const offset = timezone ? `${timezone.slice(0, 3)}:${timezone.slice(3, 5)}` : 'Z'
|
||||
const instant = Date.parse(`${date}T${time}${offset}`)
|
||||
if (Number.isNaN(instant)) {
|
||||
// The digits matched the pattern but name no real instant. Rejecting here keeps a NaN out of
|
||||
// compareTo, which would otherwise make ordering undefined. Gradle likewise fails to parse.
|
||||
throw new Error(`'${snapshot}${timezone ?? ''}' is not a valid Gradle snapshot timestamp`)
|
||||
}
|
||||
return instant
|
||||
}
|
||||
|
||||
private static compareStages(a: Stage, b: Stage): number {
|
||||
if (a.rank !== b.rank) {
|
||||
return Math.sign(a.rank - b.rank)
|
||||
}
|
||||
if (a.number !== b.number) {
|
||||
return Math.sign(a.number - b.number)
|
||||
}
|
||||
if (a.patchNo !== b.patchNo) {
|
||||
return a.patchNo < b.patchNo ? -1 : 1
|
||||
}
|
||||
return 0
|
||||
}
|
||||
}
|
||||
+16
-114
@@ -2,48 +2,35 @@ import * as core from '@actions/core'
|
||||
import * as github from '@actions/github'
|
||||
|
||||
import {BuildResult} from './build-results'
|
||||
import {CacheReport} from './cache-service'
|
||||
import {ProviderNote, renderCachingReport} from './caching-report'
|
||||
import {DependencyGraphConfig, getActionId, getGithubToken, getJobMatrix, SummaryConfig} from './configuration'
|
||||
import {SummaryConfig, getActionId, getGithubToken} from './configuration'
|
||||
import {Deprecation, getDeprecations, getErrors} from './deprecation-collector'
|
||||
import {renderSupportStatus, supportStatusSign} from './gradle-support-status'
|
||||
|
||||
export async function generateJobSummary(
|
||||
buildResults: BuildResult[],
|
||||
cacheReport: CacheReport,
|
||||
providerNote: ProviderNote | undefined,
|
||||
cachingReport: string,
|
||||
config: SummaryConfig
|
||||
): Promise<void> {
|
||||
core.startGroup('Generating Job Summary')
|
||||
|
||||
const heading = renderActionHeading()
|
||||
|
||||
const errors = renderErrors()
|
||||
if (errors) {
|
||||
core.summary.addRaw(heading)
|
||||
core.summary.addRaw(errors)
|
||||
await core.summary.write()
|
||||
return
|
||||
}
|
||||
|
||||
const summaryTable = renderSummaryTable(buildResults)
|
||||
const cachingReport = renderCachingReport(cacheReport, providerNote)
|
||||
const hasFailure = anyFailed(buildResults)
|
||||
|
||||
core.info(summaryTable)
|
||||
core.info('============================')
|
||||
core.info(cachingReport)
|
||||
|
||||
if (config.shouldGenerateJobSummary(hasFailure)) {
|
||||
core.summary.addRaw(heading)
|
||||
core.info('Generating Job Summary')
|
||||
|
||||
core.summary.addRaw(summaryTable)
|
||||
core.summary.addRaw(cachingReport)
|
||||
await core.summary.write()
|
||||
}
|
||||
core.endGroup()
|
||||
|
||||
if (config.canAddPRComment()) {
|
||||
await minimizeObsoletePRComments()
|
||||
} else {
|
||||
core.info('============================')
|
||||
core.info(summaryTable)
|
||||
core.info('============================')
|
||||
core.info(cachingReport)
|
||||
core.info('============================')
|
||||
}
|
||||
|
||||
if (config.shouldAddPRComment(hasFailure)) {
|
||||
@@ -61,8 +48,8 @@ async function addPRComment(jobSummary: string): Promise<void> {
|
||||
const pull_request_number = context.payload.pull_request.number
|
||||
core.info(`Adding Job Summary as comment to PR #${pull_request_number}.`)
|
||||
|
||||
const prComment = `${jobMarker(context)}
|
||||
${renderActionHeading()}<a href="${context.serverUrl}/${context.repo.owner}/${context.repo.repo}/actions/runs/${context.runId}" target="_blank">
|
||||
const prComment = `<h3>Job Summary for Gradle</h3>
|
||||
<a href="${context.serverUrl}/${context.repo.owner}/${context.repo.repo}/actions/runs/${context.runId}" target="_blank">
|
||||
<h5>${context.workflow} :: <em>${context.job}</em></h5>
|
||||
</a>
|
||||
|
||||
@@ -70,7 +57,6 @@ ${jobSummary}`
|
||||
|
||||
const github_token = getGithubToken()
|
||||
const octokit = github.getOctokit(github_token)
|
||||
|
||||
try {
|
||||
await octokit.rest.issues.createComment({
|
||||
...context.repo,
|
||||
@@ -98,13 +84,7 @@ Note that this permission is never available for a workflow triggered from a rep
|
||||
}
|
||||
|
||||
export function renderSummaryTable(results: BuildResult[]): string {
|
||||
return `${renderDeprecations()}\n${renderBuildResults(results)}\n${renderSupportStatus(results.map(result => result.gradleVersion))}`
|
||||
}
|
||||
|
||||
function renderActionHeading(): string {
|
||||
const actionId = getActionId()
|
||||
const caption = actionId ? ` <sub><em>captured by ${actionId}</em></sub>` : ''
|
||||
return `<h3>Gradle Builds${caption}</h3>\n\n`
|
||||
return `${renderDeprecations()}\n${renderBuildResults(results)}`
|
||||
}
|
||||
|
||||
function renderErrors(): string | undefined {
|
||||
@@ -148,7 +128,8 @@ function renderBuildResults(results: BuildResult[]): string {
|
||||
<th>Build Outcome</th>
|
||||
<th>Build Scan®</th>
|
||||
</tr>${results.map(result => renderBuildResultRow(result)).join('')}
|
||||
</table>`
|
||||
</table>
|
||||
`
|
||||
}
|
||||
|
||||
function anyFailed(results: BuildResult[]): boolean {
|
||||
@@ -160,17 +141,12 @@ function renderBuildResultRow(result: BuildResult): string {
|
||||
<tr>
|
||||
<td>${truncateString(result.rootProjectName, 30)}</td>
|
||||
<td>${truncateString(result.requestedTasks, 60)}</td>
|
||||
<td align='center'>${renderGradleVersion(result.gradleVersion)}</td>
|
||||
<td align='center'>${result.gradleVersion}</td>
|
||||
<td align='center'>${renderOutcome(result)}</td>
|
||||
<td>${renderBuildScan(result)}</td>
|
||||
</tr>`
|
||||
}
|
||||
|
||||
function renderGradleVersion(gradleVersion: string): string {
|
||||
const sign = supportStatusSign(gradleVersion)
|
||||
return sign ? `${gradleVersion} ${sign}` : gradleVersion
|
||||
}
|
||||
|
||||
function renderOutcome(result: BuildResult): string {
|
||||
return result.buildFailed ? ':x:' : ':white_check_mark:'
|
||||
}
|
||||
@@ -225,77 +201,3 @@ function truncateString(str: string, maxLength: number): string {
|
||||
return str
|
||||
}
|
||||
}
|
||||
|
||||
async function minimizeObsoletePRComments(): Promise<void> {
|
||||
const context = github.context
|
||||
if (context.payload.pull_request == null) {
|
||||
core.info('No pull_request trigger detected: not minimizing obsolete PR comments')
|
||||
return
|
||||
}
|
||||
|
||||
const prNumber = context.payload.pull_request.number
|
||||
core.info(`Minimizing obsolete Job Summary comments on PR #${prNumber}.`)
|
||||
|
||||
const marker = jobMarker(context)
|
||||
const octokit = github.getOctokit(getGithubToken())
|
||||
const {owner, repo} = context.repo
|
||||
|
||||
const query = `
|
||||
query($owner: String!, $repo: String!, $prNumber: Int!) {
|
||||
repository(owner: $owner, name: $repo) {
|
||||
pullRequest(number: $prNumber) {
|
||||
comments(last: 100) {
|
||||
nodes { id body isMinimized url }
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
`
|
||||
let comments: PullRequestComment[]
|
||||
try {
|
||||
const {repository} = await octokit.graphql<CommentsQueryResult>(query, {owner, repo, prNumber})
|
||||
comments = repository.pullRequest?.comments?.nodes?.filter((c): c is PullRequestComment => c !== null) ?? []
|
||||
} catch (error) {
|
||||
return core.warning(`Failed to fetch comments: ${error}`)
|
||||
}
|
||||
|
||||
const mutation = `
|
||||
mutation($id: ID!) {
|
||||
minimizeComment(input: {subjectId: $id, classifier: OUTDATED}) {
|
||||
clientMutationId
|
||||
}
|
||||
}
|
||||
`
|
||||
|
||||
const commentsToMinimize = comments
|
||||
.filter(c => !c.isMinimized && c.body.includes(marker))
|
||||
.map(async c =>
|
||||
octokit
|
||||
.graphql(mutation, {id: c.id})
|
||||
.then(() => core.info(`Successfully minimized (id:${c.id}, url:${c.url})`))
|
||||
.catch(e => core.warning(`Failed to minimize (id:${c.id}, url:${c.url}, error:${e?.message || e})`))
|
||||
)
|
||||
await Promise.allSettled(commentsToMinimize)
|
||||
}
|
||||
|
||||
export function jobMarker(context: typeof github.context): string {
|
||||
const jobCorrelator = DependencyGraphConfig.constructJobCorrelator(context.workflow, context.job, getJobMatrix())
|
||||
return `<!-- gradle-job-summary: ${jobCorrelator} -->`
|
||||
}
|
||||
|
||||
interface PullRequestComment {
|
||||
id: string
|
||||
body: string
|
||||
isMinimized: boolean
|
||||
url: string
|
||||
}
|
||||
|
||||
interface CommentsQueryResult {
|
||||
repository: {
|
||||
pullRequest?: {
|
||||
comments?: {
|
||||
nodes?: (PullRequestComment | null)[] | null
|
||||
} | null
|
||||
} | null
|
||||
}
|
||||
}
|
||||
|
||||
+1
-1
@@ -6,7 +6,7 @@ buildscript {
|
||||
def pluginRepositoryUrl = getInputParam('gradle.plugin-repository.url') ?: 'https://plugins.gradle.org/m2'
|
||||
def pluginRepositoryUsername = getInputParam('gradle.plugin-repository.username')
|
||||
def pluginRepositoryPassword = getInputParam('gradle.plugin-repository.password')
|
||||
def dependencyGraphPluginVersion = getInputParam('dependency-graph-plugin.version') ?: '1.5.0'
|
||||
def dependencyGraphPluginVersion = getInputParam('dependency-graph-plugin.version') ?: '1.4.1'
|
||||
|
||||
logger.lifecycle("Resolving dependency graph plugin ${dependencyGraphPluginVersion} from plugin repository: ${pluginRepositoryUrl}")
|
||||
repositories {
|
||||
|
||||
@@ -5,10 +5,9 @@ import * as path from 'path'
|
||||
import * as os from 'os'
|
||||
import * as jobSummary from './job-summary'
|
||||
import * as buildScan from './develocity/build-scan'
|
||||
import {setupToken} from './develocity/short-lived-token'
|
||||
|
||||
import {loadBuildResults, markBuildResultsProcessed} from './build-results'
|
||||
import {getCacheService, getProviderNote} from './cache-service-loader'
|
||||
import {getCacheService} from './cache-service-loader'
|
||||
import {CacheOptions} from './cache-service'
|
||||
import {
|
||||
DevelocityConfig,
|
||||
@@ -19,12 +18,9 @@ import {
|
||||
} from './configuration'
|
||||
import * as wrapperValidator from './wrapper-validation/wrapper-validator'
|
||||
import {initializeGradleUserHome} from './gradle-user-home'
|
||||
import {reportSupportStatus} from './gradle-support-status'
|
||||
|
||||
const GRADLE_SETUP_VAR = 'GRADLE_BUILD_ACTION_SETUP_COMPLETED'
|
||||
const GRADLE_USER_HOME = 'GRADLE_USER_HOME'
|
||||
// Short-lived Develocity token for the configured server, resolved during setup and reused on save.
|
||||
const DEVELOCITY_CACHE_TOKEN = 'DEVELOCITY_CACHE_TOKEN'
|
||||
|
||||
export async function setup(
|
||||
cacheConfig: CacheConfig,
|
||||
@@ -48,27 +44,17 @@ export async function setup(
|
||||
|
||||
initializeGradleUserHome(userHome, gradleUserHome, cacheConfig.getCacheEncryptionKey())
|
||||
|
||||
// Exchange the long-lived access key(s) for short-lived tokens, resolving the token for the
|
||||
// configured Develocity server and retaining it for the post-action (save) step.
|
||||
const develocityServerUrl = develocityConfig.getDevelocityUrl() || undefined
|
||||
const cacheToken = await setupToken(develocityConfig)
|
||||
core.saveState(DEVELOCITY_CACHE_TOKEN, cacheToken ?? '')
|
||||
|
||||
const cacheService = await getCacheService(cacheConfig)
|
||||
await cacheService.restore(gradleUserHome, cacheOptionsFrom(cacheConfig, develocityServerUrl, cacheToken))
|
||||
await cacheService.restore(gradleUserHome, cacheOptionsFrom(cacheConfig))
|
||||
|
||||
await wrapperValidator.validateWrappers(wrapperValidationConfig, getWorkspaceDirectory(), gradleUserHome)
|
||||
|
||||
buildScan.setup(develocityConfig)
|
||||
await buildScan.setup(develocityConfig)
|
||||
|
||||
return true
|
||||
}
|
||||
|
||||
export async function complete(
|
||||
cacheConfig: CacheConfig,
|
||||
develocityConfig: DevelocityConfig,
|
||||
summaryConfig: SummaryConfig
|
||||
): Promise<boolean> {
|
||||
export async function complete(cacheConfig: CacheConfig, summaryConfig: SummaryConfig): Promise<boolean> {
|
||||
if (!core.getState(GRADLE_SETUP_VAR)) {
|
||||
core.info('Gradle setup post-action only performed for first gradle/actions step in workflow.')
|
||||
return false
|
||||
@@ -78,16 +64,9 @@ export async function complete(
|
||||
const buildResults = loadBuildResults()
|
||||
|
||||
const gradleUserHome = core.getState(GRADLE_USER_HOME)
|
||||
const develocityServerUrl = develocityConfig.getDevelocityUrl() || undefined
|
||||
const cacheToken = core.getState(DEVELOCITY_CACHE_TOKEN) || undefined
|
||||
const cacheService = await getCacheService(cacheConfig)
|
||||
const cacheReport = await cacheService.save(
|
||||
gradleUserHome,
|
||||
buildResults,
|
||||
cacheOptionsFrom(cacheConfig, develocityServerUrl, cacheToken)
|
||||
)
|
||||
await jobSummary.generateJobSummary(buildResults, cacheReport, getProviderNote(cacheConfig), summaryConfig)
|
||||
reportSupportStatus(buildResults.map(result => result.gradleVersion))
|
||||
const cachingReport = await cacheService.save(gradleUserHome, buildResults, cacheOptionsFrom(cacheConfig))
|
||||
await jobSummary.generateJobSummary(buildResults, cachingReport, summaryConfig)
|
||||
|
||||
markBuildResultsProcessed()
|
||||
|
||||
@@ -96,11 +75,7 @@ export async function complete(
|
||||
return true
|
||||
}
|
||||
|
||||
function cacheOptionsFrom(
|
||||
config: CacheConfig,
|
||||
develocityServerUrl: string | undefined,
|
||||
develocityAccessToken: string | undefined
|
||||
): CacheOptions {
|
||||
function cacheOptionsFrom(config: CacheConfig): CacheOptions {
|
||||
return {
|
||||
disabled: config.isCacheDisabled(),
|
||||
readOnly: config.isCacheReadOnly(),
|
||||
@@ -109,8 +84,6 @@ function cacheOptionsFrom(
|
||||
strictMatch: config.isCacheStrictMatch(),
|
||||
cleanup: config.getCacheCleanupOption(),
|
||||
encryptionKey: config.getCacheEncryptionKey() || undefined,
|
||||
develocityAccessToken,
|
||||
develocityServerUrl,
|
||||
includes: config.getCacheIncludes(),
|
||||
excludes: config.getCacheExcludes()
|
||||
}
|
||||
|
||||
@@ -1,136 +1,4 @@
|
||||
[
|
||||
{
|
||||
"version": "8.14.6",
|
||||
"checksum": "ad16bca46cb71bb5887c546860d93992aeee35c1fdaf4a242b0a612375d937e0"
|
||||
},
|
||||
{
|
||||
"version": "9.8.1",
|
||||
"checksum": "3b8a25775a69158b5ad2b1d17a80a88dc7b40a352a73eb27d06c612a7ce68e98"
|
||||
},
|
||||
{
|
||||
"version": "9.8.0",
|
||||
"checksum": "238e777fcddd7e34f9708186085def2abd6e08e658505b38718d79d74c21abd5"
|
||||
},
|
||||
{
|
||||
"version": "9.8.0-rc-3",
|
||||
"checksum": "238e777fcddd7e34f9708186085def2abd6e08e658505b38718d79d74c21abd5"
|
||||
},
|
||||
{
|
||||
"version": "9.9.0-milestone-2",
|
||||
"checksum": "238e777fcddd7e34f9708186085def2abd6e08e658505b38718d79d74c21abd5"
|
||||
},
|
||||
{
|
||||
"version": "9.8.0-rc-2",
|
||||
"checksum": "238e777fcddd7e34f9708186085def2abd6e08e658505b38718d79d74c21abd5"
|
||||
},
|
||||
{
|
||||
"version": "9.9.0-milestone-1",
|
||||
"checksum": "238e777fcddd7e34f9708186085def2abd6e08e658505b38718d79d74c21abd5"
|
||||
},
|
||||
{
|
||||
"version": "9.8.0-rc-1",
|
||||
"checksum": "238e777fcddd7e34f9708186085def2abd6e08e658505b38718d79d74c21abd5"
|
||||
},
|
||||
{
|
||||
"version": "9.8.0-milestone-2",
|
||||
"checksum": "2b2e2cee3d8a8e5379b4f1c5902419404e83c1dba5ff55192ad5986e3f44cd6e"
|
||||
},
|
||||
{
|
||||
"version": "9.7.1",
|
||||
"checksum": "7a9ce74cff467ca1bf60a4fcd9f05185acceda4d0f382434d393e17864262c5d"
|
||||
},
|
||||
{
|
||||
"version": "9.8.0-milestone-1",
|
||||
"checksum": "2b2e2cee3d8a8e5379b4f1c5902419404e83c1dba5ff55192ad5986e3f44cd6e"
|
||||
},
|
||||
{
|
||||
"version": "9.7.0",
|
||||
"checksum": "7a9ce74cff467ca1bf60a4fcd9f05185acceda4d0f382434d393e17864262c5d"
|
||||
},
|
||||
{
|
||||
"version": "9.7.0-rc-3",
|
||||
"checksum": "7a9ce74cff467ca1bf60a4fcd9f05185acceda4d0f382434d393e17864262c5d"
|
||||
},
|
||||
{
|
||||
"version": "9.7.0-rc-2",
|
||||
"checksum": "7a9ce74cff467ca1bf60a4fcd9f05185acceda4d0f382434d393e17864262c5d"
|
||||
},
|
||||
{
|
||||
"version": "9.7.0-rc-1",
|
||||
"checksum": "7a9ce74cff467ca1bf60a4fcd9f05185acceda4d0f382434d393e17864262c5d"
|
||||
},
|
||||
{
|
||||
"version": "9.7.0-milestone-3",
|
||||
"checksum": "7a9ce74cff467ca1bf60a4fcd9f05185acceda4d0f382434d393e17864262c5d"
|
||||
},
|
||||
{
|
||||
"version": "9.7.0-milestone-2",
|
||||
"checksum": "7a9ce74cff467ca1bf60a4fcd9f05185acceda4d0f382434d393e17864262c5d"
|
||||
},
|
||||
{
|
||||
"version": "9.6.1",
|
||||
"checksum": "497c8c2a7e5031f6aa847f88104aa80a93532ec32ee17bdb8d1d2f67a194a9c7"
|
||||
},
|
||||
{
|
||||
"version": "9.6.0",
|
||||
"checksum": "497c8c2a7e5031f6aa847f88104aa80a93532ec32ee17bdb8d1d2f67a194a9c7"
|
||||
},
|
||||
{
|
||||
"version": "9.7.0-milestone-1",
|
||||
"checksum": "8a23bf708fd4e02674e77fb34b0fa7c02f0d53c2ad377385ab507422313d26d1"
|
||||
},
|
||||
{
|
||||
"version": "9.6.0-rc-3",
|
||||
"checksum": "497c8c2a7e5031f6aa847f88104aa80a93532ec32ee17bdb8d1d2f67a194a9c7"
|
||||
},
|
||||
{
|
||||
"version": "9.6.0-rc-2",
|
||||
"checksum": "497c8c2a7e5031f6aa847f88104aa80a93532ec32ee17bdb8d1d2f67a194a9c7"
|
||||
},
|
||||
{
|
||||
"version": "9.6.0-rc-1",
|
||||
"checksum": "497c8c2a7e5031f6aa847f88104aa80a93532ec32ee17bdb8d1d2f67a194a9c7"
|
||||
},
|
||||
{
|
||||
"version": "9.6.0-milestone-3",
|
||||
"checksum": "497c8c2a7e5031f6aa847f88104aa80a93532ec32ee17bdb8d1d2f67a194a9c7"
|
||||
},
|
||||
{
|
||||
"version": "9.5.1",
|
||||
"checksum": "497c8c2a7e5031f6aa847f88104aa80a93532ec32ee17bdb8d1d2f67a194a9c7"
|
||||
},
|
||||
{
|
||||
"version": "9.6.0-milestone-2",
|
||||
"checksum": "497c8c2a7e5031f6aa847f88104aa80a93532ec32ee17bdb8d1d2f67a194a9c7"
|
||||
},
|
||||
{
|
||||
"version": "8.14.5",
|
||||
"checksum": "7d3a4ac4de1c32b59bc6a4eb8ecb8e612ccd0cf1ae1e99f66902da64df296172"
|
||||
},
|
||||
{
|
||||
"version": "9.5.0",
|
||||
"checksum": "497c8c2a7e5031f6aa847f88104aa80a93532ec32ee17bdb8d1d2f67a194a9c7"
|
||||
},
|
||||
{
|
||||
"version": "9.5.0-rc-4",
|
||||
"checksum": "497c8c2a7e5031f6aa847f88104aa80a93532ec32ee17bdb8d1d2f67a194a9c7"
|
||||
},
|
||||
{
|
||||
"version": "9.6.0-milestone-1",
|
||||
"checksum": "497c8c2a7e5031f6aa847f88104aa80a93532ec32ee17bdb8d1d2f67a194a9c7"
|
||||
},
|
||||
{
|
||||
"version": "9.5.0-rc-3",
|
||||
"checksum": "497c8c2a7e5031f6aa847f88104aa80a93532ec32ee17bdb8d1d2f67a194a9c7"
|
||||
},
|
||||
{
|
||||
"version": "9.5.0-rc-2",
|
||||
"checksum": "497c8c2a7e5031f6aa847f88104aa80a93532ec32ee17bdb8d1d2f67a194a9c7"
|
||||
},
|
||||
{
|
||||
"version": "9.5.0-rc-1",
|
||||
"checksum": "497c8c2a7e5031f6aa847f88104aa80a93532ec32ee17bdb8d1d2f67a194a9c7"
|
||||
},
|
||||
{
|
||||
"version": "9.4.1",
|
||||
"checksum": "55243ef57851f12b070ad14f7f5bb8302daceeebc5bce5ece5fa6edb23e1145c"
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user