mirror of
https://github.com/gradle/gradle-build-action.git
synced 2025-10-19 22:38:58 +08:00
Compare commits
56 Commits
v2.8.0
...
release/v2
Author | SHA1 | Date | |
---|---|---|---|
|
a8f75513ea | ||
|
9283312acb | ||
|
7c8a278ea0 | ||
|
d8ca9b7d2e | ||
|
982da8e78c | ||
|
a0fc8606d2 | ||
|
a1980784de | ||
|
f95e9c7459 | ||
|
8cbcb9948b | ||
|
a71aff6a12 | ||
|
77699bae74 | ||
|
dc5927259f | ||
|
4f0075d967 | ||
|
e1f9864a52 | ||
|
76d5a9b475 | ||
|
39d8c6d06e | ||
|
0280eb7de5 | ||
|
87a9a15658 | ||
|
375481748b | ||
|
beff1c573c | ||
|
21a3ebb55f | ||
|
a5be560235 | ||
|
9bca466e27 | ||
|
f757bcfd86 | ||
|
8b6c211905 | ||
|
8db1c7621b | ||
|
6eaacfc06c | ||
|
750905c0ed | ||
|
d5fbcc8361 | ||
|
0e761ca2b4 | ||
|
6b7c087721 | ||
|
0bfe00a136 | ||
|
62cce3c597 | ||
|
842c587ad8 | ||
|
4241e05054 | ||
|
bfa3c0508e | ||
|
c3bdce8205 | ||
|
f92e7c3428 | ||
|
d1b726d8c1 | ||
|
6fcc109efa | ||
|
fde5b4fcde | ||
|
324fbdc804 | ||
|
5658338fb0 | ||
|
87ccc98a2a | ||
|
4441c9f9bf | ||
|
b5126f31db | ||
|
d8615ccc8b | ||
|
444c20baf7 | ||
|
aea76e1766 | ||
|
103e3a7ba7 | ||
|
73e3fc21c7 | ||
|
b063df05a4 | ||
|
5e3952da92 | ||
|
ed940a329a | ||
|
3bfe3a4658 | ||
|
8f08e41675 |
Binary file not shown.
@@ -1,7 +1,7 @@
|
|||||||
distributionBase=GRADLE_USER_HOME
|
distributionBase=GRADLE_USER_HOME
|
||||||
distributionPath=wrapper/dists
|
distributionPath=wrapper/dists
|
||||||
distributionSha256Sum=591855b517fc635b9e04de1d05d5e76ada3f89f5fc76f87978d1b245b4f69225
|
distributionSha256Sum=9d926787066a081739e8200858338b4a69e837c3a821a33aca9db09dd4a41026
|
||||||
distributionUrl=https\://services.gradle.org/distributions/gradle-8.3-bin.zip
|
distributionUrl=https\://services.gradle.org/distributions/gradle-8.5-bin.zip
|
||||||
networkTimeout=10000
|
networkTimeout=10000
|
||||||
validateDistributionUrl=true
|
validateDistributionUrl=true
|
||||||
zipStoreBase=GRADLE_USER_HOME
|
zipStoreBase=GRADLE_USER_HOME
|
||||||
|
14
.github/workflow-samples/gradle-plugin/gradlew
vendored
14
.github/workflow-samples/gradle-plugin/gradlew
vendored
@@ -145,7 +145,7 @@ if ! "$cygwin" && ! "$darwin" && ! "$nonstop" ; then
|
|||||||
case $MAX_FD in #(
|
case $MAX_FD in #(
|
||||||
max*)
|
max*)
|
||||||
# In POSIX sh, ulimit -H is undefined. That's why the result is checked to see if it worked.
|
# In POSIX sh, ulimit -H is undefined. That's why the result is checked to see if it worked.
|
||||||
# shellcheck disable=SC3045
|
# shellcheck disable=SC2039,SC3045
|
||||||
MAX_FD=$( ulimit -H -n ) ||
|
MAX_FD=$( ulimit -H -n ) ||
|
||||||
warn "Could not query maximum file descriptor limit"
|
warn "Could not query maximum file descriptor limit"
|
||||||
esac
|
esac
|
||||||
@@ -153,7 +153,7 @@ if ! "$cygwin" && ! "$darwin" && ! "$nonstop" ; then
|
|||||||
'' | soft) :;; #(
|
'' | soft) :;; #(
|
||||||
*)
|
*)
|
||||||
# In POSIX sh, ulimit -n is undefined. That's why the result is checked to see if it worked.
|
# In POSIX sh, ulimit -n is undefined. That's why the result is checked to see if it worked.
|
||||||
# shellcheck disable=SC3045
|
# shellcheck disable=SC2039,SC3045
|
||||||
ulimit -n "$MAX_FD" ||
|
ulimit -n "$MAX_FD" ||
|
||||||
warn "Could not set maximum file descriptor limit to $MAX_FD"
|
warn "Could not set maximum file descriptor limit to $MAX_FD"
|
||||||
esac
|
esac
|
||||||
@@ -202,11 +202,11 @@ fi
|
|||||||
# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
|
# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
|
||||||
DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"'
|
DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"'
|
||||||
|
|
||||||
# Collect all arguments for the java command;
|
# Collect all arguments for the java command:
|
||||||
# * $DEFAULT_JVM_OPTS, $JAVA_OPTS, and $GRADLE_OPTS can contain fragments of
|
# * DEFAULT_JVM_OPTS, JAVA_OPTS, JAVA_OPTS, and optsEnvironmentVar are not allowed to contain shell fragments,
|
||||||
# shell script including quotes and variable substitutions, so put them in
|
# and any embedded shellness will be escaped.
|
||||||
# double quotes to make sure that they get re-expanded; and
|
# * For example: A user cannot expect ${Hostname} to be expanded, as it is an environment variable and will be
|
||||||
# * put everything else in single quotes, so that it's not re-expanded.
|
# treated as '${Hostname}' itself on the command line.
|
||||||
|
|
||||||
set -- \
|
set -- \
|
||||||
"-Dorg.gradle.appname=$APP_BASE_NAME" \
|
"-Dorg.gradle.appname=$APP_BASE_NAME" \
|
||||||
|
Binary file not shown.
@@ -1,7 +1,7 @@
|
|||||||
distributionBase=GRADLE_USER_HOME
|
distributionBase=GRADLE_USER_HOME
|
||||||
distributionPath=wrapper/dists
|
distributionPath=wrapper/dists
|
||||||
distributionSha256Sum=591855b517fc635b9e04de1d05d5e76ada3f89f5fc76f87978d1b245b4f69225
|
distributionSha256Sum=9d926787066a081739e8200858338b4a69e837c3a821a33aca9db09dd4a41026
|
||||||
distributionUrl=https\://services.gradle.org/distributions/gradle-8.3-bin.zip
|
distributionUrl=https\://services.gradle.org/distributions/gradle-8.5-bin.zip
|
||||||
networkTimeout=10000
|
networkTimeout=10000
|
||||||
validateDistributionUrl=true
|
validateDistributionUrl=true
|
||||||
zipStoreBase=GRADLE_USER_HOME
|
zipStoreBase=GRADLE_USER_HOME
|
||||||
|
14
.github/workflow-samples/groovy-dsl/gradlew
vendored
14
.github/workflow-samples/groovy-dsl/gradlew
vendored
@@ -145,7 +145,7 @@ if ! "$cygwin" && ! "$darwin" && ! "$nonstop" ; then
|
|||||||
case $MAX_FD in #(
|
case $MAX_FD in #(
|
||||||
max*)
|
max*)
|
||||||
# In POSIX sh, ulimit -H is undefined. That's why the result is checked to see if it worked.
|
# In POSIX sh, ulimit -H is undefined. That's why the result is checked to see if it worked.
|
||||||
# shellcheck disable=SC3045
|
# shellcheck disable=SC2039,SC3045
|
||||||
MAX_FD=$( ulimit -H -n ) ||
|
MAX_FD=$( ulimit -H -n ) ||
|
||||||
warn "Could not query maximum file descriptor limit"
|
warn "Could not query maximum file descriptor limit"
|
||||||
esac
|
esac
|
||||||
@@ -153,7 +153,7 @@ if ! "$cygwin" && ! "$darwin" && ! "$nonstop" ; then
|
|||||||
'' | soft) :;; #(
|
'' | soft) :;; #(
|
||||||
*)
|
*)
|
||||||
# In POSIX sh, ulimit -n is undefined. That's why the result is checked to see if it worked.
|
# In POSIX sh, ulimit -n is undefined. That's why the result is checked to see if it worked.
|
||||||
# shellcheck disable=SC3045
|
# shellcheck disable=SC2039,SC3045
|
||||||
ulimit -n "$MAX_FD" ||
|
ulimit -n "$MAX_FD" ||
|
||||||
warn "Could not set maximum file descriptor limit to $MAX_FD"
|
warn "Could not set maximum file descriptor limit to $MAX_FD"
|
||||||
esac
|
esac
|
||||||
@@ -202,11 +202,11 @@ fi
|
|||||||
# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
|
# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
|
||||||
DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"'
|
DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"'
|
||||||
|
|
||||||
# Collect all arguments for the java command;
|
# Collect all arguments for the java command:
|
||||||
# * $DEFAULT_JVM_OPTS, $JAVA_OPTS, and $GRADLE_OPTS can contain fragments of
|
# * DEFAULT_JVM_OPTS, JAVA_OPTS, JAVA_OPTS, and optsEnvironmentVar are not allowed to contain shell fragments,
|
||||||
# shell script including quotes and variable substitutions, so put them in
|
# and any embedded shellness will be escaped.
|
||||||
# double quotes to make sure that they get re-expanded; and
|
# * For example: A user cannot expect ${Hostname} to be expanded, as it is an environment variable and will be
|
||||||
# * put everything else in single quotes, so that it's not re-expanded.
|
# treated as '${Hostname}' itself on the command line.
|
||||||
|
|
||||||
set -- \
|
set -- \
|
||||||
"-Dorg.gradle.appname=$APP_BASE_NAME" \
|
"-Dorg.gradle.appname=$APP_BASE_NAME" \
|
||||||
|
@@ -1,6 +1,6 @@
|
|||||||
plugins {
|
plugins {
|
||||||
id "com.gradle.enterprise" version "3.14.1"
|
id "com.gradle.enterprise" version "3.15.1"
|
||||||
id "com.gradle.common-custom-user-data-gradle-plugin" version "1.11.1"
|
id "com.gradle.common-custom-user-data-gradle-plugin" version "1.12"
|
||||||
}
|
}
|
||||||
|
|
||||||
gradleEnterprise {
|
gradleEnterprise {
|
||||||
|
Binary file not shown.
@@ -1,7 +1,7 @@
|
|||||||
distributionBase=GRADLE_USER_HOME
|
distributionBase=GRADLE_USER_HOME
|
||||||
distributionPath=wrapper/dists
|
distributionPath=wrapper/dists
|
||||||
distributionSha256Sum=591855b517fc635b9e04de1d05d5e76ada3f89f5fc76f87978d1b245b4f69225
|
distributionSha256Sum=9d926787066a081739e8200858338b4a69e837c3a821a33aca9db09dd4a41026
|
||||||
distributionUrl=https\://services.gradle.org/distributions/gradle-8.3-bin.zip
|
distributionUrl=https\://services.gradle.org/distributions/gradle-8.5-bin.zip
|
||||||
networkTimeout=10000
|
networkTimeout=10000
|
||||||
validateDistributionUrl=true
|
validateDistributionUrl=true
|
||||||
zipStoreBase=GRADLE_USER_HOME
|
zipStoreBase=GRADLE_USER_HOME
|
||||||
|
14
.github/workflow-samples/java-toolchain/gradlew
vendored
14
.github/workflow-samples/java-toolchain/gradlew
vendored
@@ -145,7 +145,7 @@ if ! "$cygwin" && ! "$darwin" && ! "$nonstop" ; then
|
|||||||
case $MAX_FD in #(
|
case $MAX_FD in #(
|
||||||
max*)
|
max*)
|
||||||
# In POSIX sh, ulimit -H is undefined. That's why the result is checked to see if it worked.
|
# In POSIX sh, ulimit -H is undefined. That's why the result is checked to see if it worked.
|
||||||
# shellcheck disable=SC3045
|
# shellcheck disable=SC2039,SC3045
|
||||||
MAX_FD=$( ulimit -H -n ) ||
|
MAX_FD=$( ulimit -H -n ) ||
|
||||||
warn "Could not query maximum file descriptor limit"
|
warn "Could not query maximum file descriptor limit"
|
||||||
esac
|
esac
|
||||||
@@ -153,7 +153,7 @@ if ! "$cygwin" && ! "$darwin" && ! "$nonstop" ; then
|
|||||||
'' | soft) :;; #(
|
'' | soft) :;; #(
|
||||||
*)
|
*)
|
||||||
# In POSIX sh, ulimit -n is undefined. That's why the result is checked to see if it worked.
|
# In POSIX sh, ulimit -n is undefined. That's why the result is checked to see if it worked.
|
||||||
# shellcheck disable=SC3045
|
# shellcheck disable=SC2039,SC3045
|
||||||
ulimit -n "$MAX_FD" ||
|
ulimit -n "$MAX_FD" ||
|
||||||
warn "Could not set maximum file descriptor limit to $MAX_FD"
|
warn "Could not set maximum file descriptor limit to $MAX_FD"
|
||||||
esac
|
esac
|
||||||
@@ -202,11 +202,11 @@ fi
|
|||||||
# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
|
# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
|
||||||
DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"'
|
DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"'
|
||||||
|
|
||||||
# Collect all arguments for the java command;
|
# Collect all arguments for the java command:
|
||||||
# * $DEFAULT_JVM_OPTS, $JAVA_OPTS, and $GRADLE_OPTS can contain fragments of
|
# * DEFAULT_JVM_OPTS, JAVA_OPTS, JAVA_OPTS, and optsEnvironmentVar are not allowed to contain shell fragments,
|
||||||
# shell script including quotes and variable substitutions, so put them in
|
# and any embedded shellness will be escaped.
|
||||||
# double quotes to make sure that they get re-expanded; and
|
# * For example: A user cannot expect ${Hostname} to be expanded, as it is an environment variable and will be
|
||||||
# * put everything else in single quotes, so that it's not re-expanded.
|
# treated as '${Hostname}' itself on the command line.
|
||||||
|
|
||||||
set -- \
|
set -- \
|
||||||
"-Dorg.gradle.appname=$APP_BASE_NAME" \
|
"-Dorg.gradle.appname=$APP_BASE_NAME" \
|
||||||
|
@@ -8,9 +8,9 @@ repositories {
|
|||||||
|
|
||||||
dependencies {
|
dependencies {
|
||||||
api("org.apache.commons:commons-math3:3.6.1")
|
api("org.apache.commons:commons-math3:3.6.1")
|
||||||
implementation("com.google.guava:guava:32.1.2-jre")
|
implementation("com.google.guava:guava:32.1.3-jre")
|
||||||
|
|
||||||
testImplementation("org.junit.jupiter:junit-jupiter:5.10.0")
|
testImplementation("org.junit.jupiter:junit-jupiter:5.10.1")
|
||||||
}
|
}
|
||||||
|
|
||||||
tasks.test {
|
tasks.test {
|
||||||
|
Binary file not shown.
@@ -1,7 +1,7 @@
|
|||||||
distributionBase=GRADLE_USER_HOME
|
distributionBase=GRADLE_USER_HOME
|
||||||
distributionPath=wrapper/dists
|
distributionPath=wrapper/dists
|
||||||
distributionSha256Sum=591855b517fc635b9e04de1d05d5e76ada3f89f5fc76f87978d1b245b4f69225
|
distributionSha256Sum=9d926787066a081739e8200858338b4a69e837c3a821a33aca9db09dd4a41026
|
||||||
distributionUrl=https\://services.gradle.org/distributions/gradle-8.3-bin.zip
|
distributionUrl=https\://services.gradle.org/distributions/gradle-8.5-bin.zip
|
||||||
networkTimeout=10000
|
networkTimeout=10000
|
||||||
validateDistributionUrl=true
|
validateDistributionUrl=true
|
||||||
zipStoreBase=GRADLE_USER_HOME
|
zipStoreBase=GRADLE_USER_HOME
|
||||||
|
14
.github/workflow-samples/kotlin-dsl/gradlew
vendored
14
.github/workflow-samples/kotlin-dsl/gradlew
vendored
@@ -145,7 +145,7 @@ if ! "$cygwin" && ! "$darwin" && ! "$nonstop" ; then
|
|||||||
case $MAX_FD in #(
|
case $MAX_FD in #(
|
||||||
max*)
|
max*)
|
||||||
# In POSIX sh, ulimit -H is undefined. That's why the result is checked to see if it worked.
|
# In POSIX sh, ulimit -H is undefined. That's why the result is checked to see if it worked.
|
||||||
# shellcheck disable=SC3045
|
# shellcheck disable=SC2039,SC3045
|
||||||
MAX_FD=$( ulimit -H -n ) ||
|
MAX_FD=$( ulimit -H -n ) ||
|
||||||
warn "Could not query maximum file descriptor limit"
|
warn "Could not query maximum file descriptor limit"
|
||||||
esac
|
esac
|
||||||
@@ -153,7 +153,7 @@ if ! "$cygwin" && ! "$darwin" && ! "$nonstop" ; then
|
|||||||
'' | soft) :;; #(
|
'' | soft) :;; #(
|
||||||
*)
|
*)
|
||||||
# In POSIX sh, ulimit -n is undefined. That's why the result is checked to see if it worked.
|
# In POSIX sh, ulimit -n is undefined. That's why the result is checked to see if it worked.
|
||||||
# shellcheck disable=SC3045
|
# shellcheck disable=SC2039,SC3045
|
||||||
ulimit -n "$MAX_FD" ||
|
ulimit -n "$MAX_FD" ||
|
||||||
warn "Could not set maximum file descriptor limit to $MAX_FD"
|
warn "Could not set maximum file descriptor limit to $MAX_FD"
|
||||||
esac
|
esac
|
||||||
@@ -202,11 +202,11 @@ fi
|
|||||||
# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
|
# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
|
||||||
DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"'
|
DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"'
|
||||||
|
|
||||||
# Collect all arguments for the java command;
|
# Collect all arguments for the java command:
|
||||||
# * $DEFAULT_JVM_OPTS, $JAVA_OPTS, and $GRADLE_OPTS can contain fragments of
|
# * DEFAULT_JVM_OPTS, JAVA_OPTS, JAVA_OPTS, and optsEnvironmentVar are not allowed to contain shell fragments,
|
||||||
# shell script including quotes and variable substitutions, so put them in
|
# and any embedded shellness will be escaped.
|
||||||
# double quotes to make sure that they get re-expanded; and
|
# * For example: A user cannot expect ${Hostname} to be expanded, as it is an environment variable and will be
|
||||||
# * put everything else in single quotes, so that it's not re-expanded.
|
# treated as '${Hostname}' itself on the command line.
|
||||||
|
|
||||||
set -- \
|
set -- \
|
||||||
"-Dorg.gradle.appname=$APP_BASE_NAME" \
|
"-Dorg.gradle.appname=$APP_BASE_NAME" \
|
||||||
|
@@ -1,6 +1,6 @@
|
|||||||
plugins {
|
plugins {
|
||||||
id("com.gradle.enterprise") version "3.14.1"
|
id("com.gradle.enterprise") version "3.15.1"
|
||||||
id("com.gradle.common-custom-user-data-gradle-plugin") version "1.11.1"
|
id("com.gradle.common-custom-user-data-gradle-plugin") version "1.12"
|
||||||
}
|
}
|
||||||
|
|
||||||
gradleEnterprise {
|
gradleEnterprise {
|
||||||
|
@@ -1,5 +1,5 @@
|
|||||||
plugins {
|
plugins {
|
||||||
id "com.gradle.build-scan" version "3.14.1"
|
id "com.gradle.build-scan" version "3.15.1"
|
||||||
}
|
}
|
||||||
|
|
||||||
gradleEnterprise {
|
gradleEnterprise {
|
||||||
|
@@ -1,5 +1,5 @@
|
|||||||
plugins {
|
plugins {
|
||||||
id "com.gradle.enterprise" version "3.14.1"
|
id "com.gradle.enterprise" version "3.15.1"
|
||||||
}
|
}
|
||||||
|
|
||||||
gradleEnterprise {
|
gradleEnterprise {
|
||||||
|
2
.github/workflows/ci-codeql.yml
vendored
2
.github/workflows/ci-codeql.yml
vendored
@@ -38,7 +38,7 @@ jobs:
|
|||||||
|
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout repository
|
- name: Checkout repository
|
||||||
uses: actions/checkout@v3
|
uses: actions/checkout@v4
|
||||||
|
|
||||||
# Initializes the CodeQL tools for scanning.
|
# Initializes the CodeQL tools for scanning.
|
||||||
- name: Initialize CodeQL
|
- name: Initialize CodeQL
|
||||||
|
2
.github/workflows/ci-dependency-review.yml
vendored
2
.github/workflows/ci-dependency-review.yml
vendored
@@ -15,6 +15,6 @@ jobs:
|
|||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
- name: 'Checkout Repository'
|
- name: 'Checkout Repository'
|
||||||
uses: actions/checkout@v3
|
uses: actions/checkout@v4
|
||||||
- name: 'Dependency Review'
|
- name: 'Dependency Review'
|
||||||
uses: actions/dependency-review-action@v3
|
uses: actions/dependency-review-action@v3
|
||||||
|
1
.github/workflows/ci-full-check.yml
vendored
1
.github/workflows/ci-full-check.yml
vendored
@@ -9,6 +9,7 @@ on:
|
|||||||
push:
|
push:
|
||||||
branches:
|
branches:
|
||||||
- main
|
- main
|
||||||
|
- release/**
|
||||||
paths:
|
paths:
|
||||||
- '.github/**'
|
- '.github/**'
|
||||||
- 'dist/**'
|
- 'dist/**'
|
||||||
|
6
.github/workflows/ci-init-script-check.yml
vendored
6
.github/workflows/ci-init-script-check.yml
vendored
@@ -13,14 +13,14 @@ jobs:
|
|||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout sources
|
- name: Checkout sources
|
||||||
uses: actions/checkout@v3
|
uses: actions/checkout@v4
|
||||||
- name: Setup Java
|
- name: Setup Java
|
||||||
uses: actions/setup-java@v3
|
uses: actions/setup-java@v4
|
||||||
with:
|
with:
|
||||||
distribution: temurin
|
distribution: temurin
|
||||||
java-version: 8
|
java-version: 8
|
||||||
- name: Setup Gradle
|
- name: Setup Gradle
|
||||||
uses: gradle/gradle-build-action@v2.7.1 # Use a released version to avoid breakages
|
uses: gradle/gradle-build-action@v2.10.0 # Use a released version to avoid breakages
|
||||||
- name: Run integration tests
|
- name: Run integration tests
|
||||||
working-directory: test/init-scripts
|
working-directory: test/init-scripts
|
||||||
run: ./gradlew check
|
run: ./gradlew check
|
||||||
|
10
.github/workflows/ci-quick-check.yml
vendored
10
.github/workflows/ci-quick-check.yml
vendored
@@ -3,14 +3,16 @@ name: CI-quick-check
|
|||||||
on:
|
on:
|
||||||
workflow_dispatch:
|
workflow_dispatch:
|
||||||
push:
|
push:
|
||||||
branches-ignore: main
|
branches-ignore:
|
||||||
|
- main
|
||||||
|
- release/**
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
build-distribution:
|
build-distribution:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout sources
|
- name: Checkout sources
|
||||||
uses: actions/checkout@v3
|
uses: actions/checkout@v4
|
||||||
- name: Build and upload distribution
|
- name: Build and upload distribution
|
||||||
uses: ./.github/actions/build-dist
|
uses: ./.github/actions/build-dist
|
||||||
|
|
||||||
@@ -18,11 +20,11 @@ jobs:
|
|||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout sources
|
- name: Checkout sources
|
||||||
uses: actions/checkout@v3
|
uses: actions/checkout@v4
|
||||||
- name: Configure Gradle as default for unit test
|
- name: Configure Gradle as default for unit test
|
||||||
uses: ./
|
uses: ./
|
||||||
with:
|
with:
|
||||||
gradle-version: 8.3
|
gradle-version: 8.5
|
||||||
- name: Run tests
|
- name: Run tests
|
||||||
run: |
|
run: |
|
||||||
npm install
|
npm install
|
||||||
|
3
.github/workflows/ci-verify-outputs.yml
vendored
3
.github/workflows/ci-verify-outputs.yml
vendored
@@ -8,6 +8,7 @@ on:
|
|||||||
push:
|
push:
|
||||||
branches:
|
branches:
|
||||||
- main
|
- main
|
||||||
|
- release/**
|
||||||
- dependabot/**
|
- dependabot/**
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
@@ -15,7 +16,7 @@ jobs:
|
|||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout sources
|
- name: Checkout sources
|
||||||
uses: actions/checkout@v3
|
uses: actions/checkout@v4
|
||||||
- name: Build
|
- name: Build
|
||||||
run: |
|
run: |
|
||||||
npm -v
|
npm -v
|
||||||
|
6
.github/workflows/demo-failure-cases.yml
vendored
6
.github/workflows/demo-failure-cases.yml
vendored
@@ -9,7 +9,7 @@ jobs:
|
|||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout sources
|
- name: Checkout sources
|
||||||
uses: actions/checkout@v3
|
uses: actions/checkout@v4
|
||||||
- name: Test build failure
|
- name: Test build failure
|
||||||
uses: ./
|
uses: ./
|
||||||
continue-on-error: true
|
continue-on-error: true
|
||||||
@@ -21,7 +21,7 @@ jobs:
|
|||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout sources
|
- name: Checkout sources
|
||||||
uses: actions/checkout@v3
|
uses: actions/checkout@v4
|
||||||
- name: Test wrapper missing
|
- name: Test wrapper missing
|
||||||
uses: ./
|
uses: ./
|
||||||
continue-on-error: true
|
continue-on-error: true
|
||||||
@@ -33,7 +33,7 @@ jobs:
|
|||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout sources
|
- name: Checkout sources
|
||||||
uses: actions/checkout@v3
|
uses: actions/checkout@v4
|
||||||
- name: Test bad config value
|
- name: Test bad config value
|
||||||
uses: ./
|
uses: ./
|
||||||
continue-on-error: true
|
continue-on-error: true
|
||||||
|
4
.github/workflows/demo-job-summary.yml
vendored
4
.github/workflows/demo-job-summary.yml
vendored
@@ -12,7 +12,7 @@ jobs:
|
|||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout sources
|
- name: Checkout sources
|
||||||
uses: actions/checkout@v3
|
uses: actions/checkout@v4
|
||||||
- name: Build distribution
|
- name: Build distribution
|
||||||
shell: bash
|
shell: bash
|
||||||
run: |
|
run: |
|
||||||
@@ -46,7 +46,7 @@ jobs:
|
|||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout sources
|
- name: Checkout sources
|
||||||
uses: actions/checkout@v3
|
uses: actions/checkout@v4
|
||||||
- name: Build distribution
|
- name: Build distribution
|
||||||
shell: bash
|
shell: bash
|
||||||
run: |
|
run: |
|
||||||
|
@@ -7,7 +7,7 @@ jobs:
|
|||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout project sources
|
- name: Checkout project sources
|
||||||
uses: actions/checkout@v3
|
uses: actions/checkout@v4
|
||||||
- name: Setup Gradle
|
- name: Setup Gradle
|
||||||
uses: ./
|
uses: ./
|
||||||
- name: Run build with Gradle wrapper
|
- name: Run build with Gradle wrapper
|
||||||
@@ -15,7 +15,7 @@ jobs:
|
|||||||
working-directory: .github/workflow-samples/kotlin-dsl
|
working-directory: .github/workflow-samples/kotlin-dsl
|
||||||
run: ./gradlew build --scan
|
run: ./gradlew build --scan
|
||||||
- name: "Add Build Scan URL as PR comment"
|
- name: "Add Build Scan URL as PR comment"
|
||||||
uses: actions/github-script@v6
|
uses: actions/github-script@v7
|
||||||
with:
|
with:
|
||||||
github-token: ${{secrets.GITHUB_TOKEN}}
|
github-token: ${{secrets.GITHUB_TOKEN}}
|
||||||
script: |
|
script: |
|
||||||
|
@@ -25,7 +25,7 @@ jobs:
|
|||||||
runs-on: ${{ matrix.os }}
|
runs-on: ${{ matrix.os }}
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout sources
|
- name: Checkout sources
|
||||||
uses: actions/checkout@v3
|
uses: actions/checkout@v4
|
||||||
- name: Download distribution if required
|
- name: Download distribution if required
|
||||||
uses: ./.github/actions/download-dist
|
uses: ./.github/actions/download-dist
|
||||||
- name: Setup Gradle
|
- name: Setup Gradle
|
||||||
@@ -52,7 +52,7 @@ jobs:
|
|||||||
runs-on: ${{ matrix.os }}
|
runs-on: ${{ matrix.os }}
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout sources
|
- name: Checkout sources
|
||||||
uses: actions/checkout@v3
|
uses: actions/checkout@v4
|
||||||
- name: Download distribution if required
|
- name: Download distribution if required
|
||||||
uses: ./.github/actions/download-dist
|
uses: ./.github/actions/download-dist
|
||||||
- name: Setup Gradle
|
- name: Setup Gradle
|
||||||
@@ -77,7 +77,7 @@ jobs:
|
|||||||
runs-on: ${{ matrix.os }}
|
runs-on: ${{ matrix.os }}
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout sources
|
- name: Checkout sources
|
||||||
uses: actions/checkout@v3
|
uses: actions/checkout@v4
|
||||||
- name: Download distribution if required
|
- name: Download distribution if required
|
||||||
uses: ./.github/actions/download-dist
|
uses: ./.github/actions/download-dist
|
||||||
- name: Setup Gradle
|
- name: Setup Gradle
|
||||||
@@ -90,7 +90,7 @@ jobs:
|
|||||||
run: gradle help "-DgradleVersionCheck=${{matrix.gradle}}"
|
run: gradle help "-DgradleVersionCheck=${{matrix.gradle}}"
|
||||||
- name: Check Build Scan url is captured
|
- name: Check Build Scan url is captured
|
||||||
if: ${{ !steps.gradle.outputs.build-scan-url }}
|
if: ${{ !steps.gradle.outputs.build-scan-url }}
|
||||||
uses: actions/github-script@v6
|
uses: actions/github-script@v7
|
||||||
with:
|
with:
|
||||||
script: |
|
script: |
|
||||||
core.setFailed('No Build Scan detected')
|
core.setFailed('No Build Scan detected')
|
||||||
@@ -100,7 +100,7 @@ jobs:
|
|||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout sources
|
- name: Checkout sources
|
||||||
uses: actions/checkout@v3
|
uses: actions/checkout@v4
|
||||||
- name: Download distribution if required
|
- name: Download distribution if required
|
||||||
uses: ./.github/actions/download-dist
|
uses: ./.github/actions/download-dist
|
||||||
- name: Create dummy Gradle User Home
|
- name: Create dummy Gradle User Home
|
||||||
@@ -113,7 +113,7 @@ jobs:
|
|||||||
run: gradle help "-DgradleVersionCheck=${{matrix.gradle}}"
|
run: gradle help "-DgradleVersionCheck=${{matrix.gradle}}"
|
||||||
- name: Check Build Scan url is captured
|
- name: Check Build Scan url is captured
|
||||||
if: ${{ !steps.gradle.outputs.build-scan-url }}
|
if: ${{ !steps.gradle.outputs.build-scan-url }}
|
||||||
uses: actions/github-script@v6
|
uses: actions/github-script@v7
|
||||||
with:
|
with:
|
||||||
script: |
|
script: |
|
||||||
core.setFailed('No Build Scan detected')
|
core.setFailed('No Build Scan detected')
|
||||||
@@ -128,7 +128,7 @@ jobs:
|
|||||||
runs-on: ${{ matrix.os }}
|
runs-on: ${{ matrix.os }}
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout sources
|
- name: Checkout sources
|
||||||
uses: actions/checkout@v3
|
uses: actions/checkout@v4
|
||||||
- name: Download distribution if required
|
- name: Download distribution if required
|
||||||
uses: ./.github/actions/download-dist
|
uses: ./.github/actions/download-dist
|
||||||
- name: Setup Gradle
|
- name: Setup Gradle
|
||||||
@@ -149,7 +149,7 @@ jobs:
|
|||||||
runs-on: ${{ matrix.os }}
|
runs-on: ${{ matrix.os }}
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout sources
|
- name: Checkout sources
|
||||||
uses: actions/checkout@v3
|
uses: actions/checkout@v4
|
||||||
- name: Download distribution if required
|
- name: Download distribution if required
|
||||||
uses: ./.github/actions/download-dist
|
uses: ./.github/actions/download-dist
|
||||||
- name: Setup Gradle
|
- name: Setup Gradle
|
||||||
|
@@ -25,7 +25,7 @@ jobs:
|
|||||||
runs-on: ${{ matrix.os }}
|
runs-on: ${{ matrix.os }}
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout sources
|
- name: Checkout sources
|
||||||
uses: actions/checkout@v3
|
uses: actions/checkout@v4
|
||||||
- name: Download distribution if required
|
- name: Download distribution if required
|
||||||
uses: ./.github/actions/download-dist
|
uses: ./.github/actions/download-dist
|
||||||
- name: Invoke with multi-line arguments
|
- name: Invoke with multi-line arguments
|
||||||
|
@@ -25,7 +25,7 @@ jobs:
|
|||||||
runs-on: ${{ matrix.os }}
|
runs-on: ${{ matrix.os }}
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout sources
|
- name: Checkout sources
|
||||||
uses: actions/checkout@v3
|
uses: actions/checkout@v4
|
||||||
- name: Download distribution if required
|
- name: Download distribution if required
|
||||||
uses: ./.github/actions/download-dist
|
uses: ./.github/actions/download-dist
|
||||||
- name: Setup Gradle
|
- name: Setup Gradle
|
||||||
@@ -45,7 +45,7 @@ jobs:
|
|||||||
runs-on: ${{ matrix.os }}
|
runs-on: ${{ matrix.os }}
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout sources
|
- name: Checkout sources
|
||||||
uses: actions/checkout@v3
|
uses: actions/checkout@v4
|
||||||
- name: Download distribution if required
|
- name: Download distribution if required
|
||||||
uses: ./.github/actions/download-dist
|
uses: ./.github/actions/download-dist
|
||||||
- name: Setup Gradle
|
- name: Setup Gradle
|
||||||
@@ -65,7 +65,7 @@ jobs:
|
|||||||
runs-on: ${{ matrix.os }}
|
runs-on: ${{ matrix.os }}
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout sources
|
- name: Checkout sources
|
||||||
uses: actions/checkout@v3
|
uses: actions/checkout@v4
|
||||||
- name: Download distribution if required
|
- name: Download distribution if required
|
||||||
uses: ./.github/actions/download-dist
|
uses: ./.github/actions/download-dist
|
||||||
- name: Setup Gradle
|
- name: Setup Gradle
|
||||||
|
@@ -1,4 +1,4 @@
|
|||||||
name: Test execution with caching
|
name: Test dependency graph
|
||||||
|
|
||||||
on:
|
on:
|
||||||
workflow_call:
|
workflow_call:
|
||||||
@@ -25,7 +25,7 @@ jobs:
|
|||||||
runs-on: ${{ matrix.os }}
|
runs-on: ${{ matrix.os }}
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout sources
|
- name: Checkout sources
|
||||||
uses: actions/checkout@v3
|
uses: actions/checkout@v4
|
||||||
- name: Download distribution if required
|
- name: Download distribution if required
|
||||||
uses: ./.github/actions/download-dist
|
uses: ./.github/actions/download-dist
|
||||||
- name: Setup Gradle for dependency-graph generate
|
- name: Setup Gradle for dependency-graph generate
|
||||||
@@ -43,7 +43,7 @@ jobs:
|
|||||||
runs-on: ${{ matrix.os }}
|
runs-on: ${{ matrix.os }}
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout sources
|
- name: Checkout sources
|
||||||
uses: actions/checkout@v3
|
uses: actions/checkout@v4
|
||||||
- name: Download distribution if required
|
- name: Download distribution if required
|
||||||
uses: ./.github/actions/download-dist
|
uses: ./.github/actions/download-dist
|
||||||
- name: Setup Gradle for dependency-graph generate
|
- name: Setup Gradle for dependency-graph generate
|
||||||
@@ -59,7 +59,7 @@ jobs:
|
|||||||
runs-on: "ubuntu-latest"
|
runs-on: "ubuntu-latest"
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout sources
|
- name: Checkout sources
|
||||||
uses: actions/checkout@v3
|
uses: actions/checkout@v4
|
||||||
- name: Download distribution if required
|
- name: Download distribution if required
|
||||||
uses: ./.github/actions/download-dist
|
uses: ./.github/actions/download-dist
|
||||||
- name: Submit dependency graphs
|
- name: Submit dependency graphs
|
||||||
@@ -68,10 +68,13 @@ jobs:
|
|||||||
dependency-graph: download-and-submit
|
dependency-graph: download-and-submit
|
||||||
|
|
||||||
multiple-builds:
|
multiple-builds:
|
||||||
runs-on: "ubuntu-latest"
|
strategy:
|
||||||
|
matrix:
|
||||||
|
os: ${{fromJSON(inputs.runner-os)}}
|
||||||
|
runs-on: ${{ matrix.os }}
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout sources
|
- name: Checkout sources
|
||||||
uses: actions/checkout@v3
|
uses: actions/checkout@v4
|
||||||
- name: Download distribution if required
|
- name: Download distribution if required
|
||||||
uses: ./.github/actions/download-dist
|
uses: ./.github/actions/download-dist
|
||||||
- name: Setup Gradle for dependency-graph generate
|
- name: Setup Gradle for dependency-graph generate
|
||||||
@@ -85,12 +88,16 @@ jobs:
|
|||||||
run: ./gradlew build
|
run: ./gradlew build
|
||||||
working-directory: .github/workflow-samples/groovy-dsl
|
working-directory: .github/workflow-samples/groovy-dsl
|
||||||
- name: Check generated dependency graphs
|
- name: Check generated dependency graphs
|
||||||
|
shell: bash
|
||||||
run: |
|
run: |
|
||||||
echo "gradle-assemble report file: ${{ steps.gradle-assemble.outputs.dependency-graph-file }}"
|
echo "gradle-assemble report file: ${{ steps.gradle-assemble.outputs.dependency-graph-file }}"
|
||||||
echo "gradle-build report file: ${{ steps.gradle-build.outputs.dependency-graph-file }}"
|
echo "gradle-build report file: ${{ steps.gradle-build.outputs.dependency-graph-file }}"
|
||||||
ls -l dependency-graph-reports
|
ls -l dependency-graph-reports
|
||||||
if ([ ! -e ${{ steps.gradle-assemble.outputs.dependency-graph-file }} ] || [ ! -e ${{ steps.gradle-build.outputs.dependency-graph-file }} ])
|
if [ ! -e "${{ steps.gradle-assemble.outputs.dependency-graph-file }}" ]; then
|
||||||
then
|
echo "Did not find gradle-assemble dependency graph file"
|
||||||
echo "Did not find expected dependency graph files"
|
exit 1
|
||||||
|
fi
|
||||||
|
if [ ! -e "${{ steps.gradle-build.outputs.dependency-graph-file }}" ]; then
|
||||||
|
echo "Did not find gradle-build dependency graph files"
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
@@ -14,7 +14,7 @@ on:
|
|||||||
|
|
||||||
env:
|
env:
|
||||||
DOWNLOAD_DIST: ${{ inputs.download-dist }}
|
DOWNLOAD_DIST: ${{ inputs.download-dist }}
|
||||||
GRADLE_BUILD_ACTION_CACHE_KEY_PREFIX: restore-java-toolchain-${{ inputs.cache-key-prefix }}
|
GRADLE_BUILD_ACTION_CACHE_KEY_PREFIX: detect-java-toolchain-${{ inputs.cache-key-prefix }}
|
||||||
GRADLE_BUILD_ACTION_CACHE_DEBUG_ENABLED: true
|
GRADLE_BUILD_ACTION_CACHE_DEBUG_ENABLED: true
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
@@ -26,7 +26,7 @@ jobs:
|
|||||||
runs-on: ${{ matrix.os }}
|
runs-on: ${{ matrix.os }}
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout sources
|
- name: Checkout sources
|
||||||
uses: actions/checkout@v3
|
uses: actions/checkout@v4
|
||||||
- name: Download distribution if required
|
- name: Download distribution if required
|
||||||
uses: ./.github/actions/download-dist
|
uses: ./.github/actions/download-dist
|
||||||
- name: Setup Gradle
|
- name: Setup Gradle
|
||||||
@@ -53,16 +53,16 @@ jobs:
|
|||||||
runs-on: ${{ matrix.os }}
|
runs-on: ${{ matrix.os }}
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout sources
|
- name: Checkout sources
|
||||||
uses: actions/checkout@v3
|
uses: actions/checkout@v4
|
||||||
- name: Download distribution if required
|
- name: Download distribution if required
|
||||||
uses: ./.github/actions/download-dist
|
uses: ./.github/actions/download-dist
|
||||||
- name: Setup Java 20
|
- name: Setup Java 20
|
||||||
uses: actions/setup-java@v3
|
uses: actions/setup-java@v4
|
||||||
with:
|
with:
|
||||||
distribution: 'temurin'
|
distribution: 'temurin'
|
||||||
java-version: '20'
|
java-version: '20'
|
||||||
- name: Setup Java 16
|
- name: Setup Java 16
|
||||||
uses: actions/setup-java@v3
|
uses: actions/setup-java@v4
|
||||||
with:
|
with:
|
||||||
distribution: 'temurin'
|
distribution: 'temurin'
|
||||||
java-version: '16'
|
java-version: '16'
|
||||||
@@ -89,7 +89,7 @@ jobs:
|
|||||||
runs-on: ${{ matrix.os }}
|
runs-on: ${{ matrix.os }}
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout sources
|
- name: Checkout sources
|
||||||
uses: actions/checkout@v3
|
uses: actions/checkout@v4
|
||||||
- name: Download distribution if required
|
- name: Download distribution if required
|
||||||
uses: ./.github/actions/download-dist
|
uses: ./.github/actions/download-dist
|
||||||
- name: Configure java installations env var in Gradle User Home
|
- name: Configure java installations env var in Gradle User Home
|
||||||
|
@@ -25,7 +25,7 @@ jobs:
|
|||||||
runs-on: ${{ matrix.os }}
|
runs-on: ${{ matrix.os }}
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout sources
|
- name: Checkout sources
|
||||||
uses: actions/checkout@v3
|
uses: actions/checkout@v4
|
||||||
- name: Download distribution if required
|
- name: Download distribution if required
|
||||||
uses: ./.github/actions/download-dist
|
uses: ./.github/actions/download-dist
|
||||||
- name: Execute Gradle build
|
- name: Execute Gradle build
|
||||||
@@ -44,7 +44,7 @@ jobs:
|
|||||||
runs-on: ${{ matrix.os }}
|
runs-on: ${{ matrix.os }}
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout sources
|
- name: Checkout sources
|
||||||
uses: actions/checkout@v3
|
uses: actions/checkout@v4
|
||||||
- name: Download distribution if required
|
- name: Download distribution if required
|
||||||
uses: ./.github/actions/download-dist
|
uses: ./.github/actions/download-dist
|
||||||
- name: Execute Gradle build
|
- name: Execute Gradle build
|
||||||
|
8
.github/workflows/integ-test-execution.yml
vendored
8
.github/workflows/integ-test-execution.yml
vendored
@@ -30,7 +30,7 @@ jobs:
|
|||||||
runs-on: ${{ matrix.os }}
|
runs-on: ${{ matrix.os }}
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout sources
|
- name: Checkout sources
|
||||||
uses: actions/checkout@v3
|
uses: actions/checkout@v4
|
||||||
- name: Download distribution if required
|
- name: Download distribution if required
|
||||||
uses: ./.github/actions/download-dist
|
uses: ./.github/actions/download-dist
|
||||||
- name: Test use defined Gradle version
|
- name: Test use defined Gradle version
|
||||||
@@ -68,11 +68,11 @@ jobs:
|
|||||||
runs-on: ${{ matrix.os }}
|
runs-on: ${{ matrix.os }}
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout sources
|
- name: Checkout sources
|
||||||
uses: actions/checkout@v3
|
uses: actions/checkout@v4
|
||||||
- name: Download distribution if required
|
- name: Download distribution if required
|
||||||
uses: ./.github/actions/download-dist
|
uses: ./.github/actions/download-dist
|
||||||
- name: Setup Java
|
- name: Setup Java
|
||||||
uses: actions/setup-java@v3
|
uses: actions/setup-java@v4
|
||||||
with:
|
with:
|
||||||
distribution: temurin
|
distribution: temurin
|
||||||
java-version: 8
|
java-version: 8
|
||||||
@@ -86,7 +86,7 @@ jobs:
|
|||||||
arguments: help -DgradleVersionCheck=${{matrix.gradle}}
|
arguments: help -DgradleVersionCheck=${{matrix.gradle}}
|
||||||
- name: Check Build Scan url
|
- name: Check Build Scan url
|
||||||
if: ${{ !steps.gradle.outputs.build-scan-url }}
|
if: ${{ !steps.gradle.outputs.build-scan-url }}
|
||||||
uses: actions/github-script@v6
|
uses: actions/github-script@v7
|
||||||
with:
|
with:
|
||||||
script: |
|
script: |
|
||||||
core.setFailed('No Build Scan detected')
|
core.setFailed('No Build Scan detected')
|
||||||
|
@@ -21,8 +21,8 @@ env:
|
|||||||
GRADLE_BUILD_ACTION_CACHE_DEBUG_ENABLED: true
|
GRADLE_BUILD_ACTION_CACHE_DEBUG_ENABLED: true
|
||||||
GRADLE_ENTERPRISE_INJECTION_ENABLED: true
|
GRADLE_ENTERPRISE_INJECTION_ENABLED: true
|
||||||
GRADLE_ENTERPRISE_URL: https://ge.solutions-team.gradle.com
|
GRADLE_ENTERPRISE_URL: https://ge.solutions-team.gradle.com
|
||||||
GRADLE_ENTERPRISE_PLUGIN_VERSION: 3.14.1
|
GRADLE_ENTERPRISE_PLUGIN_VERSION: 3.15.1
|
||||||
GRADLE_ENTERPRISE_CCUD_PLUGIN_VERSION: 1.11.1
|
GRADLE_ENTERPRISE_CCUD_PLUGIN_VERSION: 1.12
|
||||||
GRADLE_ENTERPRISE_ACCESS_KEY: ${{ secrets.GRADLE_ENTERPRISE_ACCESS_KEY }}
|
GRADLE_ENTERPRISE_ACCESS_KEY: ${{ secrets.GRADLE_ENTERPRISE_ACCESS_KEY }}
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
@@ -34,11 +34,11 @@ jobs:
|
|||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout sources
|
- name: Checkout sources
|
||||||
uses: actions/checkout@v3
|
uses: actions/checkout@v4
|
||||||
- name: Download distribution if required
|
- name: Download distribution if required
|
||||||
uses: ./.github/actions/download-dist
|
uses: ./.github/actions/download-dist
|
||||||
- name: Setup Java
|
- name: Setup Java
|
||||||
uses: actions/setup-java@v3
|
uses: actions/setup-java@v4
|
||||||
with:
|
with:
|
||||||
distribution: temurin
|
distribution: temurin
|
||||||
java-version: 8
|
java-version: 8
|
||||||
@@ -54,7 +54,7 @@ jobs:
|
|||||||
run: gradle help
|
run: gradle help
|
||||||
- name: Check Build Scan url
|
- name: Check Build Scan url
|
||||||
if: ${{ !steps.gradle.outputs.build-scan-url }}
|
if: ${{ !steps.gradle.outputs.build-scan-url }}
|
||||||
uses: actions/github-script@v6
|
uses: actions/github-script@v7
|
||||||
with:
|
with:
|
||||||
script: |
|
script: |
|
||||||
core.setFailed('No Build Scan detected')
|
core.setFailed('No Build Scan detected')
|
||||||
|
@@ -30,7 +30,7 @@ jobs:
|
|||||||
runs-on: ${{ matrix.os }}
|
runs-on: ${{ matrix.os }}
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout sources
|
- name: Checkout sources
|
||||||
uses: actions/checkout@v3
|
uses: actions/checkout@v4
|
||||||
- name: Download distribution if required
|
- name: Download distribution if required
|
||||||
uses: ./.github/actions/download-dist
|
uses: ./.github/actions/download-dist
|
||||||
- name: Setup Gradle with v6.9
|
- name: Setup Gradle with v6.9
|
||||||
@@ -62,7 +62,7 @@ jobs:
|
|||||||
gradle-version: current
|
gradle-version: current
|
||||||
- name: Check current version output parameter
|
- name: Check current version output parameter
|
||||||
if: ${{ !startsWith(steps.gradle-current.outputs.gradle-version , '8.') }}
|
if: ${{ !startsWith(steps.gradle-current.outputs.gradle-version , '8.') }}
|
||||||
uses: actions/github-script@v6
|
uses: actions/github-script@v7
|
||||||
with:
|
with:
|
||||||
script: |
|
script: |
|
||||||
core.setFailed('Gradle version parameter not set correctly: value was "${{ steps.gradle-current.outputs.gradle-version }}"')
|
core.setFailed('Gradle version parameter not set correctly: value was "${{ steps.gradle-current.outputs.gradle-version }}"')
|
||||||
@@ -82,11 +82,11 @@ jobs:
|
|||||||
runs-on: ${{ matrix.os }}
|
runs-on: ${{ matrix.os }}
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout sources
|
- name: Checkout sources
|
||||||
uses: actions/checkout@v3
|
uses: actions/checkout@v4
|
||||||
- name: Download distribution if required
|
- name: Download distribution if required
|
||||||
uses: ./.github/actions/download-dist
|
uses: ./.github/actions/download-dist
|
||||||
- name: Setup Java
|
- name: Setup Java
|
||||||
uses: actions/setup-java@v3
|
uses: actions/setup-java@v4
|
||||||
with:
|
with:
|
||||||
distribution: temurin
|
distribution: temurin
|
||||||
java-version: 8
|
java-version: 8
|
||||||
@@ -98,7 +98,7 @@ jobs:
|
|||||||
gradle-version: ${{ matrix.gradle }}
|
gradle-version: ${{ matrix.gradle }}
|
||||||
- name: Check output parameter
|
- name: Check output parameter
|
||||||
if: ${{ steps.setup-gradle.outputs.gradle-version != matrix.gradle }}
|
if: ${{ steps.setup-gradle.outputs.gradle-version != matrix.gradle }}
|
||||||
uses: actions/github-script@v6
|
uses: actions/github-script@v7
|
||||||
with:
|
with:
|
||||||
script: |
|
script: |
|
||||||
core.setFailed('Gradle version parameter not set correctly: value was "${{ steps.setup-gradle.outputs.gradle-version }}"')
|
core.setFailed('Gradle version parameter not set correctly: value was "${{ steps.setup-gradle.outputs.gradle-version }}"')
|
||||||
@@ -108,7 +108,7 @@ jobs:
|
|||||||
run: gradle help "-DgradleVersionCheck=${{matrix.gradle}}"
|
run: gradle help "-DgradleVersionCheck=${{matrix.gradle}}"
|
||||||
- name: Check Build Scan url
|
- name: Check Build Scan url
|
||||||
if: ${{ !steps.gradle.outputs.build-scan-url }}
|
if: ${{ !steps.gradle.outputs.build-scan-url }}
|
||||||
uses: actions/github-script@v6
|
uses: actions/github-script@v7
|
||||||
with:
|
with:
|
||||||
script: |
|
script: |
|
||||||
core.setFailed('No Build Scan detected')
|
core.setFailed('No Build Scan detected')
|
||||||
|
@@ -27,7 +27,7 @@ jobs:
|
|||||||
runs-on: ${{ matrix.os }}
|
runs-on: ${{ matrix.os }}
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout sources
|
- name: Checkout sources
|
||||||
uses: actions/checkout@v3
|
uses: actions/checkout@v4
|
||||||
- name: Download distribution if required
|
- name: Download distribution if required
|
||||||
uses: ./.github/actions/download-dist
|
uses: ./.github/actions/download-dist
|
||||||
- name: Setup Gradle
|
- name: Setup Gradle
|
||||||
@@ -48,7 +48,7 @@ jobs:
|
|||||||
runs-on: ${{ matrix.os }}
|
runs-on: ${{ matrix.os }}
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout sources
|
- name: Checkout sources
|
||||||
uses: actions/checkout@v3
|
uses: actions/checkout@v4
|
||||||
- name: Download distribution if required
|
- name: Download distribution if required
|
||||||
uses: ./.github/actions/download-dist
|
uses: ./.github/actions/download-dist
|
||||||
- name: Setup Gradle
|
- name: Setup Gradle
|
||||||
@@ -60,7 +60,7 @@ jobs:
|
|||||||
working-directory: .github/workflow-samples/groovy-dsl
|
working-directory: .github/workflow-samples/groovy-dsl
|
||||||
run: ./gradlew test --configuration-cache
|
run: ./gradlew test --configuration-cache
|
||||||
- name: Check that configuration-cache was used
|
- name: Check that configuration-cache was used
|
||||||
uses: actions/github-script@v6
|
uses: actions/github-script@v7
|
||||||
with:
|
with:
|
||||||
script: |
|
script: |
|
||||||
const fs = require('fs')
|
const fs = require('fs')
|
||||||
@@ -79,7 +79,7 @@ jobs:
|
|||||||
runs-on: ${{ matrix.os }}
|
runs-on: ${{ matrix.os }}
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout sources
|
- name: Checkout sources
|
||||||
uses: actions/checkout@v3
|
uses: actions/checkout@v4
|
||||||
- name: Download distribution if required
|
- name: Download distribution if required
|
||||||
uses: ./.github/actions/download-dist
|
uses: ./.github/actions/download-dist
|
||||||
- name: Setup Gradle with no extracted cache entries restored
|
- name: Setup Gradle with no extracted cache entries restored
|
||||||
@@ -101,7 +101,7 @@ jobs:
|
|||||||
runs-on: ${{ matrix.os }}
|
runs-on: ${{ matrix.os }}
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout sources
|
- name: Checkout sources
|
||||||
uses: actions/checkout@v3
|
uses: actions/checkout@v4
|
||||||
- name: Download distribution if required
|
- name: Download distribution if required
|
||||||
uses: ./.github/actions/download-dist
|
uses: ./.github/actions/download-dist
|
||||||
- name: Setup Gradle
|
- name: Setup Gradle
|
||||||
@@ -122,7 +122,7 @@ jobs:
|
|||||||
runs-on: ${{ matrix.os }}
|
runs-on: ${{ matrix.os }}
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout sources
|
- name: Checkout sources
|
||||||
uses: actions/checkout@v3
|
uses: actions/checkout@v4
|
||||||
- name: Download distribution if required
|
- name: Download distribution if required
|
||||||
uses: ./.github/actions/download-dist
|
uses: ./.github/actions/download-dist
|
||||||
- name: Setup Gradle
|
- name: Setup Gradle
|
||||||
@@ -144,7 +144,7 @@ jobs:
|
|||||||
runs-on: ${{ matrix.os }}
|
runs-on: ${{ matrix.os }}
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout sources
|
- name: Checkout sources
|
||||||
uses: actions/checkout@v3
|
uses: actions/checkout@v4
|
||||||
- name: Download distribution if required
|
- name: Download distribution if required
|
||||||
uses: ./.github/actions/download-dist
|
uses: ./.github/actions/download-dist
|
||||||
- name: Setup Gradle
|
- name: Setup Gradle
|
||||||
@@ -156,7 +156,7 @@ jobs:
|
|||||||
working-directory: .github/workflow-samples/kotlin-dsl
|
working-directory: .github/workflow-samples/kotlin-dsl
|
||||||
run: ./gradlew test --configuration-cache
|
run: ./gradlew test --configuration-cache
|
||||||
- name: Check that configuration-cache was used
|
- name: Check that configuration-cache was used
|
||||||
uses: actions/github-script@v6
|
uses: actions/github-script@v7
|
||||||
with:
|
with:
|
||||||
script: |
|
script: |
|
||||||
const fs = require('fs')
|
const fs = require('fs')
|
||||||
|
@@ -20,11 +20,11 @@ jobs:
|
|||||||
container: fedora:latest
|
container: fedora:latest
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout sources
|
- name: Checkout sources
|
||||||
uses: actions/checkout@v3
|
uses: actions/checkout@v4
|
||||||
- name: Download distribution if required
|
- name: Download distribution if required
|
||||||
uses: ./.github/actions/download-dist
|
uses: ./.github/actions/download-dist
|
||||||
- name: Setup Java
|
- name: Setup Java
|
||||||
uses: actions/setup-java@v3
|
uses: actions/setup-java@v4
|
||||||
with:
|
with:
|
||||||
java-version: 11
|
java-version: 11
|
||||||
distribution: temurin
|
distribution: temurin
|
||||||
@@ -43,11 +43,11 @@ jobs:
|
|||||||
container: fedora:latest
|
container: fedora:latest
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout sources
|
- name: Checkout sources
|
||||||
uses: actions/checkout@v3
|
uses: actions/checkout@v4
|
||||||
- name: Download distribution if required
|
- name: Download distribution if required
|
||||||
uses: ./.github/actions/download-dist
|
uses: ./.github/actions/download-dist
|
||||||
- name: Setup Java
|
- name: Setup Java
|
||||||
uses: actions/setup-java@v3
|
uses: actions/setup-java@v4
|
||||||
with:
|
with:
|
||||||
java-version: 11
|
java-version: 11
|
||||||
distribution: temurin
|
distribution: temurin
|
||||||
|
@@ -23,7 +23,7 @@ jobs:
|
|||||||
mkdir -p $GITHUB_WORKSPACE/gradle-user-home
|
mkdir -p $GITHUB_WORKSPACE/gradle-user-home
|
||||||
echo "GRADLE_USER_HOME=$GITHUB_WORKSPACE/gradle-user-home" >> $GITHUB_ENV
|
echo "GRADLE_USER_HOME=$GITHUB_WORKSPACE/gradle-user-home" >> $GITHUB_ENV
|
||||||
- name: Checkout sources
|
- name: Checkout sources
|
||||||
uses: actions/checkout@v3
|
uses: actions/checkout@v4
|
||||||
- name: Download distribution if required
|
- name: Download distribution if required
|
||||||
uses: ./.github/actions/download-dist
|
uses: ./.github/actions/download-dist
|
||||||
- name: Setup Gradle
|
- name: Setup Gradle
|
||||||
@@ -44,7 +44,7 @@ jobs:
|
|||||||
mkdir -p $GITHUB_WORKSPACE/gradle-user-home
|
mkdir -p $GITHUB_WORKSPACE/gradle-user-home
|
||||||
echo "GRADLE_USER_HOME=$GITHUB_WORKSPACE/gradle-user-home" >> $GITHUB_ENV
|
echo "GRADLE_USER_HOME=$GITHUB_WORKSPACE/gradle-user-home" >> $GITHUB_ENV
|
||||||
- name: Checkout sources
|
- name: Checkout sources
|
||||||
uses: actions/checkout@v3
|
uses: actions/checkout@v4
|
||||||
- name: Download distribution if required
|
- name: Download distribution if required
|
||||||
uses: ./.github/actions/download-dist
|
uses: ./.github/actions/download-dist
|
||||||
- name: Setup Gradle
|
- name: Setup Gradle
|
||||||
@@ -65,7 +65,7 @@ jobs:
|
|||||||
mkdir -p $GITHUB_WORKSPACE/gradle-user-home
|
mkdir -p $GITHUB_WORKSPACE/gradle-user-home
|
||||||
echo "GRADLE_USER_HOME=$GITHUB_WORKSPACE/gradle-user-home" >> $GITHUB_ENV
|
echo "GRADLE_USER_HOME=$GITHUB_WORKSPACE/gradle-user-home" >> $GITHUB_ENV
|
||||||
- name: Checkout sources
|
- name: Checkout sources
|
||||||
uses: actions/checkout@v3
|
uses: actions/checkout@v4
|
||||||
- name: Download distribution if required
|
- name: Download distribution if required
|
||||||
uses: ./.github/actions/download-dist
|
uses: ./.github/actions/download-dist
|
||||||
- name: Setup Gradle
|
- name: Setup Gradle
|
||||||
|
@@ -26,7 +26,7 @@ jobs:
|
|||||||
runs-on: ${{ matrix.os }}
|
runs-on: ${{ matrix.os }}
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout sources
|
- name: Checkout sources
|
||||||
uses: actions/checkout@v3
|
uses: actions/checkout@v4
|
||||||
- name: Download distribution if required
|
- name: Download distribution if required
|
||||||
uses: ./.github/actions/download-dist
|
uses: ./.github/actions/download-dist
|
||||||
- name: Setup Gradle
|
- name: Setup Gradle
|
||||||
@@ -46,7 +46,7 @@ jobs:
|
|||||||
runs-on: ${{ matrix.os }}
|
runs-on: ${{ matrix.os }}
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout sources
|
- name: Checkout sources
|
||||||
uses: actions/checkout@v3
|
uses: actions/checkout@v4
|
||||||
- name: Download distribution if required
|
- name: Download distribution if required
|
||||||
uses: ./.github/actions/download-dist
|
uses: ./.github/actions/download-dist
|
||||||
- name: Setup Gradle
|
- name: Setup Gradle
|
||||||
@@ -66,7 +66,7 @@ jobs:
|
|||||||
runs-on: ${{ matrix.os }}
|
runs-on: ${{ matrix.os }}
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout sources
|
- name: Checkout sources
|
||||||
uses: actions/checkout@v3
|
uses: actions/checkout@v4
|
||||||
- name: Download distribution if required
|
- name: Download distribution if required
|
||||||
uses: ./.github/actions/download-dist
|
uses: ./.github/actions/download-dist
|
||||||
- name: Setup Gradle
|
- name: Setup Gradle
|
||||||
@@ -86,7 +86,7 @@ jobs:
|
|||||||
runs-on: ${{ matrix.os }}
|
runs-on: ${{ matrix.os }}
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout sources
|
- name: Checkout sources
|
||||||
uses: actions/checkout@v3
|
uses: actions/checkout@v4
|
||||||
- name: Download distribution if required
|
- name: Download distribution if required
|
||||||
uses: ./.github/actions/download-dist
|
uses: ./.github/actions/download-dist
|
||||||
- name: Setup Gradle with no extracted cache entries restored
|
- name: Setup Gradle with no extracted cache entries restored
|
||||||
@@ -108,7 +108,7 @@ jobs:
|
|||||||
runs-on: ${{ matrix.os }}
|
runs-on: ${{ matrix.os }}
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout sources
|
- name: Checkout sources
|
||||||
uses: actions/checkout@v3
|
uses: actions/checkout@v4
|
||||||
- name: Download distribution if required
|
- name: Download distribution if required
|
||||||
uses: ./.github/actions/download-dist
|
uses: ./.github/actions/download-dist
|
||||||
- name: Pre-create Gradle User Home
|
- name: Pre-create Gradle User Home
|
||||||
|
@@ -25,7 +25,7 @@ jobs:
|
|||||||
runs-on: ${{ matrix.os }}
|
runs-on: ${{ matrix.os }}
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout sources
|
- name: Checkout sources
|
||||||
uses: actions/checkout@v3
|
uses: actions/checkout@v4
|
||||||
- name: Download distribution if required
|
- name: Download distribution if required
|
||||||
uses: ./.github/actions/download-dist
|
uses: ./.github/actions/download-dist
|
||||||
- name: Setup Gradle
|
- name: Setup Gradle
|
||||||
@@ -45,7 +45,7 @@ jobs:
|
|||||||
runs-on: ${{ matrix.os }}
|
runs-on: ${{ matrix.os }}
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout sources
|
- name: Checkout sources
|
||||||
uses: actions/checkout@v3
|
uses: actions/checkout@v4
|
||||||
- name: Download distribution if required
|
- name: Download distribution if required
|
||||||
uses: ./.github/actions/download-dist
|
uses: ./.github/actions/download-dist
|
||||||
- name: Setup Gradle
|
- name: Setup Gradle
|
||||||
|
@@ -25,7 +25,7 @@ jobs:
|
|||||||
runs-on: ${{ matrix.os }}
|
runs-on: ${{ matrix.os }}
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout sources
|
- name: Checkout sources
|
||||||
uses: actions/checkout@v3
|
uses: actions/checkout@v4
|
||||||
- name: Download distribution if required
|
- name: Download distribution if required
|
||||||
uses: ./.github/actions/download-dist
|
uses: ./.github/actions/download-dist
|
||||||
- name: Setup Gradle
|
- name: Setup Gradle
|
||||||
@@ -44,7 +44,7 @@ jobs:
|
|||||||
runs-on: ${{ matrix.os }}
|
runs-on: ${{ matrix.os }}
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout sources
|
- name: Checkout sources
|
||||||
uses: actions/checkout@v3
|
uses: actions/checkout@v4
|
||||||
- name: Download distribution if required
|
- name: Download distribution if required
|
||||||
uses: ./.github/actions/download-dist
|
uses: ./.github/actions/download-dist
|
||||||
- name: Setup Gradle
|
- name: Setup Gradle
|
||||||
|
@@ -25,7 +25,7 @@ jobs:
|
|||||||
runs-on: ${{ matrix.os }}
|
runs-on: ${{ matrix.os }}
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout sources
|
- name: Checkout sources
|
||||||
uses: actions/checkout@v3
|
uses: actions/checkout@v4
|
||||||
- name: Download distribution if required
|
- name: Download distribution if required
|
||||||
uses: ./.github/actions/download-dist
|
uses: ./.github/actions/download-dist
|
||||||
- name: Setup Gradle
|
- name: Setup Gradle
|
||||||
@@ -44,7 +44,7 @@ jobs:
|
|||||||
runs-on: ${{ matrix.os }}
|
runs-on: ${{ matrix.os }}
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout sources
|
- name: Checkout sources
|
||||||
uses: actions/checkout@v3
|
uses: actions/checkout@v4
|
||||||
- name: Download distribution if required
|
- name: Download distribution if required
|
||||||
uses: ./.github/actions/download-dist
|
uses: ./.github/actions/download-dist
|
||||||
- name: Setup Gradle
|
- name: Setup Gradle
|
||||||
|
@@ -1,3 +1,3 @@
|
|||||||
# Configuration file for asdf version manager
|
# Configuration file for asdf version manager
|
||||||
nodejs 16.18.1
|
nodejs 16.18.1
|
||||||
gradle 8.3
|
gradle 8.5
|
||||||
|
217
README.md
217
README.md
@@ -8,20 +8,21 @@ It is possible to directly invoke Gradle in your workflow, and the `actions/setu
|
|||||||
|
|
||||||
However, the `gradle-build-action` offers a number of advantages over this approach:
|
However, the `gradle-build-action` offers a number of advantages over this approach:
|
||||||
|
|
||||||
- Easily [configure your workflow to use a specific version of Gradle](#use-a-specific-gradle-version) using the `gradle-version` parameter. Gradle distributions are automatically downloaded and cached.
|
- Easily [configure your workflow to use a specific version of Gradle](#choose-a-specific-gradle-version) using the `gradle-version` parameter. Gradle distributions are automatically downloaded and cached.
|
||||||
- More sophisticated and more efficient caching of Gradle User Home between invocations, compared to `setup-java` and most custom configurations using `actions/cache`. [More details below](#caching).
|
- More sophisticated and more efficient caching of Gradle User Home between invocations, compared to `setup-java` and most custom configurations using `actions/cache`. [More details below](#caching-build-state-between-jobs).
|
||||||
- Detailed reporting of cache usage and cache configuration options allow you to [optimize the use of the GitHub actions cache](#optimizing-cache-effectiveness).
|
- Detailed reporting of cache usage and cache configuration options allow you to [optimize the use of the GitHub actions cache](#optimizing-cache-effectiveness).
|
||||||
- [Generate and Submit a GitHub Dependency Graph](#github-dependency-graph-support) for your project, enabling Dependabot security alerts.
|
- [Generate and Submit a GitHub Dependency Graph](#github-dependency-graph-support) for your project, enabling Dependabot security alerts.
|
||||||
- [Automatic capture of Build Scan® links](#build-scans) from the build, making these easier to locate for workflow run.
|
- [Automatic capture of Build Scan® links](#build-reporting) from the build, making these easier to locate for workflow run.
|
||||||
|
|
||||||
The `gradle-build-action` is designed to provide these benefits with minimal configuration.
|
The `gradle-build-action` is designed to provide these benefits with minimal configuration.
|
||||||
These features work both when Gradle is executed via the `gradle-build-action` and for any Gradle execution in subsequent steps.
|
These features work both when Gradle is executed via the `gradle-build-action` and for any Gradle execution in subsequent steps.
|
||||||
|
|
||||||
## Use the action to setup Gradle
|
## Use the action to setup Gradle
|
||||||
|
|
||||||
The recommended way to use the `gradle-build-action` is in an initial "Setup Gradle" step, with subsquent steps invoking Gradle directly with a `run` step. This makes the action minimally invasive, and allows a workflow to configure and execute a Gradle execution in any way.
|
The recommended way to use the `gradle-build-action` is in an initial "Setup Gradle" step, with subsequent steps invoking Gradle directly with a `run` step. This makes the action minimally invasive, and allows a workflow to configure and execute a Gradle execution in any way.
|
||||||
|
|
||||||
Most of the functionality of the `gradle-build-action` is applied via Gradle init-scripts, and so will apply to all subsequent Gradle executions on the runner, no matter how Gradle is invoked. This means that if you have an existing workflow that executes Gradle with a `run` step, you can add an initial "Setup Gradle" Step to benefit from caching, build-scan capture and other features of the gradle-build-action.
|
The `gradle-build-action` works by configuring environment variables and by adding a set of Gradle init-scripts to the Gradle User Home. These will apply to all Gradle executions on the runner, no matter how Gradle is invoked.
|
||||||
|
This means that if you have an existing workflow that executes Gradle with a `run` step, you can add an initial "Setup Gradle" Step to benefit from caching, build-scan capture and other features of the gradle-build-action.
|
||||||
|
|
||||||
|
|
||||||
```yaml
|
```yaml
|
||||||
@@ -34,7 +35,7 @@ jobs:
|
|||||||
os: [ubuntu-latest, macos-latest, windows-latest]
|
os: [ubuntu-latest, macos-latest, windows-latest]
|
||||||
runs-on: ${{ matrix.os }}
|
runs-on: ${{ matrix.os }}
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v3
|
- uses: actions/checkout@v4
|
||||||
- uses: actions/setup-java@v3
|
- uses: actions/setup-java@v3
|
||||||
with:
|
with:
|
||||||
distribution: temurin
|
distribution: temurin
|
||||||
@@ -83,7 +84,7 @@ jobs:
|
|||||||
gradle-rc:
|
gradle-rc:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v3
|
- uses: actions/checkout@v4
|
||||||
- uses: actions/setup-java@v3
|
- uses: actions/setup-java@v3
|
||||||
with:
|
with:
|
||||||
distribution: temurin
|
distribution: temurin
|
||||||
@@ -173,7 +174,7 @@ Using either of these mechanisms may interfere with the caching provided by this
|
|||||||
### Cache debugging and analysis
|
### Cache debugging and analysis
|
||||||
|
|
||||||
A report of all cache entries restored and saved is printed to the Job Summary when saving the cache entries.
|
A report of all cache entries restored and saved is printed to the Job Summary when saving the cache entries.
|
||||||
This report can provide valuable insignt into how much cache space is being used.
|
This report can provide valuable insight into how much cache space is being used.
|
||||||
|
|
||||||
It is possible to enable additional debug logging for cache operations. You do via the `GRADLE_BUILD_ACTION_CACHE_DEBUG_ENABLED` environment variable:
|
It is possible to enable additional debug logging for cache operations. You do via the `GRADLE_BUILD_ACTION_CACHE_DEBUG_ENABLED` environment variable:
|
||||||
|
|
||||||
@@ -212,7 +213,7 @@ In certain cases a particular section of Gradle User Home will be too large to m
|
|||||||
### Cache keys
|
### Cache keys
|
||||||
|
|
||||||
The actual content of the Gradle User Home after a build is the result of many factors, including:
|
The actual content of the Gradle User Home after a build is the result of many factors, including:
|
||||||
- Core Gradle build files (`settngs.gradle[.kts]`, `build.gradle[.kts]`, `gradle.properties`)
|
- Core Gradle build files (`settings.gradle[.kts]`, `build.gradle[.kts]`, `gradle.properties`)
|
||||||
- Associated Gradle configuration files (`gradle-wrapper.properties`, `dependencies.toml`, etc)
|
- Associated Gradle configuration files (`gradle-wrapper.properties`, `dependencies.toml`, etc)
|
||||||
- The entire content of `buildSrc` or any included builds that provide plugins.
|
- The entire content of `buildSrc` or any included builds that provide plugins.
|
||||||
- The entire content of the repository, in the case of the local build cache.
|
- The entire content of the repository, in the case of the local build cache.
|
||||||
@@ -299,7 +300,7 @@ without writing private cache entries that could lead to evicting shared entries
|
|||||||
|
|
||||||
If you have other long-lived development branches that would benefit from writing to the cache,
|
If you have other long-lived development branches that would benefit from writing to the cache,
|
||||||
you can configure these by overriding the `cache-read-only` action parameter.
|
you can configure these by overriding the `cache-read-only` action parameter.
|
||||||
See [Using the caches read-only](#using-the-caches-read-only) for more details.
|
See [Using the cache read-only](#using-the-cache-read-only) for more details.
|
||||||
|
|
||||||
Similarly, you could use `cache-read-only` for certain jobs in the workflow, and instead have these jobs reuse the cache content from upstream jobs.
|
Similarly, you could use `cache-read-only` for certain jobs in the workflow, and instead have these jobs reuse the cache content from upstream jobs.
|
||||||
|
|
||||||
@@ -375,7 +376,7 @@ jobs:
|
|||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout project sources
|
- name: Checkout project sources
|
||||||
uses: actions/checkout@v3
|
uses: actions/checkout@v4
|
||||||
- name: Setup Gradle
|
- name: Setup Gradle
|
||||||
uses: gradle/gradle-build-action@v2
|
uses: gradle/gradle-build-action@v2
|
||||||
- name: Run build with Gradle wrapper
|
- name: Run build with Gradle wrapper
|
||||||
@@ -409,13 +410,14 @@ jobs:
|
|||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout project sources
|
- name: Checkout project sources
|
||||||
uses: actions/checkout@v3
|
uses: actions/checkout@v4
|
||||||
- name: Setup Gradle
|
- name: Setup Gradle
|
||||||
uses: gradle/gradle-build-action@v2
|
uses: gradle/gradle-build-action@v2
|
||||||
- name: Run build with Gradle wrapper
|
- name: Run build with Gradle wrapper
|
||||||
run: ./gradlew build --scan
|
run: ./gradlew build --scan
|
||||||
- name: Upload build reports
|
- name: Upload build reports
|
||||||
uses: actions/upload-artifact@v3
|
uses: actions/upload-artifact@v3
|
||||||
|
if: always()
|
||||||
with:
|
with:
|
||||||
name: build-reports
|
name: build-reports
|
||||||
path: build/reports/
|
path: build/reports/
|
||||||
@@ -437,7 +439,7 @@ jobs:
|
|||||||
os: [ubuntu-latest, macos-latest, windows-latest]
|
os: [ubuntu-latest, macos-latest, windows-latest]
|
||||||
runs-on: ${{ matrix.os }}
|
runs-on: ${{ matrix.os }}
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v3
|
- uses: actions/checkout@v4
|
||||||
- uses: actions/setup-java@v3
|
- uses: actions/setup-java@v3
|
||||||
with:
|
with:
|
||||||
distribution: temurin
|
distribution: temurin
|
||||||
@@ -532,7 +534,7 @@ The `gradle-build-action` has support for submitting a [GitHub Dependency Graph]
|
|||||||
|
|
||||||
The dependency graph snapshot is generated via integration with the [GitHub Dependency Graph Gradle Plugin](https://plugins.gradle.org/plugin/org.gradle.github-dependency-graph-gradle-plugin), and saved as a workflow artifact. The generated snapshot files can be submitted either in the same job, or in a subsequent job (in the same or a dependent workflow).
|
The dependency graph snapshot is generated via integration with the [GitHub Dependency Graph Gradle Plugin](https://plugins.gradle.org/plugin/org.gradle.github-dependency-graph-gradle-plugin), and saved as a workflow artifact. The generated snapshot files can be submitted either in the same job, or in a subsequent job (in the same or a dependent workflow).
|
||||||
|
|
||||||
The generated dependency graph snapshot reports all of the dependencies that were resolved during a bulid execution, and is used by GitHub to generate [Dependabot Alerts](https://docs.github.com/en/code-security/dependabot/dependabot-alerts/about-dependabot-alerts) for vulnerable dependencies, as well as to populate the [Dependency Graph insights view](https://docs.github.com/en/code-security/supply-chain-security/understanding-your-software-supply-chain/exploring-the-dependencies-of-a-repository#viewing-the-dependency-graph).
|
The generated dependency graph snapshot reports all of the dependencies that were resolved during a build execution, and is used by GitHub to generate [Dependabot Alerts](https://docs.github.com/en/code-security/dependabot/dependabot-alerts/about-dependabot-alerts) for vulnerable dependencies, as well as to populate the [Dependency Graph insights view](https://docs.github.com/en/code-security/supply-chain-security/understanding-your-software-supply-chain/exploring-the-dependencies-of-a-repository#viewing-the-dependency-graph).
|
||||||
|
|
||||||
## Enable Dependency Graph generation for a workflow
|
## Enable Dependency Graph generation for a workflow
|
||||||
|
|
||||||
@@ -545,11 +547,9 @@ You enable GitHub Dependency Graph support by setting the `dependency-graph` act
|
|||||||
| `generate-and-submit` | As per `generate`, but any generated dependency graph snapshots will be submitted at the end of the job. |
|
| `generate-and-submit` | As per `generate`, but any generated dependency graph snapshots will be submitted at the end of the job. |
|
||||||
| `download-and-submit` | Download any previously saved dependency graph snapshots, submitting them via the Dependency Submission API. This can be useful to collect all snapshots in a matrix of builds and submit them in one step. |
|
| `download-and-submit` | Download any previously saved dependency graph snapshots, submitting them via the Dependency Submission API. This can be useful to collect all snapshots in a matrix of builds and submit them in one step. |
|
||||||
|
|
||||||
Dependency Graph _submission_ (but not generation) requires the `contents: write` permission, which may need to be explicitly enabled in the workflow file.
|
Example of a CI workflow that generates and submits a dependency graph:
|
||||||
|
|
||||||
Example of a simple workflow that generates and submits a dependency graph:
|
|
||||||
```yaml
|
```yaml
|
||||||
name: Submit dependency graph
|
name: CI build
|
||||||
on:
|
on:
|
||||||
push:
|
push:
|
||||||
|
|
||||||
@@ -560,19 +560,89 @@ jobs:
|
|||||||
build:
|
build:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v3
|
- uses: actions/checkout@v4
|
||||||
- name: Setup Gradle to generate and submit dependency graphs
|
- name: Setup Gradle to generate and submit dependency graphs
|
||||||
uses: gradle/gradle-build-action@v2
|
uses: gradle/gradle-build-action@v2
|
||||||
with:
|
with:
|
||||||
dependency-graph: generate-and-submit
|
dependency-graph: generate-and-submit
|
||||||
- name: Run a build, generating the dependency graph snapshot which will be submitted
|
- name: Run the usual CI build (dependency-graph will be generated and submitted post-job)
|
||||||
run: ./gradlew build
|
run: ./gradlew build
|
||||||
```
|
```
|
||||||
|
|
||||||
The `contents: write` permission is not required to generate the dependency graph, but is required in order to submit the graph via the GitHub API.
|
The `contents: write` permission is required in order to submit (but not generate) the dependency graph file.
|
||||||
|
Depending on [repository settings](https://docs.github.com/en/actions/security-guides/automatic-token-authentication#permissions-for-the-github_token), this permission may be available by default or may need to be explicitly enabled in the workflow file (as above).
|
||||||
|
|
||||||
The above configuration will work for workflows that run as a result of commits to a repository branch, but not when a workflow is triggered by a PR from a repository fork.
|
> [!IMPORTANT]
|
||||||
For a configuration that supports this setup, see [Dependency Graphs for pull request workflows](#dependency-graphs-for-pull-request-workflows).
|
> The above configuration will work for workflows that run as a result of commits to a repository branch,
|
||||||
|
> but not when a workflow is triggered by a PR from a repository fork.
|
||||||
|
> This is because the `contents: write` permission is not available when executing a workflow
|
||||||
|
> for a PR submitted from a forked repository.
|
||||||
|
> For a configuration that supports this setup, see [Dependency Graphs for pull request workflows](#dependency-graphs-for-pull-request-workflows).
|
||||||
|
|
||||||
|
### Using a custom plugin repository
|
||||||
|
|
||||||
|
By default, the action downloads the `github-dependency-graph-gradle-plugin` from the Gradle Plugin Portal (https://plugins.gradle.org). If your GitHub Actions environment does not have access to this URL, you can specify a custom plugin repository to use.
|
||||||
|
Do so by setting the `GRADLE_PLUGIN_REPOSITORY_URL` environment variable with your Gradle invocation.
|
||||||
|
|
||||||
|
```yaml
|
||||||
|
jobs:
|
||||||
|
build:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@v4
|
||||||
|
- name: Setup Gradle to generate and submit dependency graphs
|
||||||
|
uses: gradle/gradle-build-action@v2
|
||||||
|
with:
|
||||||
|
dependency-graph: generate-and-submit
|
||||||
|
- name: Run a build, resolving the 'dependency-graph' plugin from the plugin portal proxy
|
||||||
|
run: ./gradlew build
|
||||||
|
env:
|
||||||
|
GRADLE_PLUGIN_REPOSITORY_URL: "https://gradle-plugins-proxy.mycorp.com"
|
||||||
|
```
|
||||||
|
|
||||||
|
### Integrating the `dependency-review-action`
|
||||||
|
|
||||||
|
The GitHub [dependency-review-action](https://github.com/actions/dependency-review-action) helps you
|
||||||
|
understand dependency changes (and the security impact of these changes) for a pull request.
|
||||||
|
For the `dependency-review-action` to succeed, it must run _after_ the dependency graph has been submitted for a PR.
|
||||||
|
|
||||||
|
When using `generate-and-submit`, dependency graph files are submitted at the end of the job, after all steps have been
|
||||||
|
executed. For this reason, the `dependency-review-action` must be executed in a dependent job,
|
||||||
|
and not as a subsequent step in the job that generates the dependency graph.
|
||||||
|
|
||||||
|
Example of a pull request workflow that executes a build for a pull request and runs the `dependency-review-action`:
|
||||||
|
|
||||||
|
```yaml
|
||||||
|
name: PR check
|
||||||
|
|
||||||
|
on:
|
||||||
|
pull_request:
|
||||||
|
|
||||||
|
permissions:
|
||||||
|
contents: write
|
||||||
|
# Note that this permission will not be available if the PR is from a forked repository
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
build:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@v4
|
||||||
|
- name: Setup Gradle to generate and submit dependency graphs
|
||||||
|
uses: gradle/gradle-build-action@v2
|
||||||
|
with:
|
||||||
|
dependency-graph: generate-and-submit
|
||||||
|
- name: Run a build and generate the dependency graph which will be submitted post-job
|
||||||
|
run: ./gradlew build
|
||||||
|
|
||||||
|
dependency-review:
|
||||||
|
needs: build
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
- name: Perform dependency review
|
||||||
|
uses: actions/dependency-review-action@v3
|
||||||
|
```
|
||||||
|
|
||||||
|
See [Dependency Graphs for pull request workflows](#dependency-graphs-for-pull-request-workflows) for a more complex
|
||||||
|
(and less functional) example that will work for pull requests submitted from forked repositories.
|
||||||
|
|
||||||
## Limiting the scope of the dependency graph
|
## Limiting the scope of the dependency graph
|
||||||
|
|
||||||
@@ -582,7 +652,7 @@ For example, a vulnerability in the tool you use to generate documentation is un
|
|||||||
There are a number of techniques you can employ to limit the scope of the generated dependency graph:
|
There are a number of techniques you can employ to limit the scope of the generated dependency graph:
|
||||||
- [Don't generate a dependency graph for all Gradle executions](#choosing-which-gradle-invocations-will-generate-a-dependency-graph)
|
- [Don't generate a dependency graph for all Gradle executions](#choosing-which-gradle-invocations-will-generate-a-dependency-graph)
|
||||||
- [For a Gradle execution, filter which Gradle projects and configurations will contribute dependencies](#filtering-which-gradle-configurations-contribute-to-the-dependency-graph)
|
- [For a Gradle execution, filter which Gradle projects and configurations will contribute dependencies](#filtering-which-gradle-configurations-contribute-to-the-dependency-graph)
|
||||||
- [Use a separate workflow that only resolves the required dependencies]()
|
- [Use a separate workflow that only resolves the required dependencies](#use-a-dedicated-workflow-for-dependency-graph-generation)
|
||||||
|
|
||||||
> [!NOTE]
|
> [!NOTE]
|
||||||
> Ideally, all dependencies involved in building and testing a project will be extracted and reported in a dependency graph.
|
> Ideally, all dependencies involved in building and testing a project will be extracted and reported in a dependency graph.
|
||||||
@@ -599,7 +669,7 @@ jobs:
|
|||||||
build:
|
build:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v3
|
- uses: actions/checkout@v4
|
||||||
- name: Setup Gradle to generate and submit dependency graphs
|
- name: Setup Gradle to generate and submit dependency graphs
|
||||||
uses: gradle/gradle-build-action@v2
|
uses: gradle/gradle-build-action@v2
|
||||||
with:
|
with:
|
||||||
@@ -631,12 +701,12 @@ jobs:
|
|||||||
build:
|
build:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v3
|
- uses: actions/checkout@v4
|
||||||
- name: Setup Gradle to generate and submit dependency graphs
|
- name: Setup Gradle to generate and submit dependency graphs
|
||||||
uses: gradle/gradle-build-action@v2
|
uses: gradle/gradle-build-action@v2
|
||||||
with:
|
with:
|
||||||
dependency-graph: generate-and-submit
|
dependency-graph: generate-and-submit
|
||||||
- name: Run a build, generating the dependency graph from 'runtimeClasspath' configurations
|
- name: Run a build, generating the dependency graph from any resolved 'runtimeClasspath' configurations
|
||||||
run: ./gradlew build
|
run: ./gradlew build
|
||||||
env:
|
env:
|
||||||
DEPENDENCY_GRAPH_INCLUDE_PROJECTS: "^:(?!buildSrc).*"
|
DEPENDENCY_GRAPH_INCLUDE_PROJECTS: "^:(?!buildSrc).*"
|
||||||
@@ -645,26 +715,27 @@ jobs:
|
|||||||
|
|
||||||
### Use a dedicated workflow for dependency graph generation
|
### Use a dedicated workflow for dependency graph generation
|
||||||
|
|
||||||
Instead of generating a dependency graph from your existing CI workflow, it's possible to create a separate dedicated workflow (or Job) that is solely intended for generating a dependency graph.
|
Instead of generating a dependency graph from your existing CI workflow, it's possible to create a separate dedicated workflow (or Job) that is intended for generating a dependency graph.
|
||||||
Such a workflow will still need to execute Gradle, but can do so in a way that is targeted at resolving exactly the dependencies required.
|
Such a workflow will still need to execute Gradle, but can do so in a way that is targeted at resolving the specific dependencies required.
|
||||||
|
|
||||||
For example, the following workflow will report only those dependencies that are part of the `runtimeClasspath` or the `my-app` project.
|
For example, the following workflow will report those dependencies that are resolved in order to build the `distributionZip` for the `my-app` project. Test dependencies and other dependencies not required by the `distributionZip` will not be included.
|
||||||
|
|
||||||
```yaml
|
```yaml
|
||||||
jobs:
|
jobs:
|
||||||
build:
|
build:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v3
|
- uses: actions/checkout@v4
|
||||||
- name: Setup Gradle to generate and submit dependency graphs
|
- name: Setup Gradle to generate and submit dependency graphs
|
||||||
uses: gradle/gradle-build-action@v2
|
uses: gradle/gradle-build-action@v2
|
||||||
with:
|
with:
|
||||||
dependency-graph: generate-and-submit
|
dependency-graph: generate-and-submit
|
||||||
- name: Extract the 'runtimeClasspath' dependencies for 'my-app'
|
- name: Build the distribution Zip for `my-app`
|
||||||
run: ./gradlew :my-app:dependencies --configuration runtimeClasspath
|
run: ./gradlew :my-app:distributionZip
|
||||||
```
|
```
|
||||||
|
|
||||||
Note that the above example will also include `buildSrc` dependencies, since these are resolved as part of running the `dependencies` task.
|
Note that the above example will also include any `buildSrc` dependencies, dependencies resolved when configuring your Gradle build or dependencies resolved while applying plugin. All of these dependencies are resolved in the process of running the `distributionZip` task, and thus will form part of the generated dependency graph.
|
||||||
|
|
||||||
If this isn't desirable, you will still need to use the filtering mechanism described above.
|
If this isn't desirable, you will still need to use the filtering mechanism described above.
|
||||||
|
|
||||||
## Dependency Graphs for pull request workflows
|
## Dependency Graphs for pull request workflows
|
||||||
@@ -681,11 +752,14 @@ Note: when `download-and-submit` is used in a workflow triggered via [workflow_r
|
|||||||
```yaml
|
```yaml
|
||||||
name: run-build-and-generate-dependency-snapshot
|
name: run-build-and-generate-dependency-snapshot
|
||||||
|
|
||||||
|
on:
|
||||||
|
pull_request:
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
build:
|
build:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v3
|
- uses: actions/checkout@v4
|
||||||
- name: Setup Gradle to generate and submit dependency graphs
|
- name: Setup Gradle to generate and submit dependency graphs
|
||||||
uses: gradle/gradle-build-action@v2
|
uses: gradle/gradle-build-action@v2
|
||||||
with:
|
with:
|
||||||
@@ -704,15 +778,48 @@ on:
|
|||||||
types: [completed]
|
types: [completed]
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
submit-snapshots:
|
submit-dependency-graph:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
- name: Retrieve dependency graph artifact and submit
|
- name: Retrieve dependency graph artifact and submit
|
||||||
uses: gradle/gradle-build-action@v2
|
uses: gradle/gradle-build-action@v2
|
||||||
with:
|
with:
|
||||||
dependency-graph: download-and-submit
|
dependency-graph: download-and-submit
|
||||||
```
|
```
|
||||||
|
|
||||||
|
### Integrating `dependency-review-action` for pull request workflows
|
||||||
|
|
||||||
|
The GitHub [dependency-review-action](https://github.com/actions/dependency-review-action) helps you
|
||||||
|
understand dependency changes (and the security impact of these changes) for a pull request.
|
||||||
|
|
||||||
|
To integrate the `dependency-review-action` into the pull request workflows above, a separate workflow should be added.
|
||||||
|
This workflow will be triggered directly on `pull_request`, but will need to wait until the dependency graph results are
|
||||||
|
submitted before the dependency review can complete. How long to wait is controlled by the `retry-on-snapshot-warnings` input parameters.
|
||||||
|
|
||||||
|
Here's an example of a separate "Dependency Review" workflow that will wait for 10 minutes for the PR check workflow to complete.
|
||||||
|
|
||||||
|
```yaml
|
||||||
|
name: dependency-review
|
||||||
|
on:
|
||||||
|
pull_request:
|
||||||
|
|
||||||
|
permissions:
|
||||||
|
contents: read
|
||||||
|
pull-requests: write
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
dependency-review:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
steps:
|
||||||
|
- name: 'Dependency Review'
|
||||||
|
uses: actions/dependency-review-action@v3
|
||||||
|
with:
|
||||||
|
retry-on-snapshot-warnings: true
|
||||||
|
retry-on-snapshot-warnings-timeout: 600
|
||||||
|
```
|
||||||
|
|
||||||
|
The `retry-on-snapshot-warnings-timeout` (in seconds) needs to be long enough to allow the entire `run-build-and-generate-dependency-snapshot` and `submit-dependency-snapshot` workflows (above) to complete.
|
||||||
|
|
||||||
## Gradle version compatibility
|
## Gradle version compatibility
|
||||||
|
|
||||||
The GitHub Dependency Graph plugin should be compatible with all versions of Gradle >= 5.0, and has been tested against
|
The GitHub Dependency Graph plugin should be compatible with all versions of Gradle >= 5.0, and has been tested against
|
||||||
@@ -726,6 +833,23 @@ limited to Gradle "8.1.0" and later:
|
|||||||
To use this plugin with versions of Gradle older than "8.1.0", you'll need to invoke Gradle with the
|
To use this plugin with versions of Gradle older than "8.1.0", you'll need to invoke Gradle with the
|
||||||
configuration-cache disabled.
|
configuration-cache disabled.
|
||||||
|
|
||||||
|
## Reducing storage costs for saved dependency graph artifacts
|
||||||
|
|
||||||
|
When `generate` or `generate-and-submit` is used with the action, the dependency graph that is generated is stored as a workflow artifact.
|
||||||
|
By default, these artifacts are retained for a period of 30 days (or as configured for the repository).
|
||||||
|
To reduce storage costs for these artifacts, you can set the `artifact-retention-days` value to a lower number.
|
||||||
|
|
||||||
|
```yaml
|
||||||
|
steps:
|
||||||
|
- name: Generate dependency graph, but only retain artifact for one day
|
||||||
|
uses: gradle/gradle-build-action@v2
|
||||||
|
with:
|
||||||
|
dependency-graph: generate
|
||||||
|
artifact-retention-days: 1
|
||||||
|
```
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
# Gradle Enterprise plugin injection
|
# Gradle Enterprise plugin injection
|
||||||
|
|
||||||
The `gradle-build-action` provides support for injecting and configuring the Gradle Enterprise Gradle plugin into any Gradle build, without any modification to the project sources.
|
The `gradle-build-action` provides support for injecting and configuring the Gradle Enterprise Gradle plugin into any Gradle build, without any modification to the project sources.
|
||||||
@@ -745,21 +869,21 @@ name: Run build with Gradle Enterprise injection
|
|||||||
env:
|
env:
|
||||||
GRADLE_ENTERPRISE_INJECTION_ENABLED: true
|
GRADLE_ENTERPRISE_INJECTION_ENABLED: true
|
||||||
GRADLE_ENTERPRISE_URL: https://ge.gradle.org
|
GRADLE_ENTERPRISE_URL: https://ge.gradle.org
|
||||||
GRADLE_ENTERPRISE_PLUGIN_VERSION: 3.14.1
|
GRADLE_ENTERPRISE_PLUGIN_VERSION: 3.15.1
|
||||||
GRADLE_ENTERPRISE_ACCESS_KEY: ${{ secrets.GE_ACCESS_KEY }} # Required to publish scans to ge.gradle.org
|
GRADLE_ENTERPRISE_ACCESS_KEY: ${{ secrets.GE_ACCESS_KEY }} # Required to publish scans to ge.gradle.org
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
build:
|
build:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v3
|
- uses: actions/checkout@v4
|
||||||
- name: Setup Gradle
|
- name: Setup Gradle
|
||||||
uses: gradle/gradle-build-action@v2
|
uses: gradle/gradle-build-action@v2
|
||||||
- name: Run a Gradle build with Gradle Enterprise injection enabled
|
- name: Run a Gradle build with Gradle Enterprise injection enabled
|
||||||
run: ./gradlew build
|
run: ./gradlew build
|
||||||
```
|
```
|
||||||
|
|
||||||
This configuration will automatically apply `v3.14.1` of the [Gradle Enterprise Gradle plugin](https://docs.gradle.com/enterprise/gradle-plugin/), and publish build scans to https://ge.gradle.org.
|
This configuration will automatically apply `v3.15.1` of the [Gradle Enterprise Gradle plugin](https://docs.gradle.com/enterprise/gradle-plugin/), and publish build scans to https://ge.gradle.org.
|
||||||
|
|
||||||
Note that the `ge.gradle.org` server requires authentication in order to publish scans. The provided `GRADLE_ENTERPRISE_ACCESS_KEY` isn't required by the Gradle Enterprise injection script,
|
Note that the `ge.gradle.org` server requires authentication in order to publish scans. The provided `GRADLE_ENTERPRISE_ACCESS_KEY` isn't required by the Gradle Enterprise injection script,
|
||||||
but will be used by the GE plugin in order to authenticate with the server.
|
but will be used by the GE plugin in order to authenticate with the server.
|
||||||
@@ -777,3 +901,14 @@ The `init-script` supports a number of additional configuration parameters that
|
|||||||
| GRADLE_ENTERPRISE_PLUGIN_VERSION | :white_check_mark: | the version of the [Gradle Enterprise Gradle plugin](https://docs.gradle.com/enterprise/gradle-plugin/) to apply |
|
| GRADLE_ENTERPRISE_PLUGIN_VERSION | :white_check_mark: | the version of the [Gradle Enterprise Gradle plugin](https://docs.gradle.com/enterprise/gradle-plugin/) to apply |
|
||||||
| GRADLE_ENTERPRISE_CCUD_PLUGIN_VERSION | | the version of the [Common Custom User Data Gradle plugin](https://github.com/gradle/common-custom-user-data-gradle-plugin) to apply, if any |
|
| GRADLE_ENTERPRISE_CCUD_PLUGIN_VERSION | | the version of the [Common Custom User Data Gradle plugin](https://github.com/gradle/common-custom-user-data-gradle-plugin) to apply, if any |
|
||||||
| GRADLE_ENTERPRISE_PLUGIN_REPOSITORY_URL | | the URL of the repository to use when resolving the GE and CCUD plugins; the Gradle Plugin Portal is used by default |
|
| GRADLE_ENTERPRISE_PLUGIN_REPOSITORY_URL | | the URL of the repository to use when resolving the GE and CCUD plugins; the Gradle Plugin Portal is used by default |
|
||||||
|
|
||||||
|
## Publishing to scans.gradle.com
|
||||||
|
|
||||||
|
Gradle Enterprise injection is designed to enable publishing of build scans to a Gradle Enterprise instance,
|
||||||
|
and is not suitable for publishing to the public Build Scans instance (https://scans.gradle.com).
|
||||||
|
|
||||||
|
In order to publish Build Scans to scans.gradle.com, you need to:
|
||||||
|
- Apply the Gradle Enterprise plugin to your build configuration ([see docs](https://docs.gradle.com/enterprise/get-started/#applying_the_plugin))
|
||||||
|
- Programmatically accept the Terms of Service for scans.gradle.com ([see docs](https://docs.gradle.com/enterprise/gradle-plugin/#connecting_to_scans_gradle_com))
|
||||||
|
- Execute the build with `--scan` or configure your build with `publishAlways()` ([see docs](https://docs.gradle.com/enterprise/get-started/#always_publishing_a_build_scan))
|
||||||
|
|
||||||
|
15
action.yml
15
action.yml
@@ -54,6 +54,11 @@ inputs:
|
|||||||
# gradle-home-cache-excludes: |
|
# gradle-home-cache-excludes: |
|
||||||
# caches/build-cache-1
|
# caches/build-cache-1
|
||||||
|
|
||||||
|
gradle-home-cache-cleanup:
|
||||||
|
description: When 'true', the action will attempt to remove any stale/unused entries from the Gradle User Home prior to saving to the GitHub Actions cache.
|
||||||
|
required: false
|
||||||
|
default: false
|
||||||
|
|
||||||
arguments:
|
arguments:
|
||||||
description: Gradle command line arguments (supports multi-line input)
|
description: Gradle command line arguments (supports multi-line input)
|
||||||
required: false
|
required: false
|
||||||
@@ -64,10 +69,14 @@ inputs:
|
|||||||
default: true
|
default: true
|
||||||
|
|
||||||
dependency-graph:
|
dependency-graph:
|
||||||
description: Specifies if a GitHub dependency snapshot should be generated for each Gradle build, and if so, how. Valid values are 'disabled' (default), 'generate', 'generate-and-submit' and 'download-and-submit'.
|
description: Specifies if a GitHub dependency snapshot should be generated for each Gradle build, and if so, how. Valid values are 'disabled' (default), 'generate', 'generate-and-submit', 'download-and-submit' and 'clear'.
|
||||||
required: false
|
required: false
|
||||||
default: 'disabled'
|
default: 'disabled'
|
||||||
|
|
||||||
|
artifact-retention-days:
|
||||||
|
description: Specifies the number of days to retain any artifacts generated by the action. If not set, the default retention settings for the repository will apply.
|
||||||
|
required: false
|
||||||
|
|
||||||
# EXPERIMENTAL & INTERNAL ACTION INPUTS
|
# EXPERIMENTAL & INTERNAL ACTION INPUTS
|
||||||
# The following action properties allow fine-grained tweaking of the action caching behaviour.
|
# The following action properties allow fine-grained tweaking of the action caching behaviour.
|
||||||
# These properties are experimental and not (yet) designed for production use, and may change without notice in a subsequent release of `gradle-build-action`.
|
# These properties are experimental and not (yet) designed for production use, and may change without notice in a subsequent release of `gradle-build-action`.
|
||||||
@@ -80,10 +89,6 @@ inputs:
|
|||||||
description: Used to uniquely identify the current job invocation. Defaults to the matrix values for this job; this should not be overridden by users (INTERNAL).
|
description: Used to uniquely identify the current job invocation. Defaults to the matrix values for this job; this should not be overridden by users (INTERNAL).
|
||||||
required: false
|
required: false
|
||||||
default: ${{ toJSON(matrix) }}
|
default: ${{ toJSON(matrix) }}
|
||||||
gradle-home-cache-cleanup:
|
|
||||||
description: When 'true', the action will attempt to remove any stale/unused entries from the Gradle User Home prior to saving to the GitHub Actions cache.
|
|
||||||
required: false
|
|
||||||
default: false
|
|
||||||
|
|
||||||
github-token:
|
github-token:
|
||||||
description: The GitHub token used to authenticate when submitting via the Dependency Submission API.
|
description: The GitHub token used to authenticate when submitting via the Dependency Submission API.
|
||||||
|
@@ -1,24 +0,0 @@
|
|||||||
name: 'Clear dependency graph for a correlator'
|
|
||||||
|
|
||||||
inputs:
|
|
||||||
job-correlator:
|
|
||||||
required: true
|
|
||||||
|
|
||||||
runs:
|
|
||||||
using: "composite"
|
|
||||||
steps:
|
|
||||||
- name: Set current timestamp as env variable
|
|
||||||
shell: bash
|
|
||||||
run: echo "NOW=$(date -Iseconds)" >> $GITHUB_ENV
|
|
||||||
- name: Submit empty dependency graph
|
|
||||||
shell: bash
|
|
||||||
run: |
|
|
||||||
curl -L \
|
|
||||||
-X POST \
|
|
||||||
-H "Accept: application/vnd.github+json" \
|
|
||||||
-H "Authorization: Bearer ${{ github.token }}" \
|
|
||||||
-H "X-GitHub-Api-Version: 2022-11-28" \
|
|
||||||
https://api.github.com/repos/${{ github.repository }}/dependency-graph/snapshots \
|
|
||||||
-d '{ "version" : 0, "job" : { "id" : "${{ github.run_id }}", "correlator" : "${{ inputs.job-correlator }} " }, "sha" : "${{ github.sha }}", "ref" : "${{ github.ref }}", "detector" : { "name" : "GitHub Dependency Graph Gradle Plugin", "version" : "0.0.3", "url" : "https://github.com/gradle/github-dependency-graph-gradle-plugin" }, "manifests" : {}, "scanned" : "${{ env.NOW }}" }'
|
|
||||||
- run: echo "::notice ::Cleared dependency graph for job correlator '${{ inputs.job-correlator }}'"
|
|
||||||
shell: bash
|
|
27042
dist/main/index.js
vendored
27042
dist/main/index.js
vendored
File diff suppressed because one or more lines are too long
2
dist/main/index.js.map
vendored
2
dist/main/index.js.map
vendored
File diff suppressed because one or more lines are too long
27042
dist/post/index.js
vendored
27042
dist/post/index.js
vendored
File diff suppressed because one or more lines are too long
2
dist/post/index.js.map
vendored
2
dist/post/index.js.map
vendored
File diff suppressed because one or more lines are too long
1808
package-lock.json
generated
1808
package-lock.json
generated
File diff suppressed because it is too large
Load Diff
31
package.json
31
package.json
@@ -30,32 +30,33 @@
|
|||||||
],
|
],
|
||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@actions/artifact": "1.1.1",
|
"@actions/artifact": "1.1.2",
|
||||||
"@actions/cache": "3.2.2",
|
"@actions/cache": "3.2.2",
|
||||||
"@actions/core": "1.10.0",
|
"@actions/core": "1.10.1",
|
||||||
"@actions/exec": "1.1.1",
|
"@actions/exec": "1.1.1",
|
||||||
"@actions/github": "5.1.1",
|
"@actions/github": "5.1.1",
|
||||||
"@actions/glob": "0.4.0",
|
"@actions/glob": "0.4.0",
|
||||||
"@actions/http-client": "2.1.1",
|
"@actions/http-client": "2.2.0",
|
||||||
"@actions/tool-cache": "2.0.1",
|
"@actions/tool-cache": "2.0.1",
|
||||||
"@octokit/rest": "19.0.13",
|
"@octokit/rest": "19.0.13",
|
||||||
|
"@octokit/webhooks-types": "7.3.1",
|
||||||
"string-argv": "0.3.2"
|
"string-argv": "0.3.2"
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@types/node": "16.18.38",
|
"@types/node": "16.18.38",
|
||||||
"@types/jest": "29.5.4",
|
"@types/jest": "29.5.11",
|
||||||
"@types/unzipper": "0.10.6",
|
"@types/unzipper": "0.10.9",
|
||||||
"@typescript-eslint/parser": "6.4.1",
|
"@typescript-eslint/parser": "6.14.0",
|
||||||
"@vercel/ncc": "0.36.1",
|
"@vercel/ncc": "0.38.1",
|
||||||
"eslint": "8.47.0",
|
"eslint": "8.55.0",
|
||||||
"eslint-plugin-github": "4.9.2",
|
"eslint-plugin-github": "4.10.1",
|
||||||
"eslint-plugin-jest": "27.2.3",
|
"eslint-plugin-jest": "27.6.0",
|
||||||
"eslint-plugin-prettier": "5.0.0",
|
"eslint-plugin-prettier": "5.0.1",
|
||||||
"jest": "29.6.3",
|
"jest": "29.7.0",
|
||||||
"js-yaml": "4.1.0",
|
"js-yaml": "4.1.0",
|
||||||
"patch-package": "8.0.0",
|
"patch-package": "8.0.0",
|
||||||
"prettier": "3.0.2",
|
"prettier": "3.1.1",
|
||||||
"ts-jest": "29.1.1",
|
"ts-jest": "29.1.1",
|
||||||
"typescript": "5.1.6"
|
"typescript": "5.3.3"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@@ -42,7 +42,8 @@ export class CacheCleaner {
|
|||||||
)
|
)
|
||||||
fs.writeFileSync(path.resolve(cleanupProjectDir, 'build.gradle'), 'task("noop") {}')
|
fs.writeFileSync(path.resolve(cleanupProjectDir, 'build.gradle'), 'task("noop") {}')
|
||||||
|
|
||||||
await exec.exec(`gradle -g ${this.gradleUserHome} --no-daemon --build-cache --no-scan --quiet noop`, [], {
|
const gradleCommand = `gradle -g ${this.gradleUserHome} --no-daemon --build-cache --no-scan --quiet -DGITHUB_DEPENDENCY_GRAPH_ENABLED=false noop`
|
||||||
|
await exec.exec(gradleCommand, [], {
|
||||||
cwd: cleanupProjectDir
|
cwd: cleanupProjectDir
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
@@ -90,7 +90,11 @@ export async function save(
|
|||||||
if (isCacheCleanupEnabled()) {
|
if (isCacheCleanupEnabled()) {
|
||||||
core.info('Forcing cache cleanup.')
|
core.info('Forcing cache cleanup.')
|
||||||
const cacheCleaner = new CacheCleaner(gradleUserHome, process.env['RUNNER_TEMP']!)
|
const cacheCleaner = new CacheCleaner(gradleUserHome, process.env['RUNNER_TEMP']!)
|
||||||
await cacheCleaner.forceCleanup()
|
try {
|
||||||
|
await cacheCleaner.forceCleanup()
|
||||||
|
} catch (e) {
|
||||||
|
core.warning(`Cache cleanup failed. Will continue. ${String(e)}`)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
await core.group('Caching Gradle state', async () => {
|
await core.group('Caching Gradle state', async () => {
|
||||||
|
@@ -3,44 +3,59 @@ import * as artifact from '@actions/artifact'
|
|||||||
import * as github from '@actions/github'
|
import * as github from '@actions/github'
|
||||||
import * as glob from '@actions/glob'
|
import * as glob from '@actions/glob'
|
||||||
import * as toolCache from '@actions/tool-cache'
|
import * as toolCache from '@actions/tool-cache'
|
||||||
import {Octokit} from '@octokit/rest'
|
import {GitHub} from '@actions/github/lib/utils'
|
||||||
|
import {RequestError} from '@octokit/request-error'
|
||||||
|
import type {PullRequestEvent} from '@octokit/webhooks-types'
|
||||||
|
|
||||||
import * as path from 'path'
|
import * as path from 'path'
|
||||||
import fs from 'fs'
|
import fs from 'fs'
|
||||||
|
|
||||||
import * as layout from './repository-layout'
|
import * as layout from './repository-layout'
|
||||||
import {DependencyGraphOption, getJobMatrix} from './input-params'
|
import {DependencyGraphOption, getJobMatrix, getArtifactRetentionDays} from './input-params'
|
||||||
|
|
||||||
const DEPENDENCY_GRAPH_ARTIFACT = 'dependency-graph'
|
const DEPENDENCY_GRAPH_ARTIFACT = 'dependency-graph'
|
||||||
|
|
||||||
export function setup(option: DependencyGraphOption): void {
|
export async function setup(option: DependencyGraphOption): Promise<void> {
|
||||||
if (option === DependencyGraphOption.Disabled || option === DependencyGraphOption.DownloadAndSubmit) {
|
if (option === DependencyGraphOption.Disabled) {
|
||||||
|
return
|
||||||
|
}
|
||||||
|
// Download and submit early, for compatability with dependency review.
|
||||||
|
if (option === DependencyGraphOption.DownloadAndSubmit) {
|
||||||
|
await downloadAndSubmitDependencyGraphs()
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
core.info('Enabling dependency graph generation')
|
core.info('Enabling dependency graph generation')
|
||||||
const jobCorrelator = getJobCorrelator()
|
|
||||||
core.exportVariable('GITHUB_DEPENDENCY_GRAPH_ENABLED', 'true')
|
core.exportVariable('GITHUB_DEPENDENCY_GRAPH_ENABLED', 'true')
|
||||||
core.exportVariable('GITHUB_JOB_CORRELATOR', jobCorrelator)
|
core.exportVariable('GITHUB_DEPENDENCY_GRAPH_JOB_CORRELATOR', getJobCorrelator())
|
||||||
core.exportVariable('GITHUB_JOB_ID', github.context.runId)
|
core.exportVariable('GITHUB_DEPENDENCY_GRAPH_JOB_ID', github.context.runId)
|
||||||
|
core.exportVariable('GITHUB_DEPENDENCY_GRAPH_REF', github.context.ref)
|
||||||
|
core.exportVariable('GITHUB_DEPENDENCY_GRAPH_SHA', getShaFromContext())
|
||||||
|
core.exportVariable('GITHUB_DEPENDENCY_GRAPH_WORKSPACE', layout.workspaceDirectory())
|
||||||
core.exportVariable(
|
core.exportVariable(
|
||||||
'DEPENDENCY_GRAPH_REPORT_DIR',
|
'DEPENDENCY_GRAPH_REPORT_DIR',
|
||||||
path.resolve(layout.workspaceDirectory(), 'dependency-graph-reports')
|
path.resolve(layout.workspaceDirectory(), 'dependency-graph-reports')
|
||||||
)
|
)
|
||||||
|
|
||||||
|
// To clear the dependency graph, we generate an empty graph by excluding all projects and configurations
|
||||||
|
if (option === DependencyGraphOption.Clear) {
|
||||||
|
core.exportVariable('DEPENDENCY_GRAPH_INCLUDE_PROJECTS', '')
|
||||||
|
core.exportVariable('DEPENDENCY_GRAPH_INCLUDE_CONFIGURATIONS', '')
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
export async function complete(option: DependencyGraphOption): Promise<void> {
|
export async function complete(option: DependencyGraphOption): Promise<void> {
|
||||||
switch (option) {
|
switch (option) {
|
||||||
case DependencyGraphOption.Disabled:
|
case DependencyGraphOption.Disabled:
|
||||||
|
case DependencyGraphOption.DownloadAndSubmit: // Performed in setup
|
||||||
return
|
return
|
||||||
case DependencyGraphOption.Generate:
|
case DependencyGraphOption.Generate:
|
||||||
await uploadDependencyGraphs()
|
await uploadDependencyGraphs()
|
||||||
return
|
return
|
||||||
case DependencyGraphOption.GenerateAndSubmit:
|
case DependencyGraphOption.GenerateAndSubmit:
|
||||||
|
case DependencyGraphOption.Clear: // Submit the empty dependency graph
|
||||||
await submitDependencyGraphs(await uploadDependencyGraphs())
|
await submitDependencyGraphs(await uploadDependencyGraphs())
|
||||||
return
|
return
|
||||||
case DependencyGraphOption.DownloadAndSubmit:
|
|
||||||
await downloadAndSubmitDependencyGraphs()
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -52,7 +67,9 @@ async function uploadDependencyGraphs(): Promise<string[]> {
|
|||||||
core.info(`Uploading dependency graph files: ${relativeGraphFiles}`)
|
core.info(`Uploading dependency graph files: ${relativeGraphFiles}`)
|
||||||
|
|
||||||
const artifactClient = artifact.create()
|
const artifactClient = artifact.create()
|
||||||
artifactClient.uploadArtifact(DEPENDENCY_GRAPH_ARTIFACT, graphFiles, workspaceDirectory)
|
artifactClient.uploadArtifact(DEPENDENCY_GRAPH_ARTIFACT, graphFiles, workspaceDirectory, {
|
||||||
|
retentionDays: getArtifactRetentionDays()
|
||||||
|
})
|
||||||
|
|
||||||
return graphFiles
|
return graphFiles
|
||||||
}
|
}
|
||||||
@@ -63,21 +80,44 @@ async function downloadAndSubmitDependencyGraphs(): Promise<void> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
async function submitDependencyGraphs(dependencyGraphFiles: string[]): Promise<void> {
|
async function submitDependencyGraphs(dependencyGraphFiles: string[]): Promise<void> {
|
||||||
const octokit: Octokit = getOctokit()
|
|
||||||
|
|
||||||
for (const jsonFile of dependencyGraphFiles) {
|
for (const jsonFile of dependencyGraphFiles) {
|
||||||
const jsonContent = fs.readFileSync(jsonFile, 'utf8')
|
try {
|
||||||
|
await submitDependencyGraphFile(jsonFile)
|
||||||
const jsonObject = JSON.parse(jsonContent)
|
} catch (error) {
|
||||||
jsonObject.owner = github.context.repo.owner
|
if (error instanceof RequestError) {
|
||||||
jsonObject.repo = github.context.repo.repo
|
core.warning(buildWarningMessage(jsonFile, error))
|
||||||
const response = await octokit.request('POST /repos/{owner}/{repo}/dependency-graph/snapshots', jsonObject)
|
} else {
|
||||||
|
throw error
|
||||||
const relativeJsonFile = getRelativePathFromWorkspace(jsonFile)
|
}
|
||||||
core.notice(`Submitted ${relativeJsonFile}: ${response.data.message}`)
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function buildWarningMessage(jsonFile: string, error: RequestError): string {
|
||||||
|
const relativeJsonFile = getRelativePathFromWorkspace(jsonFile)
|
||||||
|
const mainWarning = `Failed to submit dependency graph ${relativeJsonFile}.\n${String(error)}`
|
||||||
|
if (error.message === 'Resource not accessible by integration') {
|
||||||
|
return `${mainWarning}
|
||||||
|
Please ensure that the 'contents: write' permission is available for the workflow job.
|
||||||
|
Note that this permission is never available for a 'pull_request' trigger from a repository fork.
|
||||||
|
`
|
||||||
|
}
|
||||||
|
return mainWarning
|
||||||
|
}
|
||||||
|
|
||||||
|
async function submitDependencyGraphFile(jsonFile: string): Promise<void> {
|
||||||
|
const octokit = getOctokit()
|
||||||
|
const jsonContent = fs.readFileSync(jsonFile, 'utf8')
|
||||||
|
|
||||||
|
const jsonObject = JSON.parse(jsonContent)
|
||||||
|
jsonObject.owner = github.context.repo.owner
|
||||||
|
jsonObject.repo = github.context.repo.repo
|
||||||
|
const response = await octokit.request('POST /repos/{owner}/{repo}/dependency-graph/snapshots', jsonObject)
|
||||||
|
|
||||||
|
const relativeJsonFile = getRelativePathFromWorkspace(jsonFile)
|
||||||
|
core.notice(`Submitted ${relativeJsonFile}: ${response.data.message}`)
|
||||||
|
}
|
||||||
|
|
||||||
async function retrieveDependencyGraphs(workspaceDirectory: string): Promise<string[]> {
|
async function retrieveDependencyGraphs(workspaceDirectory: string): Promise<string[]> {
|
||||||
if (github.context.payload.workflow_run) {
|
if (github.context.payload.workflow_run) {
|
||||||
return await retrieveDependencyGraphsForWorkflowRun(github.context.payload.workflow_run.id, workspaceDirectory)
|
return await retrieveDependencyGraphsForWorkflowRun(github.context.payload.workflow_run.id, workspaceDirectory)
|
||||||
@@ -86,7 +126,7 @@ async function retrieveDependencyGraphs(workspaceDirectory: string): Promise<str
|
|||||||
}
|
}
|
||||||
|
|
||||||
async function retrieveDependencyGraphsForWorkflowRun(runId: number, workspaceDirectory: string): Promise<string[]> {
|
async function retrieveDependencyGraphsForWorkflowRun(runId: number, workspaceDirectory: string): Promise<string[]> {
|
||||||
const octokit: Octokit = getOctokit()
|
const octokit = getOctokit()
|
||||||
|
|
||||||
// Find the workflow run artifacts named "dependency-graph"
|
// Find the workflow run artifacts named "dependency-graph"
|
||||||
const artifacts = await octokit.rest.actions.listWorkflowRunArtifacts({
|
const artifacts = await octokit.rest.actions.listWorkflowRunArtifacts({
|
||||||
@@ -136,10 +176,8 @@ async function findDependencyGraphFiles(dir: string): Promise<string[]> {
|
|||||||
return graphFiles
|
return graphFiles
|
||||||
}
|
}
|
||||||
|
|
||||||
function getOctokit(): Octokit {
|
function getOctokit(): InstanceType<typeof GitHub> {
|
||||||
return new Octokit({
|
return github.getOctokit(getGithubToken())
|
||||||
auth: getGithubToken()
|
|
||||||
})
|
|
||||||
}
|
}
|
||||||
|
|
||||||
function getGithubToken(): string {
|
function getGithubToken(): string {
|
||||||
@@ -151,7 +189,26 @@ function getRelativePathFromWorkspace(file: string): string {
|
|||||||
return path.relative(workspaceDirectory, file)
|
return path.relative(workspaceDirectory, file)
|
||||||
}
|
}
|
||||||
|
|
||||||
export function getJobCorrelator(): string {
|
function getShaFromContext(): string {
|
||||||
|
const context = github.context
|
||||||
|
const pullRequestEvents = [
|
||||||
|
'pull_request',
|
||||||
|
'pull_request_comment',
|
||||||
|
'pull_request_review',
|
||||||
|
'pull_request_review_comment'
|
||||||
|
// Note that pull_request_target is omitted here.
|
||||||
|
// That event runs in the context of the base commit of the PR,
|
||||||
|
// so the snapshot should not be associated with the head commit.
|
||||||
|
]
|
||||||
|
if (pullRequestEvents.includes(context.eventName)) {
|
||||||
|
const pr = (context.payload as PullRequestEvent).pull_request
|
||||||
|
return pr.head.sha
|
||||||
|
} else {
|
||||||
|
return context.sha
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
function getJobCorrelator(): string {
|
||||||
return constructJobCorrelator(github.context.workflow, github.context.job, getJobMatrix())
|
return constructJobCorrelator(github.context.workflow, github.context.job, getJobMatrix())
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -82,12 +82,31 @@ export function getDependencyGraphOption(): DependencyGraphOption {
|
|||||||
return DependencyGraphOption.GenerateAndSubmit
|
return DependencyGraphOption.GenerateAndSubmit
|
||||||
case 'download-and-submit':
|
case 'download-and-submit':
|
||||||
return DependencyGraphOption.DownloadAndSubmit
|
return DependencyGraphOption.DownloadAndSubmit
|
||||||
|
case 'clear':
|
||||||
|
return DependencyGraphOption.Clear
|
||||||
}
|
}
|
||||||
throw TypeError(
|
throw TypeError(
|
||||||
`The value '${val} is not valid for 'dependency-graph. Valid values are: [disabled, generate-and-upload, generate-and-submit, download-and-submit]. The default value is 'disabled'.`
|
`The value '${val} is not valid for 'dependency-graph. Valid values are: [disabled, generate-and-upload, generate-and-submit, download-and-submit]. The default value is 'disabled'.`
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
export function getArtifactRetentionDays(): number {
|
||||||
|
const val = core.getInput('artifact-retention-days')
|
||||||
|
return parseNumericInput('artifact-retention-days', val, 0)
|
||||||
|
// Zero indicates that the default repository settings should be used
|
||||||
|
}
|
||||||
|
|
||||||
|
export function parseNumericInput(paramName: string, paramValue: string, paramDefault: number): number {
|
||||||
|
if (paramValue.length === 0) {
|
||||||
|
return paramDefault
|
||||||
|
}
|
||||||
|
const numericValue = parseInt(paramValue)
|
||||||
|
if (isNaN(numericValue)) {
|
||||||
|
throw TypeError(`The value '${paramValue}' is not a valid numeric value for '${paramName}'.`)
|
||||||
|
}
|
||||||
|
return numericValue
|
||||||
|
}
|
||||||
|
|
||||||
function getBooleanInput(paramName: string, paramDefault = false): boolean {
|
function getBooleanInput(paramName: string, paramDefault = false): boolean {
|
||||||
const paramValue = core.getInput(paramName)
|
const paramValue = core.getInput(paramName)
|
||||||
switch (paramValue.toLowerCase().trim()) {
|
switch (paramValue.toLowerCase().trim()) {
|
||||||
@@ -105,5 +124,6 @@ export enum DependencyGraphOption {
|
|||||||
Disabled,
|
Disabled,
|
||||||
Generate,
|
Generate,
|
||||||
GenerateAndSubmit,
|
GenerateAndSubmit,
|
||||||
DownloadAndSubmit
|
DownloadAndSubmit,
|
||||||
|
Clear
|
||||||
}
|
}
|
||||||
|
@@ -50,12 +50,16 @@ abstract class BuildResultsRecorder implements BuildService<BuildResultsRecorder
|
|||||||
if (!runnerTempDir || !githubActionStep) {
|
if (!runnerTempDir || !githubActionStep) {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
def buildResultsDir = new File(runnerTempDir, ".build-results")
|
try {
|
||||||
buildResultsDir.mkdirs()
|
def buildResultsDir = new File(runnerTempDir, ".build-results")
|
||||||
def buildResultsFile = new File(buildResultsDir, githubActionStep + getParameters().getInvocationId().get() + ".json")
|
buildResultsDir.mkdirs()
|
||||||
if (!buildResultsFile.exists()) {
|
def buildResultsFile = new File(buildResultsDir, githubActionStep + getParameters().getInvocationId().get() + ".json")
|
||||||
buildResultsFile << groovy.json.JsonOutput.toJson(buildResults)
|
if (!buildResultsFile.exists()) {
|
||||||
|
buildResultsFile << groovy.json.JsonOutput.toJson(buildResults)
|
||||||
|
}
|
||||||
|
} catch (Exception e) {
|
||||||
|
println "\ngradle-build-action failed to write build-results file. Will continue.\n> ${e.getLocalizedMessage()}"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@@ -121,18 +121,23 @@ class BuildResults {
|
|||||||
if (!runnerTempDir || !githubActionStep) {
|
if (!runnerTempDir || !githubActionStep) {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
def buildResultsDir = new File(runnerTempDir, ".build-results")
|
|
||||||
buildResultsDir.mkdirs()
|
|
||||||
def buildResultsFile = new File(buildResultsDir, githubActionStep + invocationId + ".json")
|
|
||||||
|
|
||||||
// Overwrite any contents written by buildFinished or build service, since this result is a superset.
|
try {
|
||||||
if (buildResultsFile.exists()) {
|
def buildResultsDir = new File(runnerTempDir, ".build-results")
|
||||||
if (overwrite) {
|
buildResultsDir.mkdirs()
|
||||||
buildResultsFile.text = groovy.json.JsonOutput.toJson(buildResults)
|
def buildResultsFile = new File(buildResultsDir, githubActionStep + invocationId + ".json")
|
||||||
|
|
||||||
|
// Overwrite any contents written by buildFinished or build service, since this result is a superset.
|
||||||
|
if (buildResultsFile.exists()) {
|
||||||
|
if (overwrite) {
|
||||||
|
buildResultsFile.text = groovy.json.JsonOutput.toJson(buildResults)
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
buildResultsFile << groovy.json.JsonOutput.toJson(buildResults)
|
||||||
}
|
}
|
||||||
} else {
|
|
||||||
buildResultsFile << groovy.json.JsonOutput.toJson(buildResults)
|
} catch (Exception e) {
|
||||||
|
println "\ngradle-build-action failed to write build-results file. Will continue.\n> ${e.getLocalizedMessage()}"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@@ -1,9 +1,15 @@
|
|||||||
buildscript {
|
buildscript {
|
||||||
|
def getInputParam = { String name ->
|
||||||
|
def envVarName = name.toUpperCase().replace('.', '_').replace('-', '_')
|
||||||
|
return System.getProperty(name) ?: System.getenv(envVarName)
|
||||||
|
}
|
||||||
|
def pluginRepositoryUrl = getInputParam('gradle.plugin-repository.url') ?: 'https://plugins.gradle.org/m2'
|
||||||
|
|
||||||
repositories {
|
repositories {
|
||||||
maven { url "https://plugins.gradle.org/m2/" }
|
maven { url pluginRepositoryUrl }
|
||||||
}
|
}
|
||||||
dependencies {
|
dependencies {
|
||||||
classpath "org.gradle:github-dependency-graph-gradle-plugin:0.2.0"
|
classpath "org.gradle:github-dependency-graph-gradle-plugin:1.0.0"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
apply plugin: org.gradle.github.GitHubDependencyGraphPlugin
|
apply plugin: org.gradle.github.GitHubDependencyGraphPlugin
|
||||||
|
@@ -1,7 +1,7 @@
|
|||||||
import org.gradle.util.GradleVersion
|
import org.gradle.util.GradleVersion
|
||||||
|
|
||||||
// Only run when dependency graph is explicitly enabled
|
// Only run when dependency graph is explicitly enabled
|
||||||
if (System.env.GITHUB_DEPENDENCY_GRAPH_ENABLED != "true") {
|
if (getVariable('GITHUB_DEPENDENCY_GRAPH_ENABLED') != "true") {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -15,10 +15,10 @@ if (GradleVersion.current().baseVersion < GradleVersion.version("5.0")) {
|
|||||||
// This is only required for top-level builds
|
// This is only required for top-level builds
|
||||||
def isTopLevelBuild = gradle.getParent() == null
|
def isTopLevelBuild = gradle.getParent() == null
|
||||||
if (isTopLevelBuild) {
|
if (isTopLevelBuild) {
|
||||||
def reportFile = getUniqueReportFile(System.env.GITHUB_JOB_CORRELATOR)
|
def reportFile = getUniqueReportFile(getVariable('GITHUB_DEPENDENCY_GRAPH_JOB_CORRELATOR'))
|
||||||
|
|
||||||
if (reportFile == null) {
|
if (reportFile == null) {
|
||||||
println "::warning::No dependency snapshot generated for step. Could not determine unique job correlator - specify GITHUB_JOB_CORRELATOR var for this step."
|
println "::warning::No dependency snapshot generated for step. Could not determine unique job correlator - specify GITHUB_DEPENDENCY_GRAPH_JOB_CORRELATOR var for this step."
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -40,7 +40,7 @@ apply from: 'gradle-build-action.github-dependency-graph-gradle-plugin-apply.gro
|
|||||||
* - When found, this value is set as a System property override.
|
* - When found, this value is set as a System property override.
|
||||||
*/
|
*/
|
||||||
File getUniqueReportFile(String jobCorrelator) {
|
File getUniqueReportFile(String jobCorrelator) {
|
||||||
def reportDir = System.env.DEPENDENCY_GRAPH_REPORT_DIR
|
def reportDir = getVariable('DEPENDENCY_GRAPH_REPORT_DIR')
|
||||||
def reportFile = new File(reportDir, jobCorrelator + ".json")
|
def reportFile = new File(reportDir, jobCorrelator + ".json")
|
||||||
if (!reportFile.exists()) return reportFile
|
if (!reportFile.exists()) return reportFile
|
||||||
|
|
||||||
@@ -49,7 +49,7 @@ File getUniqueReportFile(String jobCorrelator) {
|
|||||||
def candidateCorrelator = jobCorrelator + "-" + i
|
def candidateCorrelator = jobCorrelator + "-" + i
|
||||||
def candidateFile = new File(reportDir, candidateCorrelator + ".json")
|
def candidateFile = new File(reportDir, candidateCorrelator + ".json")
|
||||||
if (!candidateFile.exists()) {
|
if (!candidateFile.exists()) {
|
||||||
System.properties['GITHUB_JOB_CORRELATOR'] = candidateCorrelator
|
System.properties['GITHUB_DEPENDENCY_GRAPH_JOB_CORRELATOR'] = candidateCorrelator
|
||||||
return candidateFile
|
return candidateFile
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -57,3 +57,10 @@ File getUniqueReportFile(String jobCorrelator) {
|
|||||||
// Could not determine unique job correlator
|
// Could not determine unique job correlator
|
||||||
return null
|
return null
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Return the environment variable value, or equivalent system property (if set)
|
||||||
|
*/
|
||||||
|
String getVariable(String name) {
|
||||||
|
return System.properties[name] ?: System.getenv(name)
|
||||||
|
}
|
||||||
|
@@ -168,7 +168,7 @@ if (GradleVersion.current() < GradleVersion.version('6.0')) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void applyPluginExternally(PluginManager pluginManager, String pluginClassName) {
|
void applyPluginExternally(def pluginManager, String pluginClassName) {
|
||||||
def externallyApplied = 'gradle.enterprise.externally-applied'
|
def externallyApplied = 'gradle.enterprise.externally-applied'
|
||||||
def oldValue = System.getProperty(externallyApplied)
|
def oldValue = System.getProperty(externallyApplied)
|
||||||
System.setProperty(externallyApplied, 'true')
|
System.setProperty(externallyApplied, 'true')
|
||||||
|
@@ -38,7 +38,7 @@ export async function setup(): Promise<void> {
|
|||||||
|
|
||||||
core.saveState(CACHE_LISTENER, cacheListener.stringify())
|
core.saveState(CACHE_LISTENER, cacheListener.stringify())
|
||||||
|
|
||||||
dependencyGraph.setup(params.getDependencyGraphOption())
|
await dependencyGraph.setup(params.getDependencyGraphOption())
|
||||||
}
|
}
|
||||||
|
|
||||||
export async function complete(): Promise<void> {
|
export async function complete(): Promise<void> {
|
||||||
@@ -62,7 +62,7 @@ export async function complete(): Promise<void> {
|
|||||||
logJobSummary(buildResults, cacheListener)
|
logJobSummary(buildResults, cacheListener)
|
||||||
}
|
}
|
||||||
|
|
||||||
dependencyGraph.complete(params.getDependencyGraphOption())
|
await dependencyGraph.complete(params.getDependencyGraphOption())
|
||||||
}
|
}
|
||||||
|
|
||||||
async function determineGradleUserHome(): Promise<string> {
|
async function determineGradleUserHome(): Promise<string> {
|
||||||
|
@@ -20,7 +20,7 @@ dependencies {
|
|||||||
testImplementation ('io.ratpack:ratpack-groovy-test:1.9.0') {
|
testImplementation ('io.ratpack:ratpack-groovy-test:1.9.0') {
|
||||||
exclude group: 'org.codehaus.groovy', module: 'groovy-all'
|
exclude group: 'org.codehaus.groovy', module: 'groovy-all'
|
||||||
}
|
}
|
||||||
testImplementation 'com.fasterxml.jackson.dataformat:jackson-dataformat-smile:2.15.2'
|
testImplementation 'com.fasterxml.jackson.dataformat:jackson-dataformat-smile:2.16.0'
|
||||||
}
|
}
|
||||||
|
|
||||||
test {
|
test {
|
||||||
|
@@ -1,6 +1,6 @@
|
|||||||
plugins {
|
plugins {
|
||||||
id "com.gradle.enterprise" version "3.14.1"
|
id "com.gradle.enterprise" version "3.15.1"
|
||||||
id "com.gradle.common-custom-user-data-gradle-plugin" version "1.11.1"
|
id "com.gradle.common-custom-user-data-gradle-plugin" version "1.12"
|
||||||
}
|
}
|
||||||
|
|
||||||
gradleEnterprise {
|
gradleEnterprise {
|
||||||
|
@@ -16,8 +16,8 @@ import java.nio.file.Files
|
|||||||
import java.util.zip.GZIPOutputStream
|
import java.util.zip.GZIPOutputStream
|
||||||
|
|
||||||
class BaseInitScriptTest extends Specification {
|
class BaseInitScriptTest extends Specification {
|
||||||
static final String GE_PLUGIN_VERSION = '3.14.1'
|
static final String GE_PLUGIN_VERSION = '3.15.1'
|
||||||
static final String CCUD_PLUGIN_VERSION = '1.11.1'
|
static final String CCUD_PLUGIN_VERSION = '1.12'
|
||||||
|
|
||||||
static final TestGradleVersion GRADLE_3_X = new TestGradleVersion(GradleVersion.version('3.5.1'), 7, 9)
|
static final TestGradleVersion GRADLE_3_X = new TestGradleVersion(GradleVersion.version('3.5.1'), 7, 9)
|
||||||
static final TestGradleVersion GRADLE_4_X = new TestGradleVersion(GradleVersion.version('4.10.3'), 7, 10)
|
static final TestGradleVersion GRADLE_4_X = new TestGradleVersion(GradleVersion.version('4.10.3'), 7, 10)
|
||||||
@@ -26,7 +26,7 @@ class BaseInitScriptTest extends Specification {
|
|||||||
static final TestGradleVersion GRADLE_6_X = new TestGradleVersion(GradleVersion.version('6.9.4'), 8, 15)
|
static final TestGradleVersion GRADLE_6_X = new TestGradleVersion(GradleVersion.version('6.9.4'), 8, 15)
|
||||||
static final TestGradleVersion GRADLE_7_X = new TestGradleVersion(GradleVersion.version('7.6.2'), 8, 19)
|
static final TestGradleVersion GRADLE_7_X = new TestGradleVersion(GradleVersion.version('7.6.2'), 8, 19)
|
||||||
static final TestGradleVersion GRADLE_8_0 = new TestGradleVersion(GradleVersion.version('8.0.2'), 8, 19)
|
static final TestGradleVersion GRADLE_8_0 = new TestGradleVersion(GradleVersion.version('8.0.2'), 8, 19)
|
||||||
static final TestGradleVersion GRADLE_8_X = new TestGradleVersion(GradleVersion.version('8.3'), 8, 19)
|
static final TestGradleVersion GRADLE_8_X = new TestGradleVersion(GradleVersion.version('8.5'), 8, 19)
|
||||||
|
|
||||||
static final List<TestGradleVersion> ALL_VERSIONS = [
|
static final List<TestGradleVersion> ALL_VERSIONS = [
|
||||||
GRADLE_3_X, // First version where TestKit supports environment variables
|
GRADLE_3_X, // First version where TestKit supports environment variables
|
||||||
|
@@ -148,13 +148,30 @@ class TestBuildResultRecorder extends BaseInitScriptTest {
|
|||||||
testGradleVersion << ALL_VERSIONS
|
testGradleVersion << ALL_VERSIONS
|
||||||
}
|
}
|
||||||
|
|
||||||
|
def "produces no build results file when RUNNER_TEMP dir is not a writable directory with #testGradleVersion"() {
|
||||||
|
assumeTrue testGradleVersion.compatibleWithCurrentJvm
|
||||||
|
|
||||||
|
when:
|
||||||
|
def invalidDir = new File(testProjectDir, 'invalid-runner-temp')
|
||||||
|
invalidDir.createNewFile()
|
||||||
|
|
||||||
|
run(['help'], initScript, testGradleVersion.gradleVersion, [], [RUNNER_TEMP: invalidDir.absolutePath])
|
||||||
|
|
||||||
|
then:
|
||||||
|
def buildResultsDir = new File(testProjectDir, '.build-results')
|
||||||
|
assert !buildResultsDir.exists()
|
||||||
|
|
||||||
|
where:
|
||||||
|
testGradleVersion << ALL_VERSIONS
|
||||||
|
}
|
||||||
|
|
||||||
def "produces build results file with build scan when GE plugin is applied in settingsEvaluated"() {
|
def "produces build results file with build scan when GE plugin is applied in settingsEvaluated"() {
|
||||||
assumeTrue testGradleVersion.compatibleWithCurrentJvm
|
assumeTrue testGradleVersion.compatibleWithCurrentJvm
|
||||||
|
|
||||||
when:
|
when:
|
||||||
settingsFile.text = """
|
settingsFile.text = """
|
||||||
plugins {
|
plugins {
|
||||||
id 'com.gradle.enterprise' version '3.14.1' apply(false)
|
id 'com.gradle.enterprise' version '3.15.1' apply(false)
|
||||||
}
|
}
|
||||||
gradle.settingsEvaluated {
|
gradle.settingsEvaluated {
|
||||||
apply plugin: 'com.gradle.enterprise'
|
apply plugin: 'com.gradle.enterprise'
|
||||||
|
@@ -110,11 +110,11 @@ class TestDependencyGraph extends BaseInitScriptTest {
|
|||||||
def getEnvVars() {
|
def getEnvVars() {
|
||||||
return [
|
return [
|
||||||
GITHUB_DEPENDENCY_GRAPH_ENABLED: "true",
|
GITHUB_DEPENDENCY_GRAPH_ENABLED: "true",
|
||||||
GITHUB_JOB_CORRELATOR: "CORRELATOR",
|
GITHUB_DEPENDENCY_GRAPH_JOB_CORRELATOR: "CORRELATOR",
|
||||||
GITHUB_JOB_ID: "1",
|
GITHUB_DEPENDENCY_GRAPH_JOB_ID: "1",
|
||||||
GITHUB_REF: "main",
|
GITHUB_DEPENDENCY_GRAPH_REF: "main",
|
||||||
GITHUB_SHA: "123456",
|
GITHUB_DEPENDENCY_GRAPH_SHA: "123456",
|
||||||
GITHUB_WORKSPACE: testProjectDir.absolutePath,
|
GITHUB_DEPENDENCY_GRAPH_WORKSPACE: testProjectDir.absolutePath,
|
||||||
DEPENDENCY_GRAPH_REPORT_DIR: reportsDir.absolutePath,
|
DEPENDENCY_GRAPH_REPORT_DIR: reportsDir.absolutePath,
|
||||||
GITHUB_OUTPUT: gitHubOutputFile.absolutePath
|
GITHUB_OUTPUT: gitHubOutputFile.absolutePath
|
||||||
]
|
]
|
||||||
|
@@ -49,7 +49,7 @@ test('will cleanup unused gradle versions', async () => {
|
|||||||
|
|
||||||
const gradle802 = path.resolve(gradleUserHome, "caches/8.0.2")
|
const gradle802 = path.resolve(gradleUserHome, "caches/8.0.2")
|
||||||
const wrapper802 = path.resolve(gradleUserHome, "wrapper/dists/gradle-8.0.2-bin")
|
const wrapper802 = path.resolve(gradleUserHome, "wrapper/dists/gradle-8.0.2-bin")
|
||||||
const gradleCurrent = path.resolve(gradleUserHome, "caches/8.3")
|
const gradleCurrent = path.resolve(gradleUserHome, "caches/8.5")
|
||||||
|
|
||||||
expect(fs.existsSync(gradle802)).toBe(true)
|
expect(fs.existsSync(gradle802)).toBe(true)
|
||||||
expect(fs.existsSync(wrapper802)).toBe(true)
|
expect(fs.existsSync(wrapper802)).toBe(true)
|
||||||
|
22
test/jest/input-params.test.ts
Normal file
22
test/jest/input-params.test.ts
Normal file
@@ -0,0 +1,22 @@
|
|||||||
|
import * as inputParams from '../../src/input-params'
|
||||||
|
|
||||||
|
describe('input params', () => {
|
||||||
|
describe('parses numeric input', () => {
|
||||||
|
it('uses default value', () => {
|
||||||
|
const val = inputParams.parseNumericInput('param-name', '', 88)
|
||||||
|
expect(val).toBe(88)
|
||||||
|
})
|
||||||
|
it('parses numeric input', () => {
|
||||||
|
const val = inputParams.parseNumericInput('param-name', '34', 88)
|
||||||
|
expect(val).toBe(34)
|
||||||
|
})
|
||||||
|
it('fails on non-numeric input', () => {
|
||||||
|
const t = () => {
|
||||||
|
inputParams.parseNumericInput('param-name', 'xyz', 88)
|
||||||
|
};
|
||||||
|
|
||||||
|
expect(t).toThrow(TypeError)
|
||||||
|
expect(t).toThrow("The value 'xyz' is not a valid numeric value for 'param-name'.")
|
||||||
|
})
|
||||||
|
})
|
||||||
|
})
|
Reference in New Issue
Block a user