mirror of
https://github.com/gradle/actions.git
synced 2025-11-26 17:09:10 +08:00
Compare commits
51 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
94baf225fe | ||
|
|
6f10c21ec5 | ||
|
|
0b492c475f | ||
|
|
79bad900c0 | ||
|
|
986922f6a6 | ||
|
|
65a3beb941 | ||
|
|
0e67f6d83b | ||
|
|
b6ac71fd86 | ||
|
|
9053a599ae | ||
|
|
7560c304a6 | ||
|
|
dcf3ce7005 | ||
|
|
31f6205373 | ||
|
|
bcc275ce62 | ||
|
|
b693646f93 | ||
|
|
9a0c3c9368 | ||
|
|
6bef8ef2a9 | ||
|
|
91619fae90 | ||
|
|
7569aee516 | ||
|
|
b4009b3946 | ||
|
|
d068148857 | ||
|
|
b426ffebae | ||
|
|
c6e631b4a7 | ||
|
|
edf9e3c8c7 | ||
|
|
ec4681f7f5 | ||
|
|
24aa9155d9 | ||
|
|
74f9fa840c | ||
|
|
8790d96bb8 | ||
|
|
3bfa1140fc | ||
|
|
7749a316b1 | ||
|
|
245c8a24de | ||
|
|
28ab4dff3a | ||
|
|
74628b9f13 | ||
|
|
e4f356955f | ||
|
|
ec1d1bfd5f | ||
|
|
52d4223bcd | ||
|
|
2dec22cf71 | ||
|
|
faf1d7ca7a | ||
|
|
392620bad1 | ||
|
|
e6f332ecb1 | ||
|
|
c9dc8a7709 | ||
|
|
b1155b846e | ||
|
|
8c3e41f260 | ||
|
|
8646c701a9 | ||
|
|
c21133a289 | ||
|
|
bccddaec22 | ||
|
|
7ba6b1c820 | ||
|
|
04f1562da5 | ||
|
|
468d2a43e0 | ||
|
|
d318bd4811 | ||
|
|
c6309b1241 | ||
|
|
fc255bb09d |
4
.github/actions/build-dist/action.yml
vendored
4
.github/actions/build-dist/action.yml
vendored
@@ -3,7 +3,7 @@ name: 'Build and upload distribution'
|
||||
runs:
|
||||
using: "composite"
|
||||
steps:
|
||||
- uses: actions/setup-node@39370e3970a6d050c480ffad4ff0ed4d3fdee5af # v4.1.0
|
||||
- uses: actions/setup-node@1d0ff469b7ec7b3cb9d8673fde0c81c44821de2a # v4.2.0
|
||||
with:
|
||||
node-version: 20
|
||||
cache: npm
|
||||
@@ -23,7 +23,7 @@ runs:
|
||||
cp -r sources/dist .
|
||||
|
||||
- name: Upload distribution
|
||||
uses: actions/upload-artifact@b4b15b8c7c6ac21ea08fcf65892d2ee8f75cf882 # v4.4.3
|
||||
uses: actions/upload-artifact@65c4c4a1ddee5b72f698fdd19549f0f0fb45cf08 # v4.6.0
|
||||
with:
|
||||
name: dist
|
||||
path: dist/
|
||||
|
||||
2
.github/actions/init-integ-test/action.yml
vendored
2
.github/actions/init-integ-test/action.yml
vendored
@@ -4,7 +4,7 @@ runs:
|
||||
using: "composite"
|
||||
steps:
|
||||
- name: Setup Java
|
||||
uses: actions/setup-java@8df1039502a15bceb9433410b1a100fbe190c53b # v4.5.0
|
||||
uses: actions/setup-java@7a6d8a8234af8eb26422e24e3006232cccaa061b # v4.6.0
|
||||
with:
|
||||
distribution: 'temurin'
|
||||
java-version: 11
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
distributionBase=GRADLE_USER_HOME
|
||||
distributionPath=wrapper/dists
|
||||
distributionSha256Sum=f397b287023acdba1e9f6fc5ea72d22dd63669d59ed4a289a29b1a76eee151c6
|
||||
distributionUrl=https\://services.gradle.org/distributions/gradle-8.11.1-bin.zip
|
||||
distributionSha256Sum=8d97a97984f6cbd2b85fe4c60a743440a347544bf18818048e611f5288d46c94
|
||||
distributionUrl=https\://services.gradle.org/distributions/gradle-8.12.1-bin.zip
|
||||
networkTimeout=10000
|
||||
validateDistributionUrl=true
|
||||
zipStoreBase=GRADLE_USER_HOME
|
||||
|
||||
@@ -86,8 +86,7 @@ done
|
||||
# shellcheck disable=SC2034
|
||||
APP_BASE_NAME=${0##*/}
|
||||
# Discard cd standard output in case $CDPATH is set (https://github.com/gradle/gradle/issues/25036)
|
||||
APP_HOME=$( cd -P "${APP_HOME:-./}" > /dev/null && printf '%s
|
||||
' "$PWD" ) || exit
|
||||
APP_HOME=$( cd -P "${APP_HOME:-./}" > /dev/null && printf '%s\n' "$PWD" ) || exit
|
||||
|
||||
# Use the maximum available, or set MAX_FD != -1 to use that value.
|
||||
MAX_FD=maximum
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
distributionBase=GRADLE_USER_HOME
|
||||
distributionPath=wrapper/dists
|
||||
distributionSha256Sum=f397b287023acdba1e9f6fc5ea72d22dd63669d59ed4a289a29b1a76eee151c6
|
||||
distributionUrl=https\://services.gradle.org/distributions/gradle-8.11.1-bin.zip
|
||||
distributionSha256Sum=8d97a97984f6cbd2b85fe4c60a743440a347544bf18818048e611f5288d46c94
|
||||
distributionUrl=https\://services.gradle.org/distributions/gradle-8.12.1-bin.zip
|
||||
networkTimeout=10000
|
||||
validateDistributionUrl=true
|
||||
zipStoreBase=GRADLE_USER_HOME
|
||||
|
||||
3
.github/workflow-samples/groovy-dsl/gradlew
vendored
3
.github/workflow-samples/groovy-dsl/gradlew
vendored
@@ -86,8 +86,7 @@ done
|
||||
# shellcheck disable=SC2034
|
||||
APP_BASE_NAME=${0##*/}
|
||||
# Discard cd standard output in case $CDPATH is set (https://github.com/gradle/gradle/issues/25036)
|
||||
APP_HOME=$( cd -P "${APP_HOME:-./}" > /dev/null && printf '%s
|
||||
' "$PWD" ) || exit
|
||||
APP_HOME=$( cd -P "${APP_HOME:-./}" > /dev/null && printf '%s\n' "$PWD" ) || exit
|
||||
|
||||
# Use the maximum available, or set MAX_FD != -1 to use that value.
|
||||
MAX_FD=maximum
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
plugins {
|
||||
id "com.gradle.develocity" version "3.19"
|
||||
id "com.gradle.common-custom-user-data-gradle-plugin" version "2.0.2"
|
||||
id "com.gradle.develocity" version "3.19.1"
|
||||
id "com.gradle.common-custom-user-data-gradle-plugin" version "2.1"
|
||||
}
|
||||
|
||||
develocity {
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
distributionBase=GRADLE_USER_HOME
|
||||
distributionPath=wrapper/dists
|
||||
distributionSha256Sum=f397b287023acdba1e9f6fc5ea72d22dd63669d59ed4a289a29b1a76eee151c6
|
||||
distributionUrl=https\://services.gradle.org/distributions/gradle-8.11.1-bin.zip
|
||||
distributionSha256Sum=8d97a97984f6cbd2b85fe4c60a743440a347544bf18818048e611f5288d46c94
|
||||
distributionUrl=https\://services.gradle.org/distributions/gradle-8.12.1-bin.zip
|
||||
networkTimeout=10000
|
||||
validateDistributionUrl=true
|
||||
zipStoreBase=GRADLE_USER_HOME
|
||||
|
||||
@@ -86,8 +86,7 @@ done
|
||||
# shellcheck disable=SC2034
|
||||
APP_BASE_NAME=${0##*/}
|
||||
# Discard cd standard output in case $CDPATH is set (https://github.com/gradle/gradle/issues/25036)
|
||||
APP_HOME=$( cd -P "${APP_HOME:-./}" > /dev/null && printf '%s
|
||||
' "$PWD" ) || exit
|
||||
APP_HOME=$( cd -P "${APP_HOME:-./}" > /dev/null && printf '%s\n' "$PWD" ) || exit
|
||||
|
||||
# Use the maximum available, or set MAX_FD != -1 to use that value.
|
||||
MAX_FD=maximum
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
distributionBase=GRADLE_USER_HOME
|
||||
distributionPath=wrapper/dists
|
||||
distributionSha256Sum=f397b287023acdba1e9f6fc5ea72d22dd63669d59ed4a289a29b1a76eee151c6
|
||||
distributionUrl=https\://services.gradle.org/distributions/gradle-8.11.1-bin.zip
|
||||
distributionSha256Sum=8d97a97984f6cbd2b85fe4c60a743440a347544bf18818048e611f5288d46c94
|
||||
distributionUrl=https\://services.gradle.org/distributions/gradle-8.12.1-bin.zip
|
||||
networkTimeout=10000
|
||||
validateDistributionUrl=true
|
||||
zipStoreBase=GRADLE_USER_HOME
|
||||
|
||||
3
.github/workflow-samples/kotlin-dsl/gradlew
vendored
3
.github/workflow-samples/kotlin-dsl/gradlew
vendored
@@ -86,8 +86,7 @@ done
|
||||
# shellcheck disable=SC2034
|
||||
APP_BASE_NAME=${0##*/}
|
||||
# Discard cd standard output in case $CDPATH is set (https://github.com/gradle/gradle/issues/25036)
|
||||
APP_HOME=$( cd -P "${APP_HOME:-./}" > /dev/null && printf '%s
|
||||
' "$PWD" ) || exit
|
||||
APP_HOME=$( cd -P "${APP_HOME:-./}" > /dev/null && printf '%s\n' "$PWD" ) || exit
|
||||
|
||||
# Use the maximum available, or set MAX_FD != -1 to use that value.
|
||||
MAX_FD=maximum
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
plugins {
|
||||
id("com.gradle.develocity") version "3.19"
|
||||
id("com.gradle.common-custom-user-data-gradle-plugin") version "2.0.2"
|
||||
id("com.gradle.develocity") version "3.19.1"
|
||||
id("com.gradle.common-custom-user-data-gradle-plugin") version "2.1"
|
||||
}
|
||||
|
||||
develocity {
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
plugins {
|
||||
id "com.gradle.develocity" version "3.19"
|
||||
id "com.gradle.develocity" version "3.19.1"
|
||||
}
|
||||
|
||||
develocity {
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
plugins {
|
||||
id "com.gradle.develocity" version "3.19"
|
||||
id "com.gradle.develocity" version "3.19.1"
|
||||
}
|
||||
|
||||
develocity {
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
plugins {
|
||||
id "com.gradle.develocity" version "3.19"
|
||||
id "com.gradle.develocity" version "3.19.1"
|
||||
}
|
||||
|
||||
develocity {
|
||||
|
||||
22
.github/workflows/ci-check-and-unit-test.yml
vendored
22
.github/workflows/ci-check-and-unit-test.yml
vendored
@@ -15,29 +15,43 @@ permissions:
|
||||
jobs:
|
||||
check-format-and-unit-test:
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
steps:
|
||||
- name: Checkout sources
|
||||
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
|
||||
- uses: actions/setup-node@39370e3970a6d050c480ffad4ff0ed4d3fdee5af # v4.1.0
|
||||
- uses: actions/setup-node@1d0ff469b7ec7b3cb9d8673fde0c81c44821de2a # v4.2.0
|
||||
with:
|
||||
node-version: 20
|
||||
cache: npm
|
||||
cache-dependency-path: sources/package-lock.json
|
||||
- name: Setup Gradle
|
||||
# Use a released version to avoid breakages
|
||||
uses: gradle/actions/setup-gradle@cc4fc85e6b35bafd578d5ffbc76a5518407e1af0 # v4.2.1
|
||||
uses: gradle/actions/setup-gradle@0bdd871935719febd78681f197cd39af5b6e16a6 # v4.2.2
|
||||
env:
|
||||
ALLOWED_GRADLE_WRAPPER_CHECKSUMS: e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855 # Invalid wrapper jar used for testing
|
||||
with:
|
||||
gradle-version: "8.11.1"
|
||||
gradle-version: "8.12.1"
|
||||
|
||||
- name: Install npm dependencies
|
||||
run: |
|
||||
npm clean-install
|
||||
working-directory: sources
|
||||
|
||||
- name: Check formatting and compile
|
||||
run: |
|
||||
npm clean-install
|
||||
npm run check
|
||||
npm run compile
|
||||
working-directory: sources
|
||||
env:
|
||||
NODE_OPTIONS: '-r @gradle/develocity-agent/preload'
|
||||
DEVELOCITY_URL: 'https://ge.solutions-team.gradle.com'
|
||||
DEVELOCITY_ACCESS_KEY: '${{ secrets.DV_SOLUTIONS_ACCESS_KEY }}'
|
||||
|
||||
- name: Run unit tests
|
||||
run: |
|
||||
npm test
|
||||
working-directory: sources
|
||||
env:
|
||||
NODE_OPTIONS: '-r @gradle/develocity-agent/preload'
|
||||
DEVELOCITY_URL: 'https://ge.solutions-team.gradle.com'
|
||||
DEVELOCITY_ACCESS_KEY: '${{ secrets.DV_SOLUTIONS_ACCESS_KEY }}'
|
||||
|
||||
@@ -21,7 +21,7 @@ jobs:
|
||||
|
||||
- name: Get changed files
|
||||
id: changed-files
|
||||
uses: tj-actions/changed-files@bab30c2299617f6615ec02a68b9a40d10bd21366 # v45.0.5
|
||||
uses: tj-actions/changed-files@d6e91a2266cdb9d62096cebf1e8546899c6aa18f # v45.0.6
|
||||
with:
|
||||
files: |
|
||||
dist/**
|
||||
|
||||
4
.github/workflows/ci-codeql.yml
vendored
4
.github/workflows/ci-codeql.yml
vendored
@@ -35,7 +35,7 @@ jobs:
|
||||
|
||||
# Initializes the CodeQL tools for scanning.
|
||||
- name: Initialize CodeQL
|
||||
uses: github/codeql-action/init@df409f7d9260372bd5f19e5b04e83cb3c43714ae # v3.27.9
|
||||
uses: github/codeql-action/init@17a820bf2e43b47be2c72b39cc905417bc1ab6d0 # v3.28.6
|
||||
with:
|
||||
languages: ${{ matrix.language }}
|
||||
config: |
|
||||
@@ -43,4 +43,4 @@ jobs:
|
||||
- sources/src
|
||||
|
||||
- name: Perform CodeQL Analysis
|
||||
uses: github/codeql-action/analyze@df409f7d9260372bd5f19e5b04e83cb3c43714ae # v3.27.9
|
||||
uses: github/codeql-action/analyze@17a820bf2e43b47be2c72b39cc905417bc1ab6d0 # v3.28.6
|
||||
|
||||
4
.github/workflows/ci-init-script-check.yml
vendored
4
.github/workflows/ci-init-script-check.yml
vendored
@@ -24,13 +24,13 @@ jobs:
|
||||
- name: Checkout sources
|
||||
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
|
||||
- name: Setup Java
|
||||
uses: actions/setup-java@8df1039502a15bceb9433410b1a100fbe190c53b # v4.5.0
|
||||
uses: actions/setup-java@7a6d8a8234af8eb26422e24e3006232cccaa061b # v4.6.0
|
||||
with:
|
||||
distribution: temurin
|
||||
java-version: 11
|
||||
- name: Setup Gradle
|
||||
# Use a released version to avoid breakages
|
||||
uses: gradle/actions/setup-gradle@cc4fc85e6b35bafd578d5ffbc76a5518407e1af0 # v4.2.1
|
||||
uses: gradle/actions/setup-gradle@0bdd871935719febd78681f197cd39af5b6e16a6 # v4.2.2
|
||||
env:
|
||||
ALLOWED_GRADLE_WRAPPER_CHECKSUMS: e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855 # Invalid wrapper jar used for testing
|
||||
- name: Run integration tests
|
||||
|
||||
2
.github/workflows/ci-integ-test-full.yml
vendored
2
.github/workflows/ci-integ-test-full.yml
vendored
@@ -3,6 +3,8 @@ name: CI-integ-test-full
|
||||
on:
|
||||
workflow_dispatch:
|
||||
push:
|
||||
branches:
|
||||
- 'main'
|
||||
paths:
|
||||
- 'dist/**'
|
||||
|
||||
|
||||
4
.github/workflows/ci-ossf-scorecard.yml
vendored
4
.github/workflows/ci-ossf-scorecard.yml
vendored
@@ -44,7 +44,7 @@ jobs:
|
||||
# Upload the results as artifacts (optional). Commenting out will disable uploads of run results in SARIF
|
||||
# format to the repository Actions tab.
|
||||
- name: 'Upload artifact'
|
||||
uses: actions/upload-artifact@b4b15b8c7c6ac21ea08fcf65892d2ee8f75cf882 # v4.4.3
|
||||
uses: actions/upload-artifact@65c4c4a1ddee5b72f698fdd19549f0f0fb45cf08 # v4.6.0
|
||||
with:
|
||||
name: SARIF file
|
||||
path: results.sarif
|
||||
@@ -52,6 +52,6 @@ jobs:
|
||||
|
||||
# Upload the results to GitHub's code scanning dashboard.
|
||||
- name: 'Upload to code-scanning'
|
||||
uses: github/codeql-action/upload-sarif@df409f7d9260372bd5f19e5b04e83cb3c43714ae # v3.27.9
|
||||
uses: github/codeql-action/upload-sarif@17a820bf2e43b47be2c72b39cc905417bc1ab6d0 # v3.28.6
|
||||
with:
|
||||
sarif_file: results.sarif
|
||||
|
||||
17
.github/workflows/ci-update-dist.yml
vendored
17
.github/workflows/ci-update-dist.yml
vendored
@@ -5,6 +5,7 @@ on:
|
||||
push:
|
||||
branches:
|
||||
- 'main'
|
||||
- 'prerelease/**'
|
||||
- 'release/**'
|
||||
paths-ignore:
|
||||
- 'dist/**'
|
||||
@@ -27,19 +28,27 @@ jobs:
|
||||
token: ${{ secrets.BOT_GITHUB_TOKEN }}
|
||||
|
||||
- name: Set up Node.js
|
||||
uses: actions/setup-node@39370e3970a6d050c480ffad4ff0ed4d3fdee5af # v4.1.0
|
||||
uses: actions/setup-node@1d0ff469b7ec7b3cb9d8673fde0c81c44821de2a # v4.2.0
|
||||
with:
|
||||
node-version: 20
|
||||
cache: npm
|
||||
cache-dependency-path: sources/package-lock.json
|
||||
|
||||
- name: Build distribution
|
||||
- name: Install npm dependencies
|
||||
run: |
|
||||
npm clean-install
|
||||
working-directory: sources
|
||||
|
||||
- name: Build distribution
|
||||
run: |
|
||||
npm run check
|
||||
npm run compile
|
||||
working-directory: sources
|
||||
|
||||
env:
|
||||
NODE_OPTIONS: '-r @gradle/develocity-agent/preload'
|
||||
DEVELOCITY_URL: 'https://ge.solutions-team.gradle.com'
|
||||
DEVELOCITY_ACCESS_KEY: '${{ secrets.DV_SOLUTIONS_ACCESS_KEY }}'
|
||||
|
||||
- name: Copy the generated sources/dist directory to the top-level dist
|
||||
run: |
|
||||
cp -r sources/dist .
|
||||
@@ -48,7 +57,7 @@ jobs:
|
||||
# Important: The push event will not trigger any other workflows, see
|
||||
# https://github.com/stefanzweifel/git-auto-commit-action?tab=readme-ov-file#commits-made-by-this-action-do-not-trigger-new-workflow-runs
|
||||
- name: Commit & push changes
|
||||
uses: stefanzweifel/git-auto-commit-action@8621497c8c39c72f3e2a999a26b4ca1b5058a842 # v5.0.1
|
||||
uses: stefanzweifel/git-auto-commit-action@e348103e9026cc0eee72ae06630dbe30c8bf7a79 # v5.1.0
|
||||
with:
|
||||
commit_message: '[bot] Update dist directory'
|
||||
file_pattern: dist
|
||||
|
||||
2
.github/workflows/ci-validate-wrappers.yml
vendored
2
.github/workflows/ci-validate-wrappers.yml
vendored
@@ -12,6 +12,6 @@ jobs:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
|
||||
- uses: gradle/actions/wrapper-validation@cc4fc85e6b35bafd578d5ffbc76a5518407e1af0 # v4.2.1
|
||||
- uses: gradle/actions/wrapper-validation@0bdd871935719febd78681f197cd39af5b6e16a6 # v4.2.2
|
||||
with:
|
||||
allow-checksums: e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855
|
||||
|
||||
@@ -153,3 +153,40 @@ jobs:
|
||||
ls -l dependency-graph-reports
|
||||
exit 1
|
||||
fi
|
||||
|
||||
dependency-graph-generate-submit-and-upload:
|
||||
permissions:
|
||||
contents: write
|
||||
runs-on: "ubuntu-latest"
|
||||
steps:
|
||||
- name: Checkout sources
|
||||
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
|
||||
- name: Initialize integ-test
|
||||
uses: ./.github/actions/init-integ-test
|
||||
|
||||
- name: Setup Gradle for dependency-graph generate
|
||||
uses: ./setup-gradle
|
||||
with:
|
||||
dependency-graph: generate-submit-and-upload
|
||||
- name: Run gradle build
|
||||
id: gradle-build
|
||||
run: ./gradlew build
|
||||
working-directory: .github/workflow-samples/groovy-dsl
|
||||
|
||||
dependency-graph-generate-submit-and-upload-check:
|
||||
needs: [dependency-graph-generate-submit-and-upload]
|
||||
runs-on: "ubuntu-latest"
|
||||
steps:
|
||||
- name: Download dependency-graph artifact
|
||||
uses: actions/download-artifact@v4
|
||||
with:
|
||||
path: downloaded-dependency-graphs
|
||||
pattern: dependency-graph_*dependency-graph-generate-submit-and-upload.json
|
||||
- name: Check for downloaded dependency graphs
|
||||
shell: bash
|
||||
run: |
|
||||
ls -A "${{ github.workspace }}/downloaded-dependency-graphs"
|
||||
if [ -z "$(ls -A "${{ github.workspace }}/downloaded-dependency-graphs")" ]; then
|
||||
echo "No dependency graph files found"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
@@ -65,12 +65,12 @@ jobs:
|
||||
uses: ./.github/actions/init-integ-test
|
||||
|
||||
- name: Setup Java 20
|
||||
uses: actions/setup-java@8df1039502a15bceb9433410b1a100fbe190c53b # v4.5.0
|
||||
uses: actions/setup-java@7a6d8a8234af8eb26422e24e3006232cccaa061b # v4.6.0
|
||||
with:
|
||||
distribution: 'temurin'
|
||||
java-version: 20
|
||||
- name: Setup Java 16
|
||||
uses: actions/setup-java@8df1039502a15bceb9433410b1a100fbe190c53b # v4.5.0
|
||||
uses: actions/setup-java@7a6d8a8234af8eb26422e24e3006232cccaa061b # v4.6.0
|
||||
with:
|
||||
distribution: 'temurin'
|
||||
java-version: 16
|
||||
|
||||
@@ -29,18 +29,18 @@ jobs:
|
||||
DEVELOCITY_INJECTION_ENABLED: true
|
||||
DEVELOCITY_URL: https://ge.solutions-team.gradle.com
|
||||
DEVELOCITY_PLUGIN_VERSION: ${{ matrix.plugin-version }}
|
||||
DEVELOCITY_CCUD_PLUGIN_VERSION: '2.0.2'
|
||||
DEVELOCITY_CCUD_PLUGIN_VERSION: '2.1'
|
||||
${{matrix.accessKeyEnv}}: ${{ secrets.DEVELOCITY_ACCESS_KEY }}
|
||||
strategy:
|
||||
fail-fast: false
|
||||
matrix:
|
||||
gradle: [current, 7.6.2, 6.9.4, 5.6.4]
|
||||
os: ${{fromJSON(inputs.runner-os)}}
|
||||
plugin-version: [3.16.2, 3.19]
|
||||
plugin-version: [3.16.2, 3.19.1]
|
||||
include:
|
||||
- plugin-version: 3.16.2
|
||||
accessKeyEnv: GRADLE_ENTERPRISE_ACCESS_KEY
|
||||
- plugin-version: 3.19
|
||||
- plugin-version: 3.19.1
|
||||
accessKeyEnv: DEVELOCITY_ACCESS_KEY
|
||||
|
||||
runs-on: ${{ matrix.os }}
|
||||
@@ -76,13 +76,13 @@ jobs:
|
||||
DEVELOCITY_INJECTION_ENABLED: true
|
||||
DEVELOCITY_URL: 'https://ge.solutions-team.gradle.com'
|
||||
DEVELOCITY_PLUGIN_VERSION: ${{ matrix.plugin-version }}
|
||||
DEVELOCITY_CCUD_PLUGIN_VERSION: '2.0.2'
|
||||
DEVELOCITY_CCUD_PLUGIN_VERSION: '2.1'
|
||||
strategy:
|
||||
fail-fast: false
|
||||
matrix:
|
||||
gradle: [current, 7.6.2, 6.9.4, 5.6.4]
|
||||
os: ${{fromJSON(inputs.runner-os)}}
|
||||
plugin-version: [3.16.2, 3.19]
|
||||
plugin-version: [3.16.2, 3.19.1]
|
||||
runs-on: ${{ matrix.os }}
|
||||
steps:
|
||||
- name: Checkout sources
|
||||
@@ -117,7 +117,7 @@ jobs:
|
||||
DEVELOCITY_INJECTION_ENABLED: true
|
||||
DEVELOCITY_URL: 'https://localhost:3333/'
|
||||
DEVELOCITY_PLUGIN_VERSION: ${{ matrix.plugin-version }}
|
||||
DEVELOCITY_CCUD_PLUGIN_VERSION: '2.0.2'
|
||||
DEVELOCITY_CCUD_PLUGIN_VERSION: '2.1'
|
||||
# Access key also set as an env var, we want to check it does not leak
|
||||
GRADLE_ENTERPRISE_ACCESS_KEY: ${{ secrets.DEVELOCITY_ACCESS_KEY }}
|
||||
DEVELOCITY_ACCESS_KEY: ${{ secrets.DEVELOCITY_ACCESS_KEY }}
|
||||
@@ -126,7 +126,7 @@ jobs:
|
||||
matrix:
|
||||
gradle: [ current, 7.6.2, 6.9.4, 5.6.4 ]
|
||||
os: ${{fromJSON(inputs.runner-os)}}
|
||||
plugin-version: [ 3.16.2, 3.19 ]
|
||||
plugin-version: [ 3.16.2, 3.19.1 ]
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Checkout sources
|
||||
@@ -157,7 +157,7 @@ jobs:
|
||||
matrix:
|
||||
gradle: [ current, 7.6.2, 6.9.4, 5.6.4 ]
|
||||
os: ${{fromJSON(inputs.runner-os)}}
|
||||
plugin-version: [ 3.16.2, 3.19 ]
|
||||
plugin-version: [ 3.16.2, 3.19.1 ]
|
||||
runs-on: ${{ matrix.os }}
|
||||
steps:
|
||||
- name: Checkout sources
|
||||
|
||||
@@ -78,7 +78,7 @@ jobs:
|
||||
strategy:
|
||||
fail-fast: false
|
||||
matrix:
|
||||
gradle: ["8.11.1", 8.9, 8.1, 7.6.4, 6.9.4, 5.6.4, 4.10.3, 3.5.1]
|
||||
gradle: ["8.13-milestone-2", "8.12", "8.12-rc-1", 8.9, 8.1, 7.6.4, 6.9.4, 5.6.4, 4.10.3, 3.5.1]
|
||||
os: ${{fromJSON(inputs.runner-os)}}
|
||||
include:
|
||||
- java-version: 11
|
||||
@@ -100,7 +100,7 @@ jobs:
|
||||
uses: ./.github/actions/init-integ-test
|
||||
|
||||
- name: Setup Java
|
||||
uses: actions/setup-java@8df1039502a15bceb9433410b1a100fbe190c53b # v4.5.0
|
||||
uses: actions/setup-java@7a6d8a8234af8eb26422e24e3006232cccaa061b # v4.6.0
|
||||
with:
|
||||
distribution: temurin
|
||||
java-version: ${{ matrix.java-version }}
|
||||
|
||||
4
.github/workflows/update-checksums-file.yml
vendored
4
.github/workflows/update-checksums-file.yml
vendored
@@ -22,7 +22,7 @@ jobs:
|
||||
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
|
||||
|
||||
- name: Set up Node.js
|
||||
uses: actions/setup-node@39370e3970a6d050c480ffad4ff0ed4d3fdee5af # v4.1.0
|
||||
uses: actions/setup-node@1d0ff469b7ec7b3cb9d8673fde0c81c44821de2a # v4.2.0
|
||||
with:
|
||||
node-version: 20
|
||||
cache: npm
|
||||
@@ -39,7 +39,7 @@ jobs:
|
||||
|
||||
# If there are no changes, this action will not create a pull request
|
||||
- name: Create or update pull request
|
||||
uses: peter-evans/create-pull-request@5e914681df9dc83aa4e4905692ca88beb2f9e91f # v7.0.5
|
||||
uses: peter-evans/create-pull-request@67ccf781d68cd99b580ae25a5c18a1cc84ffff1f # v7.0.6
|
||||
with:
|
||||
branch: bot/wrapper-checksums-update
|
||||
commit-message: Update known wrapper checksums
|
||||
|
||||
10
build
10
build
@@ -2,6 +2,12 @@
|
||||
|
||||
cd sources
|
||||
|
||||
if [[ -f ~/.gradle/develocity/keys.properties ]]; then
|
||||
export NODE_OPTIONS='-r @gradle/develocity-agent/preload'
|
||||
export DEVELOCITY_URL=https://ge.solutions-team.gradle.com
|
||||
export DEVELOCITY_ACCESS_KEY=$(paste -sd ';' ~/.gradle/develocity/keys.properties)
|
||||
fi
|
||||
|
||||
case "$1" in
|
||||
all)
|
||||
npm run all
|
||||
@@ -30,6 +36,10 @@ case "$1" in
|
||||
npm clean-install
|
||||
npm run build
|
||||
;;
|
||||
test)
|
||||
shift
|
||||
npm test -- $@
|
||||
;;
|
||||
*)
|
||||
npm run build
|
||||
;;
|
||||
|
||||
@@ -96,17 +96,20 @@ inputs:
|
||||
# Dependency Graph configuration
|
||||
dependency-graph:
|
||||
description: |
|
||||
Specifies how the dependency-graph should be handled by this action. By default a dependency-graph will be generated and submitted.
|
||||
Specifies how the dependency-graph should be handled by this action.
|
||||
By default a dependency-graph will be generated, submitted to the dependency-submission API, and saved as a workflow artifact.
|
||||
Valid values are:
|
||||
'generate-and-submit' (default): Generates a dependency graph for the project and submits it in the same Job.
|
||||
'generate-and-upload': Generates a dependency graph for the project and saves it as a workflow artifact.
|
||||
'generate-and-submit': Generates a dependency graph for the project and submits it in the same Job.
|
||||
'generate-submit-and-upload (default)': As per 'generate-and-submit', but also saves the dependency graph as a workflow artifact.
|
||||
'generate-and-upload': Generates a dependency graph for the project and saves it as a workflow artifact. Does not submit it to the repository.
|
||||
'download-and-submit': Retrieves a previously saved dependency-graph and submits it to the repository.
|
||||
|
||||
Use `generate-and-submit` if you prefer not to save the dependency-graph as a workflow artifact.
|
||||
The `generate-and-upload` and `download-and-submit` options are designed to be used in an untrusted workflow scenario,
|
||||
where the workflow generating the dependency-graph cannot (or should not) be given the `contents: write` permissions
|
||||
required to submit via the Dependency Submission API.
|
||||
required: false
|
||||
default: 'generate-and-submit'
|
||||
default: 'generate-submit-and-upload'
|
||||
|
||||
dependency-graph-report-dir:
|
||||
description: |
|
||||
@@ -147,7 +150,6 @@ inputs:
|
||||
artifact-retention-days:
|
||||
description: Specifies the number of days to retain any artifacts generated by the action. If not set, the default retention settings for the repository will apply.
|
||||
required: false
|
||||
default: 1
|
||||
|
||||
# Build Scan configuration
|
||||
build-scan-publish:
|
||||
|
||||
2793
dist/dependency-submission/main/index.js
vendored
2793
dist/dependency-submission/main/index.js
vendored
File diff suppressed because one or more lines are too long
2
dist/dependency-submission/main/index.js.map
vendored
2
dist/dependency-submission/main/index.js.map
vendored
File diff suppressed because one or more lines are too long
2748
dist/dependency-submission/post/index.js
vendored
2748
dist/dependency-submission/post/index.js
vendored
File diff suppressed because one or more lines are too long
2
dist/dependency-submission/post/index.js.map
vendored
2
dist/dependency-submission/post/index.js.map
vendored
File diff suppressed because one or more lines are too long
2793
dist/setup-gradle/main/index.js
vendored
2793
dist/setup-gradle/main/index.js
vendored
File diff suppressed because one or more lines are too long
2
dist/setup-gradle/main/index.js.map
vendored
2
dist/setup-gradle/main/index.js.map
vendored
File diff suppressed because one or more lines are too long
2793
dist/setup-gradle/post/index.js
vendored
2793
dist/setup-gradle/post/index.js
vendored
File diff suppressed because one or more lines are too long
2
dist/setup-gradle/post/index.js.map
vendored
2
dist/setup-gradle/post/index.js.map
vendored
File diff suppressed because one or more lines are too long
2396
dist/wrapper-validation/main/index.js
vendored
2396
dist/wrapper-validation/main/index.js
vendored
File diff suppressed because one or more lines are too long
2
dist/wrapper-validation/main/index.js.map
vendored
2
dist/wrapper-validation/main/index.js.map
vendored
File diff suppressed because one or more lines are too long
@@ -103,6 +103,9 @@ In some cases, the default action configuration will not be sufficient, and addi
|
||||
# Do not attempt to submit the dependency-graph. Save it as a workflow artifact.
|
||||
dependency-graph: generate-and-upload
|
||||
|
||||
# Change the number of days that workflow artifacts are retained. (Default is 30 days).
|
||||
artifact-retention-days: 5
|
||||
|
||||
# Specify the location where dependency graph files will be generated.
|
||||
dependency-graph-report-dir: custom-report-dir
|
||||
|
||||
@@ -118,6 +121,29 @@ The `GitHub Dependency Graph Gradle Plugin` can be further
|
||||
These will be automatically set by the `dependency-submission` action, but you may override these values
|
||||
by setting them explicitly in your workflow file.
|
||||
|
||||
### Reducing storage costs for saved dependency graph artifacts
|
||||
|
||||
By default, the dependency graph that is generated is stored as a workflow artifact.
|
||||
To reduce storage costs for these artifacts, you can:
|
||||
|
||||
1. Set the `artifact-retention-days`:
|
||||
|
||||
```yaml
|
||||
- name: Generate dependency graph but only store workflow artifacts for 1 day
|
||||
uses: gradle/actions/dependency-submission@v4
|
||||
with:
|
||||
artifact-retention-days: 1 # Default is 30 days or as configured for repository
|
||||
```
|
||||
|
||||
2. Disable storing dependency-graph artifacts using `generate-and-submit`
|
||||
|
||||
```yaml
|
||||
- name: Generate and submit dependency graph but do not store as workflow artifact
|
||||
uses: gradle/actions/dependency-submission@v4
|
||||
with:
|
||||
dependency-graph: 'generate-and-submit' # Default value is 'generate-submit-and-upload'
|
||||
```
|
||||
|
||||
# Resolving a dependency vulnerability
|
||||
|
||||
## Finding the source of a dependency vulnerability
|
||||
@@ -295,12 +321,19 @@ The GitHub [dependency-review-action](https://github.com/actions/dependency-revi
|
||||
understand dependency changes (and the security impact of these changes) for a pull request,
|
||||
by comparing the dependency graph for the pull-request with that of the HEAD commit.
|
||||
|
||||
Example of a pull request workflow that executes a build for a pull request and runs the `dependency-review-action`:
|
||||
Integrating the Dependency Review Action requires 2 changes to your workflows:
|
||||
|
||||
#### 1. Add a `pull_request` trigger to your existing Dependency Submission workflow.
|
||||
|
||||
In order to perform Dependency Review on a pull request, the dependency graph must be submitted for the pull request.
|
||||
To do this, simply add a `pull_request` trigger to your existing dependency submission workflow.
|
||||
|
||||
```yaml
|
||||
name: Dependency review for pull requests
|
||||
name: Dependency Submission
|
||||
|
||||
on:
|
||||
push:
|
||||
branches: [ 'main' ]
|
||||
pull_request:
|
||||
|
||||
permissions:
|
||||
@@ -318,11 +351,37 @@ jobs:
|
||||
|
||||
- name: Generate and submit dependency graph
|
||||
uses: gradle/actions/dependency-submission@v4
|
||||
|
||||
- name: Perform dependency review
|
||||
uses: actions/dependency-review-action@v4
|
||||
```
|
||||
|
||||
#### 2. Add a dedicated Dependency Review workflow
|
||||
|
||||
The Dependency Review workflow will be triggered directly on `pull_request`, but will wait until the dependency graph results are
|
||||
submitted before the dependency review can complete. The period to wait is controlled by the `retry-on-snapshot-warnings` input parameters.
|
||||
|
||||
Here's an example of a separate "Dependency Review" workflow that will wait up to 10 minutes for dependency submission to complete.
|
||||
|
||||
```yaml
|
||||
name: Dependency Review
|
||||
|
||||
on:
|
||||
pull_request:
|
||||
|
||||
permissions:
|
||||
contents: read
|
||||
|
||||
jobs:
|
||||
dependency-review:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: 'Dependency Review'
|
||||
uses: actions/dependency-review-action@v4
|
||||
with:
|
||||
retry-on-snapshot-warnings: true
|
||||
retry-on-snapshot-warnings-timeout: 600
|
||||
```
|
||||
|
||||
The `retry-on-snapshot-warnings-timeout` (in seconds) needs to be long enough to allow the modified dependency-submission workflow to complete.
|
||||
|
||||
## Usage with pull requests from public forked repositories
|
||||
|
||||
This `contents: write` permission is [not available for any workflow that is triggered by a pull request submitted from a public forked repository](https://docs.github.com/en/actions/security-guides/automatic-token-authentication#permissions-for-the-github_token).
|
||||
@@ -381,36 +440,6 @@ jobs:
|
||||
dependency-graph: download-and-submit # Download saved dependency-graph and submit
|
||||
```
|
||||
|
||||
### Integrating `dependency-review-action` for pull requests from public forked repositories
|
||||
|
||||
To integrate the `dependency-review-action` into the pull request workflows above, a third workflow file is required.
|
||||
This workflow will be triggered directly on `pull_request`, but will wait until the dependency graph results are
|
||||
submitted before the dependency review can complete. The period to wait is controlled by the `retry-on-snapshot-warnings` input parameters.
|
||||
|
||||
Here's an example of a separate "Dependency Review" workflow that will wait for 10 minutes for the above PR check workflow to complete.
|
||||
|
||||
```yaml
|
||||
name: dependency-review
|
||||
|
||||
on:
|
||||
pull_request:
|
||||
|
||||
permissions:
|
||||
contents: read
|
||||
|
||||
jobs:
|
||||
dependency-review:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: 'Dependency Review'
|
||||
uses: actions/dependency-review-action@v4
|
||||
with:
|
||||
retry-on-snapshot-warnings: true
|
||||
retry-on-snapshot-warnings-timeout: 600
|
||||
```
|
||||
|
||||
The `retry-on-snapshot-warnings-timeout` (in seconds) needs to be long enough to allow the entire `Generate and save dependency graph` and `Download and submit dependency graph` workflows (above) to complete.
|
||||
|
||||
# Gradle version compatibility
|
||||
|
||||
Dependency-graph generation is compatible with most versions of Gradle >= `5.2`, and is tested regularly against
|
||||
|
||||
@@ -221,7 +221,7 @@ jobs:
|
||||
- uses: gradle/actions/setup-gradle@v4
|
||||
with:
|
||||
gradle-version: 8.6
|
||||
cache-encryption-key: ${{ secrets.GradleEncryptionKey }}
|
||||
cache-encryption-key: ${{ secrets.GRADLE_ENCRYPTION_KEY }}
|
||||
- run: gradle build --configuration-cache
|
||||
```
|
||||
|
||||
@@ -438,6 +438,15 @@ so that a Job Summary is never generated, or so that a Job Summary is only gener
|
||||
add-job-summary: 'on-failure' # Valid values are 'always' (default), 'never', and 'on-failure'
|
||||
```
|
||||
|
||||
### Excluding specific Gradle builds from Job Summary
|
||||
|
||||
The Job Summary works by installing an init-script in Gradle User Home which will record details of any Gradle execution during the workflow.
|
||||
This means that any Gradle excecution sharing the same Gradle User Home will show up in the Job Summary, which may include Gradle executions
|
||||
run as part of integration testing.
|
||||
|
||||
To avoid having these test builds show up in the Job Summary, add the `GRADLE_ACTIONS_SKIP_BUILD_RESULT_CAPTURE=true` environment variable
|
||||
to the process that executes Gradle. This will stop the init-script from collecting any build results.
|
||||
|
||||
### Adding Job Summary as a Pull Request comment
|
||||
|
||||
It is sometimes more convenient to view the results of a GitHub Actions Job directly from the Pull Request that triggered
|
||||
@@ -718,20 +727,6 @@ A known exception to this is that Gradle `7.0`, `7.0.1`, and `7.0.2` are not sup
|
||||
|
||||
See [here](https://github.com/gradle/github-dependency-graph-gradle-plugin?tab=readme-ov-file#gradle-compatibility) for complete compatibility information.
|
||||
|
||||
### Reducing storage costs for saved dependency graph artifacts
|
||||
|
||||
When `generate` or `generate-and-submit` is used with the action, the dependency graph that is generated is stored as a workflow artifact.
|
||||
By default, these artifacts are retained for 30 days (or as configured for the repository).
|
||||
To reduce storage costs for these artifacts, you can set the `artifact-retention-days` value to a lower number.
|
||||
|
||||
```yaml
|
||||
- name: Generate dependency graph, but only retain artifact for one day
|
||||
uses: gradle/actions/setup-gradle@v4
|
||||
with:
|
||||
dependency-graph: generate
|
||||
artifact-retention-days: 1
|
||||
```
|
||||
|
||||
# Develocity Build Scan® integration
|
||||
|
||||
Publishing a Develocity Build Scan can be very helpful for Gradle builds run on GitHub Actions. Each Build Scan provides a
|
||||
@@ -849,7 +844,7 @@ Here's a minimal example:
|
||||
run: ./gradlew build
|
||||
```
|
||||
|
||||
This configuration will automatically apply `v3.19` of the [Develocity Gradle plugin](https://docs.gradle.com/develocity/gradle-plugin/), and publish build scans to https://develocity.your-server.com.
|
||||
This configuration will automatically apply `v3.19.1` of the [Develocity Gradle plugin](https://docs.gradle.com/develocity/gradle-plugin/), and publish build scans to https://develocity.your-server.com.
|
||||
|
||||
This example assumes that the `develocity.your-server.com` server allows anonymous publishing of build scans.
|
||||
In the likely scenario that your Develocity server requires authentication, you will also need to pass a valid [Develocity access key](https://docs.gradle.com/develocity/gradle-plugin/#via_environment_variable) taken from a secret:
|
||||
@@ -916,7 +911,7 @@ Here's an example using the env vars:
|
||||
DEVELOCITY_URL: https://develocity.your-server.com
|
||||
DEVELOCITY_ENFORCE_URL: true
|
||||
DEVELOCITY_PLUGIN_VERSION: "3.19"
|
||||
DEVELOCITY_CCUD_PLUGIN_VERSION: "2.0.2"
|
||||
DEVELOCITY_CCUD_PLUGIN_VERSION: "2.1"
|
||||
```
|
||||
|
||||
# Dependency verification
|
||||
|
||||
@@ -80,7 +80,7 @@ inputs:
|
||||
dependency-graph:
|
||||
description: |
|
||||
Specifies if a GitHub dependency snapshot should be generated for each Gradle build, and if so, how.
|
||||
Valid values are 'disabled' (default), 'generate', 'generate-and-submit', 'generate-and-upload', and 'download-and-submit'.
|
||||
Valid values are 'disabled' (default), 'generate', 'generate-and-submit', 'generate-submit-and-upload', 'generate-and-upload', and 'download-and-submit'.
|
||||
required: false
|
||||
default: 'disabled'
|
||||
|
||||
|
||||
@@ -1,3 +1,3 @@
|
||||
# Configuration file for asdf version manager
|
||||
nodejs 20.10.0
|
||||
gradle 8.11.1
|
||||
gradle 8.12.1
|
||||
|
||||
3021
sources/package-lock.json
generated
3021
sources/package-lock.json
generated
File diff suppressed because it is too large
Load Diff
@@ -32,15 +32,15 @@
|
||||
],
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"@actions/artifact": "2.1.11",
|
||||
"@actions/artifact": "2.2.1",
|
||||
"@actions/cache": "4.0.0",
|
||||
"@actions/core": "1.11.1",
|
||||
"@actions/exec": "1.1.1",
|
||||
"@actions/github": "6.0.0",
|
||||
"@actions/glob": "0.5.0",
|
||||
"@actions/http-client": "2.2.3",
|
||||
"@actions/tool-cache": "2.0.1",
|
||||
"@octokit/rest": "21.0.2",
|
||||
"@actions/tool-cache": "2.0.2",
|
||||
"@octokit/rest": "21.1.0",
|
||||
"@octokit/webhooks-types": "7.6.1",
|
||||
"cheerio": "^1.0.0",
|
||||
"semver": "7.6.3",
|
||||
@@ -50,15 +50,16 @@
|
||||
"which": "5.0.0"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@gradle/develocity-agent": "https://develocity-npm-pkgs.gradle.com/gradle-develocity-agent-0.9.0.tgz",
|
||||
"@types/jest": "29.5.14",
|
||||
"@types/node": "20.17.10",
|
||||
"@types/node": "20.17.16",
|
||||
"@types/unzipper": "0.10.10",
|
||||
"@types/which": "3.0.4",
|
||||
"@typescript-eslint/parser": "7.18.0",
|
||||
"@vercel/ncc": "0.38.3",
|
||||
"eslint": "8.57.1",
|
||||
"eslint-plugin-github": "5.1.4",
|
||||
"eslint-plugin-jest": "28.9.0",
|
||||
"eslint-plugin-github": "5.1.6",
|
||||
"eslint-plugin-jest": "28.11.0",
|
||||
"jest": "29.7.0",
|
||||
"js-yaml": "4.1.0",
|
||||
"nock": "13.5.6",
|
||||
@@ -66,6 +67,6 @@
|
||||
"patch-package": "8.0.0",
|
||||
"prettier": "3.4.2",
|
||||
"ts-jest": "29.2.5",
|
||||
"typescript": "5.7.2"
|
||||
"typescript": "5.7.3"
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
import * as fs from 'fs'
|
||||
import * as path from 'path'
|
||||
import {versionIsAtLeast} from './execution/gradle'
|
||||
|
||||
export interface BuildResult {
|
||||
get rootProjectName(): string
|
||||
@@ -32,6 +33,18 @@ export class BuildResults {
|
||||
const allHomes = this.results.map(buildResult => buildResult.gradleHomeDir)
|
||||
return Array.from(new Set(allHomes))
|
||||
}
|
||||
|
||||
highestGradleVersion(): string | null {
|
||||
if (this.results.length === 0) {
|
||||
return null
|
||||
}
|
||||
return this.results
|
||||
.map(result => result.gradleVersion)
|
||||
.reduce((maxVersion: string, currentVersion: string) => {
|
||||
if (!maxVersion) return currentVersion
|
||||
return versionIsAtLeast(currentVersion, maxVersion) ? currentVersion : maxVersion
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
export function loadBuildResults(): BuildResults {
|
||||
|
||||
@@ -4,6 +4,9 @@ import * as exec from '@actions/exec'
|
||||
import fs from 'fs'
|
||||
import path from 'path'
|
||||
import * as provisioner from '../execution/provision'
|
||||
import {BuildResult, BuildResults} from '../build-results'
|
||||
import {versionIsAtLeast} from '../execution/gradle'
|
||||
import {gradleWrapperScript} from '../execution/gradlew'
|
||||
|
||||
export class CacheCleaner {
|
||||
private readonly gradleUserHome: string
|
||||
@@ -21,13 +24,51 @@ export class CacheCleaner {
|
||||
return timestamp
|
||||
}
|
||||
|
||||
async forceCleanup(): Promise<void> {
|
||||
async forceCleanup(buildResults: BuildResults): Promise<void> {
|
||||
const executable = await this.gradleExecutableForCleanup(buildResults)
|
||||
const cleanTimestamp = core.getState('clean-timestamp')
|
||||
await this.forceCleanupFilesOlderThan(cleanTimestamp)
|
||||
await this.forceCleanupFilesOlderThan(cleanTimestamp, executable)
|
||||
}
|
||||
|
||||
/**
|
||||
* Attempt to use the newest Gradle version that was used to run a build, at least 8.11.
|
||||
*
|
||||
* This will avoid the need to provision a Gradle version for the cleanup when not necessary.
|
||||
*/
|
||||
private async gradleExecutableForCleanup(buildResults: BuildResults): Promise<string> {
|
||||
const preferredVersion = buildResults.highestGradleVersion()
|
||||
if (preferredVersion && versionIsAtLeast(preferredVersion, '8.11')) {
|
||||
try {
|
||||
const wrapperScripts = buildResults.results
|
||||
.map(result => this.findGradleWrapperScript(result))
|
||||
.filter(Boolean) as string[]
|
||||
|
||||
return await provisioner.provisionGradleWithVersionAtLeast(preferredVersion, wrapperScripts)
|
||||
} catch (e) {
|
||||
// Ignore the case where the preferred version cannot be located in https://services.gradle.org/versions/all.
|
||||
// This can happen for snapshot Gradle versions.
|
||||
core.info(
|
||||
`Failed to provision Gradle ${preferredVersion} for cache cleanup. Falling back to default version.`
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
// Fallback to the minimum version required for cache-cleanup
|
||||
return await provisioner.provisionGradleWithVersionAtLeast('8.11')
|
||||
}
|
||||
|
||||
private findGradleWrapperScript(result: BuildResult): string | null {
|
||||
try {
|
||||
const wrapperScript = gradleWrapperScript(result.rootProjectDir)
|
||||
return path.resolve(result.rootProjectDir, wrapperScript)
|
||||
} catch (error) {
|
||||
core.debug(`No Gradle Wrapper found for ${result.rootProjectName}: ${error}`)
|
||||
return null
|
||||
}
|
||||
}
|
||||
|
||||
// Visible for testing
|
||||
async forceCleanupFilesOlderThan(cleanTimestamp: string): Promise<void> {
|
||||
async forceCleanupFilesOlderThan(cleanTimestamp: string, executable: string): Promise<void> {
|
||||
// Run a dummy Gradle build to trigger cache cleanup
|
||||
const cleanupProjectDir = path.resolve(this.tmpDir, 'dummy-cleanup-project')
|
||||
fs.mkdirSync(cleanupProjectDir, {recursive: true})
|
||||
@@ -55,10 +96,6 @@ export class CacheCleaner {
|
||||
)
|
||||
fs.writeFileSync(path.resolve(cleanupProjectDir, 'build.gradle'), 'task("noop") {}')
|
||||
|
||||
// Gradle >= 8.11 required for cache cleanup
|
||||
// TODO: This is ineffective: we should be using the newest version of Gradle that ran a build, or a newer version if it's available on PATH.
|
||||
const executable = await provisioner.provisionGradleAtLeast('8.11.1')
|
||||
|
||||
await core.group('Executing Gradle to clean up caches', async () => {
|
||||
core.info(`Cleaning up caches last used before ${cleanTimestamp}`)
|
||||
await this.executeCleanupBuild(executable, cleanupProjectDir)
|
||||
@@ -76,6 +113,7 @@ export class CacheCleaner {
|
||||
'--no-scan',
|
||||
'--build-cache',
|
||||
'-DGITHUB_DEPENDENCY_GRAPH_ENABLED=false',
|
||||
'-DGRADLE_ACTIONS_SKIP_BUILD_RESULT_CAPTURE=true',
|
||||
'noop'
|
||||
]
|
||||
|
||||
|
||||
@@ -4,7 +4,7 @@ export const DEFAULT_CACHE_ENABLED_REASON = `[Cache was enabled](https://github.
|
||||
|
||||
export const DEFAULT_READONLY_REASON = `[Cache was read-only](https://github.com/gradle/actions/blob/main/docs/setup-gradle.md#using-the-cache-read-only). By default, the action will only write to the cache for Jobs running on the default branch.`
|
||||
|
||||
export const DEFAULT_DISABLED_REASON = `[Cache was disabled](https://github.com/gradle/actions/blob/main/docs/setup-gradle.md#disabling-caching) via action confiugration. Gradle User Home was not restored from or saved to the cache.`
|
||||
export const DEFAULT_DISABLED_REASON = `[Cache was disabled](https://github.com/gradle/actions/blob/main/docs/setup-gradle.md#disabling-caching) via action configuration. Gradle User Home was not restored from or saved to the cache.`
|
||||
|
||||
export const DEFAULT_WRITEONLY_REASON = `[Cache was set to write-only](https://github.com/gradle/actions/blob/main/docs/setup-gradle.md#using-the-cache-write-only) via action configuration. Gradle User Home was not restored from cache.`
|
||||
|
||||
|
||||
@@ -102,7 +102,7 @@ export async function save(
|
||||
cacheListener.setCacheCleanupDisabled(CLEANUP_DISABLED_DUE_TO_CONFIG_CACHE_HIT)
|
||||
} else if (cacheConfig.shouldPerformCacheCleanup(buildResults.anyFailed())) {
|
||||
cacheListener.setCacheCleanupEnabled()
|
||||
await performCacheCleanup(gradleUserHome)
|
||||
await performCacheCleanup(gradleUserHome, buildResults)
|
||||
} else {
|
||||
core.info('Not performing cache-cleanup due to build failure')
|
||||
cacheListener.setCacheCleanupDisabled(CLEANUP_DISABLED_DUE_TO_FAILURE)
|
||||
@@ -114,10 +114,10 @@ export async function save(
|
||||
})
|
||||
}
|
||||
|
||||
async function performCacheCleanup(gradleUserHome: string): Promise<void> {
|
||||
async function performCacheCleanup(gradleUserHome: string, buildResults: BuildResults): Promise<void> {
|
||||
const cacheCleaner = new CacheCleaner(gradleUserHome, process.env['RUNNER_TEMP']!)
|
||||
try {
|
||||
await cacheCleaner.forceCleanup()
|
||||
await cacheCleaner.forceCleanup(buildResults)
|
||||
} catch (e) {
|
||||
core.warning(`Cache cleanup failed. Will continue. ${String(e)}`)
|
||||
}
|
||||
|
||||
@@ -13,34 +13,37 @@ export function readResourceFileAsString(...paths: string[]): string {
|
||||
* @VisibleForTesting
|
||||
*/
|
||||
export function getPredefinedToolchains(): string | null {
|
||||
const javaHomeEnvs: string[] = []
|
||||
for (const javaHomeEnvsKey in process.env) {
|
||||
if (javaHomeEnvsKey.startsWith('JAVA_HOME_')) {
|
||||
javaHomeEnvs.push(javaHomeEnvsKey)
|
||||
}
|
||||
}
|
||||
// Get the version and path for each JAVA_HOME env var
|
||||
const javaHomeEnvs = Object.entries(process.env)
|
||||
.filter(([key]) => key.startsWith('JAVA_HOME_') && process.env[key])
|
||||
.map(([key, value]) => ({
|
||||
jdkVersion: key.match(/JAVA_HOME_(\d+)_/)?.[1] ?? null,
|
||||
jdkPath: value as string
|
||||
}))
|
||||
.filter(env => env.jdkVersion !== null)
|
||||
|
||||
if (javaHomeEnvs.length === 0) {
|
||||
return null
|
||||
}
|
||||
|
||||
// language=XML
|
||||
let toolchainsXml = `<?xml version="1.0" encoding="UTF-8"?>
|
||||
return `<?xml version="1.0" encoding="UTF-8"?>
|
||||
<toolchains>
|
||||
<!-- JDK Toolchains installed by default on GitHub-hosted runners -->
|
||||
`
|
||||
for (const javaHomeEnv of javaHomeEnvs) {
|
||||
const version = javaHomeEnv.match(/JAVA_HOME_(\d+)_/)?.[1]!
|
||||
toolchainsXml += ` <toolchain>
|
||||
${javaHomeEnvs
|
||||
.map(
|
||||
({jdkVersion, jdkPath}) => ` <toolchain>
|
||||
<type>jdk</type>
|
||||
<provides>
|
||||
<version>${version}</version>
|
||||
<version>${jdkVersion}</version>
|
||||
</provides>
|
||||
<configuration>
|
||||
<jdkHome>\${env.${javaHomeEnv}}</jdkHome>
|
||||
<jdkHome>${jdkPath}</jdkHome>
|
||||
</configuration>
|
||||
</toolchain>\n`
|
||||
}
|
||||
toolchainsXml += `</toolchains>\n`
|
||||
return toolchainsXml
|
||||
</toolchain>`
|
||||
)
|
||||
.join('\n')}
|
||||
</toolchains>\n`
|
||||
}
|
||||
|
||||
export function mergeToolchainContent(existingToolchainContent: string, preInstalledToolchains: string): string {
|
||||
|
||||
@@ -20,13 +20,15 @@ export class DependencyGraphConfig {
|
||||
return DependencyGraphOption.Generate
|
||||
case 'generate-and-submit':
|
||||
return DependencyGraphOption.GenerateAndSubmit
|
||||
case 'generate-submit-and-upload':
|
||||
return DependencyGraphOption.GenerateSubmitAndUpload
|
||||
case 'generate-and-upload':
|
||||
return DependencyGraphOption.GenerateAndUpload
|
||||
case 'download-and-submit':
|
||||
return DependencyGraphOption.DownloadAndSubmit
|
||||
}
|
||||
throw TypeError(
|
||||
`The value '${val}' is not valid for 'dependency-graph'. Valid values are: [disabled, generate, generate-and-submit, generate-and-upload, download-and-submit]. The default value is 'disabled'.`
|
||||
`The value '${val}' is not valid for 'dependency-graph'. Valid values are: [disabled, generate, generate-and-submit, generate-submit-and-upload, generate-and-upload, download-and-submit].`
|
||||
)
|
||||
}
|
||||
|
||||
@@ -96,6 +98,7 @@ export enum DependencyGraphOption {
|
||||
Disabled = 'disabled',
|
||||
Generate = 'generate',
|
||||
GenerateAndSubmit = 'generate-and-submit',
|
||||
GenerateSubmitAndUpload = 'generate-submit-and-upload',
|
||||
GenerateAndUpload = 'generate-and-upload',
|
||||
DownloadAndSubmit = 'download-and-submit'
|
||||
}
|
||||
|
||||
@@ -60,7 +60,10 @@ export async function complete(config: DependencyGraphConfig): Promise<void> {
|
||||
case DependencyGraphOption.DownloadAndSubmit: // Performed in setup
|
||||
return
|
||||
case DependencyGraphOption.GenerateAndSubmit:
|
||||
await findAndSubmitDependencyGraphs(config)
|
||||
await findAndSubmitDependencyGraphs(config, false)
|
||||
return
|
||||
case DependencyGraphOption.GenerateSubmitAndUpload:
|
||||
await findAndSubmitDependencyGraphs(config, true)
|
||||
return
|
||||
case DependencyGraphOption.GenerateAndUpload:
|
||||
await findAndUploadDependencyGraphs(config)
|
||||
@@ -83,7 +86,7 @@ async function downloadAndSubmitDependencyGraphs(config: DependencyGraphConfig):
|
||||
}
|
||||
}
|
||||
|
||||
async function findAndSubmitDependencyGraphs(config: DependencyGraphConfig): Promise<void> {
|
||||
async function findAndSubmitDependencyGraphs(config: DependencyGraphConfig, uploadAfterSubmit: boolean): Promise<void> {
|
||||
if (isRunningInActEnvironment()) {
|
||||
core.info('Dependency graph not supported in the ACT environment.')
|
||||
return
|
||||
@@ -100,6 +103,10 @@ async function findAndSubmitDependencyGraphs(config: DependencyGraphConfig): Pro
|
||||
}
|
||||
throw e
|
||||
}
|
||||
|
||||
if (uploadAfterSubmit) {
|
||||
await uploadDependencyGraphs(dependencyGraphFiles, config)
|
||||
}
|
||||
}
|
||||
|
||||
async function findAndUploadDependencyGraphs(config: DependencyGraphConfig): Promise<void> {
|
||||
|
||||
@@ -22,8 +22,8 @@ export async function setup(config: BuildScanConfig): Promise<void> {
|
||||
// except if they are defined in the configuration
|
||||
if (config.getBuildScanPublishEnabled()) {
|
||||
maybeExportVariable('DEVELOCITY_INJECTION_ENABLED', 'true')
|
||||
maybeExportVariable('DEVELOCITY_PLUGIN_VERSION', '3.19')
|
||||
maybeExportVariable('DEVELOCITY_CCUD_PLUGIN_VERSION', '2.0.2')
|
||||
maybeExportVariable('DEVELOCITY_PLUGIN_VERSION', '3.19.1')
|
||||
maybeExportVariable('DEVELOCITY_CCUD_PLUGIN_VERSION', '2.1')
|
||||
maybeExportVariable('DEVELOCITY_TERMS_OF_USE_URL', config.getBuildScanTermsOfUseUrl())
|
||||
maybeExportVariable('DEVELOCITY_TERMS_OF_USE_AGREE', config.getBuildScanTermsOfUseAgree())
|
||||
}
|
||||
|
||||
@@ -35,29 +35,54 @@ async function executeGradleBuild(executable: string | undefined, root: string,
|
||||
}
|
||||
|
||||
export function versionIsAtLeast(actualVersion: string, requiredVersion: string): boolean {
|
||||
const splitVersion = actualVersion.split('-')
|
||||
const coreVersion = splitVersion[0]
|
||||
const prerelease = splitVersion.length > 1
|
||||
|
||||
const actualSemver = semver.coerce(coreVersion)!
|
||||
const comparisonSemver = semver.coerce(requiredVersion)!
|
||||
|
||||
if (prerelease) {
|
||||
return semver.gt(actualSemver, comparisonSemver)
|
||||
} else {
|
||||
return semver.gte(actualSemver, comparisonSemver)
|
||||
if (actualVersion === requiredVersion) {
|
||||
return true
|
||||
}
|
||||
|
||||
const actual = new GradleVersion(actualVersion)
|
||||
const required = new GradleVersion(requiredVersion)
|
||||
|
||||
const actualSemver = semver.coerce(actual.versionPart)!
|
||||
const comparisonSemver = semver.coerce(required.versionPart)!
|
||||
|
||||
if (semver.gt(actualSemver, comparisonSemver)) {
|
||||
return true // Actual version is greater than comparison. So it's at least as new.
|
||||
}
|
||||
if (semver.lt(actualSemver, comparisonSemver)) {
|
||||
return false // Actual version is less than comparison. So it's not as new.
|
||||
}
|
||||
|
||||
// Actual and required version numbers are equal, so compare the other parts
|
||||
|
||||
if (actual.snapshotPart || required.snapshotPart) {
|
||||
if (actual.snapshotPart && !required.snapshotPart && !required.stagePart) {
|
||||
return false // Actual has a snapshot, but required is a plain version. Required is newer.
|
||||
}
|
||||
if (required.snapshotPart && !actual.snapshotPart && !actual.stagePart) {
|
||||
return true // Required has a snapshot, but actual is a plain version. Actual is newer.
|
||||
}
|
||||
|
||||
return false // Cannot compare case where both versions have a snapshot or stage
|
||||
}
|
||||
|
||||
if (actual.stagePart) {
|
||||
if (required.stagePart) {
|
||||
return actual.stagePart >= required.stagePart // Compare stages for newer
|
||||
}
|
||||
|
||||
return false // Actual has a stage, but required does not. So required is always newer.
|
||||
}
|
||||
|
||||
return true // Actual has no stage part or snapshot part, so it cannot be older than required.
|
||||
}
|
||||
|
||||
export async function findGradleVersionOnPath(): Promise<GradleExecutable | undefined> {
|
||||
const gradleExecutable = await which('gradle', {nothrow: true})
|
||||
if (gradleExecutable) {
|
||||
const output = await exec.getExecOutput(gradleExecutable, ['-v'], {silent: true})
|
||||
const version = parseGradleVersionFromOutput(output.stdout)
|
||||
return version ? new GradleExecutable(version, gradleExecutable) : undefined
|
||||
}
|
||||
export async function findGradleExecutableOnPath(): Promise<string | null> {
|
||||
return await which('gradle', {nothrow: true})
|
||||
}
|
||||
|
||||
return undefined
|
||||
export async function determineGradleVersion(gradleExecutable: string): Promise<string | undefined> {
|
||||
const output = await exec.getExecOutput(gradleExecutable, ['-v'], {silent: true})
|
||||
return parseGradleVersionFromOutput(output.stdout)
|
||||
}
|
||||
|
||||
export function parseGradleVersionFromOutput(output: string): string | undefined {
|
||||
@@ -66,9 +91,21 @@ export function parseGradleVersionFromOutput(output: string): string | undefined
|
||||
return versionString
|
||||
}
|
||||
|
||||
class GradleExecutable {
|
||||
constructor(
|
||||
readonly version: string,
|
||||
readonly executable: string
|
||||
) {}
|
||||
class GradleVersion {
|
||||
static PATTERN = /((\d+)(\.\d+)+)(-([a-z]+)-(\w+))?(-(SNAPSHOT|\d{14}([-+]\d{4})?))?/
|
||||
|
||||
versionPart: string
|
||||
stagePart: string
|
||||
snapshotPart: string
|
||||
|
||||
constructor(readonly version: string) {
|
||||
const matcher = GradleVersion.PATTERN.exec(version)
|
||||
if (!matcher) {
|
||||
throw new Error(`'${version}' is not a valid Gradle version string (examples: '1.0', '1.0-rc-1')`)
|
||||
}
|
||||
|
||||
this.versionPart = matcher[1]
|
||||
this.stagePart = matcher[4]
|
||||
this.snapshotPart = matcher[7]
|
||||
}
|
||||
}
|
||||
|
||||
@@ -6,7 +6,7 @@ import * as core from '@actions/core'
|
||||
import * as cache from '@actions/cache'
|
||||
import * as toolCache from '@actions/tool-cache'
|
||||
|
||||
import {findGradleVersionOnPath, versionIsAtLeast} from './gradle'
|
||||
import {determineGradleVersion, findGradleExecutableOnPath, versionIsAtLeast} from './gradle'
|
||||
import * as gradlew from './gradlew'
|
||||
import {handleCacheFailure} from '../caching/cache-utils'
|
||||
import {CacheConfig} from '../configuration'
|
||||
@@ -25,16 +25,6 @@ export async function provisionGradle(gradleVersion: string): Promise<string | u
|
||||
return undefined
|
||||
}
|
||||
|
||||
/**
|
||||
* Ensure that the Gradle version on PATH is no older than the specified version.
|
||||
* If the version on PATH is older, install the specified version and add it to the PATH.
|
||||
* @return Installed Gradle executable or undefined if no version configured.
|
||||
*/
|
||||
export async function provisionGradleAtLeast(gradleVersion: string): Promise<string> {
|
||||
const installedVersion = await installGradleVersionAtLeast(await gradleRelease(gradleVersion))
|
||||
return addToPath(installedVersion)
|
||||
}
|
||||
|
||||
async function addToPath(executable: string): Promise<string> {
|
||||
core.addPath(path.dirname(executable))
|
||||
return executable
|
||||
@@ -88,7 +78,7 @@ async function gradleReleaseNightly(): Promise<GradleVersionInfo> {
|
||||
async function gradleRelease(version: string): Promise<GradleVersionInfo> {
|
||||
const versionInfo = await findGradleVersionDeclaration(version)
|
||||
if (!versionInfo) {
|
||||
throw new Error(`Gradle version ${version} does not exists`)
|
||||
throw new Error(`Gradle version ${version} does not exist`)
|
||||
}
|
||||
return versionInfo
|
||||
}
|
||||
@@ -106,27 +96,44 @@ async function findGradleVersionDeclaration(version: string): Promise<GradleVers
|
||||
|
||||
async function installGradleVersion(versionInfo: GradleVersionInfo): Promise<string> {
|
||||
return core.group(`Provision Gradle ${versionInfo.version}`, async () => {
|
||||
const gradleOnPath = await findGradleVersionOnPath()
|
||||
if (gradleOnPath?.version === versionInfo.version) {
|
||||
core.info(`Gradle version ${versionInfo.version} is already available on PATH. Not installing.`)
|
||||
return gradleOnPath.executable
|
||||
const gradleOnPath = await findGradleExecutableOnPath()
|
||||
if (gradleOnPath) {
|
||||
const gradleOnPathVersion = await determineGradleVersion(gradleOnPath)
|
||||
if (gradleOnPathVersion === versionInfo.version) {
|
||||
core.info(`Gradle version ${versionInfo.version} is already available on PATH. Not installing.`)
|
||||
return gradleOnPath
|
||||
}
|
||||
}
|
||||
|
||||
return locateGradleAndDownloadIfRequired(versionInfo)
|
||||
})
|
||||
}
|
||||
|
||||
async function installGradleVersionAtLeast(versionInfo: GradleVersionInfo): Promise<string> {
|
||||
return core.group(`Provision Gradle >= ${versionInfo.version}`, async () => {
|
||||
const gradleOnPath = await findGradleVersionOnPath()
|
||||
if (gradleOnPath && versionIsAtLeast(gradleOnPath.version, versionInfo.version)) {
|
||||
core.info(
|
||||
`Gradle version ${gradleOnPath.version} is available on PATH and >= ${versionInfo.version}. Not installing.`
|
||||
)
|
||||
return gradleOnPath.executable
|
||||
/**
|
||||
* Find (or install) a Gradle executable that meets the specified version requirement.
|
||||
* The Gradle version on PATH and all candidates are first checked for version compatibility.
|
||||
* If no existing Gradle version meets the requirement, the required version is installed.
|
||||
* @return Gradle executable with at least the required version.
|
||||
*/
|
||||
export async function provisionGradleWithVersionAtLeast(
|
||||
minimumVersion: string,
|
||||
candidates: string[] = []
|
||||
): Promise<string> {
|
||||
const gradleOnPath = await findGradleExecutableOnPath()
|
||||
const allCandidates = gradleOnPath ? [gradleOnPath, ...candidates] : candidates
|
||||
|
||||
return core.group(`Provision Gradle >= ${minimumVersion}`, async () => {
|
||||
for (const candidate of allCandidates) {
|
||||
const candidateVersion = await determineGradleVersion(candidate)
|
||||
if (candidateVersion && versionIsAtLeast(candidateVersion, minimumVersion)) {
|
||||
core.info(
|
||||
`Gradle version ${candidateVersion} is available at ${candidate} and >= ${minimumVersion}. Not installing.`
|
||||
)
|
||||
return candidate
|
||||
}
|
||||
}
|
||||
|
||||
return locateGradleAndDownloadIfRequired(versionInfo)
|
||||
return locateGradleAndDownloadIfRequired(await gradleRelease(minimumVersion))
|
||||
})
|
||||
}
|
||||
|
||||
|
||||
@@ -6,6 +6,7 @@ import org.gradle.api.internal.tasks.execution.*
|
||||
import org.gradle.execution.*
|
||||
import org.gradle.internal.build.event.BuildEventListenerRegistryInternal
|
||||
import org.gradle.util.GradleVersion
|
||||
import org.slf4j.LoggerFactory
|
||||
|
||||
settingsEvaluated { settings ->
|
||||
def projectTracker = gradle.sharedServices.registerIfAbsent("gradle-action-buildResultsRecorder", BuildResultsRecorder, { spec ->
|
||||
@@ -20,6 +21,7 @@ settingsEvaluated { settings ->
|
||||
}
|
||||
|
||||
abstract class BuildResultsRecorder implements BuildService<BuildResultsRecorder.Params>, BuildOperationListener, AutoCloseable {
|
||||
private final logger = LoggerFactory.getLogger("gradle/actions")
|
||||
private boolean buildFailed = false
|
||||
private boolean configCacheHit = true
|
||||
interface Params extends BuildServiceParameters {
|
||||
@@ -69,6 +71,7 @@ abstract class BuildResultsRecorder implements BuildService<BuildResultsRecorder
|
||||
buildResultsDir.mkdirs()
|
||||
def buildResultsFile = new File(buildResultsDir, githubActionStep + getParameters().getInvocationId().get() + ".json")
|
||||
if (!buildResultsFile.exists()) {
|
||||
logger.lifecycle("gradle/actions: Writing build results to ${buildResultsFile}")
|
||||
buildResultsFile << groovy.json.JsonOutput.toJson(buildResults)
|
||||
}
|
||||
} catch (Exception e) {
|
||||
|
||||
@@ -2,7 +2,9 @@
|
||||
* Capture information for each executed Gradle build to display in the job summary.
|
||||
*/
|
||||
import org.gradle.util.GradleVersion
|
||||
import org.slf4j.LoggerFactory
|
||||
|
||||
def SKIP_BUILD_CAPTURE = "GRADLE_ACTIONS_SKIP_BUILD_RESULT_CAPTURE"
|
||||
def BUILD_SCAN_PLUGIN_ID = "com.gradle.build-scan"
|
||||
def BUILD_SCAN_EXTENSION = "buildScan"
|
||||
def DEVELOCITY_PLUGIN_ID = "com.gradle.develocity"
|
||||
@@ -10,6 +12,11 @@ def DEVELOCITY_EXTENSION = "develocity"
|
||||
def GE_PLUGIN_ID = "com.gradle.enterprise"
|
||||
def GE_EXTENSION = "gradleEnterprise"
|
||||
|
||||
if (System.properties[SKIP_BUILD_CAPTURE] ?: System.getenv(SKIP_BUILD_CAPTURE)) {
|
||||
logger.lifecycle("gradle/actions: Not capturing build results")
|
||||
return
|
||||
}
|
||||
|
||||
// Only run against root build. Do not run against included builds.
|
||||
def isTopLevelBuild = gradle.getParent() == null
|
||||
if (isTopLevelBuild) {
|
||||
@@ -79,7 +86,6 @@ def captureUsingBuildService(invocationId) {
|
||||
|
||||
void captureUsingBuildFinished(gradle, String invocationId, ResultsWriter resultsWriter) {
|
||||
gradle.buildFinished { result ->
|
||||
println "Got buildFinished: ${result}"
|
||||
def buildResults = [
|
||||
rootProjectName: rootProject.name,
|
||||
rootProjectDir: rootProject.projectDir.absolutePath,
|
||||
@@ -124,6 +130,8 @@ void captureUsingBuildScanPublished(buildScanExtension, String invocationId, Res
|
||||
}
|
||||
|
||||
class ResultsWriter {
|
||||
private final logger = LoggerFactory.getLogger("gradle/actions")
|
||||
|
||||
void writeToResultsFile(String subDir, String invocationId, def content) {
|
||||
def runnerTempDir = System.getProperty("RUNNER_TEMP") ?: System.getenv("RUNNER_TEMP")
|
||||
def githubActionStep = System.getProperty("GITHUB_ACTION") ?: System.getenv("GITHUB_ACTION")
|
||||
@@ -136,6 +144,7 @@ class ResultsWriter {
|
||||
buildResultsDir.mkdirs()
|
||||
def buildResultsFile = new File(buildResultsDir, githubActionStep + invocationId + ".json")
|
||||
if (!buildResultsFile.exists()) {
|
||||
logger.lifecycle("gradle/actions: Writing build results to ${buildResultsFile}")
|
||||
buildResultsFile << groovy.json.JsonOutput.toJson(content)
|
||||
}
|
||||
} catch (Exception e) {
|
||||
|
||||
@@ -15,8 +15,8 @@ buildscript {
|
||||
if (pluginRepositoryUsername && pluginRepositoryPassword) {
|
||||
logger.lifecycle("Applying credentials for plugin repository: ${pluginRepositoryUrl}")
|
||||
credentials {
|
||||
username(pluginRepositoryUsername)
|
||||
password(pluginRepositoryPassword)
|
||||
username = pluginRepositoryUsername
|
||||
password = pluginRepositoryPassword
|
||||
}
|
||||
authentication {
|
||||
basic(BasicAuthentication)
|
||||
|
||||
@@ -45,12 +45,12 @@ initscript {
|
||||
|
||||
repositories {
|
||||
maven {
|
||||
url pluginRepositoryUrl
|
||||
url = pluginRepositoryUrl
|
||||
if (pluginRepositoryUsername && pluginRepositoryPassword) {
|
||||
logger.lifecycle("Using credentials for plugin repository")
|
||||
credentials {
|
||||
username(pluginRepositoryUsername)
|
||||
password(pluginRepositoryPassword)
|
||||
username = pluginRepositoryUsername
|
||||
password = pluginRepositoryPassword
|
||||
}
|
||||
authentication {
|
||||
basic(BasicAuthentication)
|
||||
|
||||
@@ -1,4 +1,28 @@
|
||||
[
|
||||
{
|
||||
"version": "8.12.1",
|
||||
"checksum": "2db75c40782f5e8ba1fc278a5574bab070adccb2d21ca5a6e5ed840888448046"
|
||||
},
|
||||
{
|
||||
"version": "8.13-milestone-3",
|
||||
"checksum": "2db75c40782f5e8ba1fc278a5574bab070adccb2d21ca5a6e5ed840888448046"
|
||||
},
|
||||
{
|
||||
"version": "8.12.1-milestone-1",
|
||||
"checksum": "2db75c40782f5e8ba1fc278a5574bab070adccb2d21ca5a6e5ed840888448046"
|
||||
},
|
||||
{
|
||||
"version": "8.13-milestone-2",
|
||||
"checksum": "2db75c40782f5e8ba1fc278a5574bab070adccb2d21ca5a6e5ed840888448046"
|
||||
},
|
||||
{
|
||||
"version": "8.13-milestone-1",
|
||||
"checksum": "2db75c40782f5e8ba1fc278a5574bab070adccb2d21ca5a6e5ed840888448046"
|
||||
},
|
||||
{
|
||||
"version": "8.12",
|
||||
"checksum": "2db75c40782f5e8ba1fc278a5574bab070adccb2d21ca5a6e5ed840888448046"
|
||||
},
|
||||
{
|
||||
"version": "8.12-rc-2",
|
||||
"checksum": "2db75c40782f5e8ba1fc278a5574bab070adccb2d21ca5a6e5ed840888448046"
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
distributionBase=GRADLE_USER_HOME
|
||||
distributionPath=wrapper/dists
|
||||
distributionSha256Sum=f397b287023acdba1e9f6fc5ea72d22dd63669d59ed4a289a29b1a76eee151c6
|
||||
distributionUrl=https\://services.gradle.org/distributions/gradle-8.11.1-bin.zip
|
||||
distributionSha256Sum=8d97a97984f6cbd2b85fe4c60a743440a347544bf18818048e611f5288d46c94
|
||||
distributionUrl=https\://services.gradle.org/distributions/gradle-8.12.1-bin.zip
|
||||
networkTimeout=10000
|
||||
validateDistributionUrl=true
|
||||
zipStoreBase=GRADLE_USER_HOME
|
||||
|
||||
3
sources/test/init-scripts/gradlew
vendored
3
sources/test/init-scripts/gradlew
vendored
@@ -86,8 +86,7 @@ done
|
||||
# shellcheck disable=SC2034
|
||||
APP_BASE_NAME=${0##*/}
|
||||
# Discard cd standard output in case $CDPATH is set (https://github.com/gradle/gradle/issues/25036)
|
||||
APP_HOME=$( cd -P "${APP_HOME:-./}" > /dev/null && printf '%s
|
||||
' "$PWD" ) || exit
|
||||
APP_HOME=$( cd -P "${APP_HOME:-./}" > /dev/null && printf '%s\n' "$PWD" ) || exit
|
||||
|
||||
# Use the maximum available, or set MAX_FD != -1 to use that value.
|
||||
MAX_FD=maximum
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
plugins {
|
||||
id "com.gradle.develocity" version "3.19"
|
||||
id "com.gradle.common-custom-user-data-gradle-plugin" version "2.0.2"
|
||||
id "com.gradle.develocity" version "3.19.1"
|
||||
id "com.gradle.common-custom-user-data-gradle-plugin" version "2.1"
|
||||
}
|
||||
|
||||
develocity {
|
||||
|
||||
@@ -16,8 +16,8 @@ import java.nio.file.Files
|
||||
import java.util.zip.GZIPOutputStream
|
||||
|
||||
class BaseInitScriptTest extends Specification {
|
||||
static final String DEVELOCITY_PLUGIN_VERSION = '3.19'
|
||||
static final String CCUD_PLUGIN_VERSION = '2.0.2'
|
||||
static final String DEVELOCITY_PLUGIN_VERSION = '3.19.1'
|
||||
static final String CCUD_PLUGIN_VERSION = '2.1'
|
||||
|
||||
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)
|
||||
@@ -28,7 +28,7 @@ class BaseInitScriptTest extends Specification {
|
||||
static final TestGradleVersion GRADLE_7_1 = new TestGradleVersion(GradleVersion.version('7.1.1'), 8, 16)
|
||||
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_X = new TestGradleVersion(GradleVersion.version('8.11.1'), 8, 23)
|
||||
static final TestGradleVersion GRADLE_8_X = new TestGradleVersion(GradleVersion.version('8.12.1'), 8, 23)
|
||||
|
||||
static final List<TestGradleVersion> ALL_VERSIONS = [
|
||||
GRADLE_3_X, // First version where TestKit supports environment variables
|
||||
|
||||
@@ -196,7 +196,7 @@ class TestBuildResultRecorder extends BaseInitScriptTest {
|
||||
when:
|
||||
settingsFile.text = """
|
||||
plugins {
|
||||
id 'com.gradle.develocity' version '3.19' apply(false)
|
||||
id 'com.gradle.develocity' version '3.19.1' apply(false)
|
||||
}
|
||||
gradle.settingsEvaluated {
|
||||
apply plugin: 'com.gradle.develocity'
|
||||
|
||||
@@ -1,8 +1,9 @@
|
||||
import * as exec from '@actions/exec'
|
||||
import * as core from '@actions/core'
|
||||
import * as glob from '@actions/glob'
|
||||
import fs from 'fs'
|
||||
import path from 'path'
|
||||
import {expect, test, jest} from '@jest/globals'
|
||||
|
||||
import {CacheCleaner} from '../../src/caching/cache-cleaner'
|
||||
|
||||
jest.setTimeout(120000)
|
||||
@@ -27,7 +28,7 @@ test('will cleanup unused dependency jars and build-cache entries', async () =>
|
||||
expect(fs.existsSync(commonsMath311)).toBe(true)
|
||||
expect(fs.readdirSync(buildCacheDir).length).toBe(4) // gc.properties, build-cache-1.lock, and 2 task entries
|
||||
|
||||
await cacheCleaner.forceCleanupFilesOlderThan(timestamp)
|
||||
await cacheCleaner.forceCleanupFilesOlderThan(timestamp, 'gradle')
|
||||
|
||||
expect(fs.existsSync(commonsMath31)).toBe(false)
|
||||
expect(fs.existsSync(commonsMath311)).toBe(true)
|
||||
@@ -53,7 +54,7 @@ test('will cleanup unused gradle versions', async () => {
|
||||
const transforms3 = path.resolve(gradleUserHome, "caches/transforms-3")
|
||||
const metadata100 = path.resolve(gradleUserHome, "caches/modules-2/metadata-2.100")
|
||||
const wrapper802 = path.resolve(gradleUserHome, "wrapper/dists/gradle-8.0.2-bin")
|
||||
const gradleCurrent = path.resolve(gradleUserHome, "caches/8.11.1")
|
||||
const gradleCurrent = path.resolve(gradleUserHome, "caches/8.12.1")
|
||||
const metadataCurrent = path.resolve(gradleUserHome, "caches/modules-2/metadata-2.107")
|
||||
|
||||
expect(fs.existsSync(gradle802)).toBe(true)
|
||||
@@ -67,7 +68,7 @@ test('will cleanup unused gradle versions', async () => {
|
||||
// The wrapper won't be removed if it was recently downloaded. Age it.
|
||||
setUtimes(wrapper802, new Date(Date.now() - 48 * 60 * 60 * 1000))
|
||||
|
||||
await cacheCleaner.forceCleanupFilesOlderThan(timestamp)
|
||||
await cacheCleaner.forceCleanupFilesOlderThan(timestamp, 'gradle')
|
||||
|
||||
expect(fs.existsSync(gradle802)).toBe(false)
|
||||
expect(fs.existsSync(transforms3)).toBe(false)
|
||||
|
||||
@@ -1,5 +1,7 @@
|
||||
import * as path from 'path'
|
||||
import * as fs from 'fs'
|
||||
import {describe, expect, it} from '@jest/globals'
|
||||
|
||||
import {GradleUserHomeCache} from "../../src/caching/gradle-user-home-cache"
|
||||
import {CacheConfig} from "../../src/configuration"
|
||||
|
||||
@@ -8,7 +10,7 @@ fs.rmSync(testTmp, {recursive: true, force: true})
|
||||
|
||||
describe("--info and --stacktrace", () => {
|
||||
describe("will be created", () => {
|
||||
it("when gradle.properties does not exists", async () => {
|
||||
it("when gradle.properties does not exist", async () => {
|
||||
const emptyGradleHome = `${testTmp}/empty-gradle-home`
|
||||
fs.mkdirSync(emptyGradleHome, {recursive: true})
|
||||
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
import exp from 'constants'
|
||||
import {describe, expect, it} from '@jest/globals'
|
||||
|
||||
import {CacheEntryListener, CacheListener} from '../../src/caching/cache-reporting'
|
||||
|
||||
describe('caching report', () => {
|
||||
|
||||
@@ -1,3 +1,5 @@
|
||||
import {describe, expect, it} from '@jest/globals'
|
||||
|
||||
import * as cacheUtils from '../../src/caching/cache-utils'
|
||||
|
||||
describe('cacheUtils-utils', () => {
|
||||
|
||||
@@ -1,3 +1,5 @@
|
||||
import {describe, expect, it} from '@jest/globals'
|
||||
|
||||
import * as inputParams from '../../src/configuration'
|
||||
|
||||
describe('input params', () => {
|
||||
|
||||
@@ -1,4 +1,6 @@
|
||||
import { DependencyGraphConfig } from "../../src/configuration"
|
||||
import {describe, expect, it} from '@jest/globals'
|
||||
|
||||
import {DependencyGraphConfig} from "../../src/configuration"
|
||||
|
||||
describe('dependency-graph', () => {
|
||||
describe('constructs job correlator', () => {
|
||||
|
||||
@@ -1,44 +1,94 @@
|
||||
import { describe } from 'node:test'
|
||||
import { versionIsAtLeast, parseGradleVersionFromOutput } from '../../src/execution/gradle'
|
||||
import {describe, expect, it} from '@jest/globals'
|
||||
|
||||
import {versionIsAtLeast, parseGradleVersionFromOutput} from '../../src/execution/gradle'
|
||||
|
||||
describe('gradle', () => {
|
||||
describe('can compare version with', () => {
|
||||
it('same version', async () => {
|
||||
expect(versionIsAtLeast('6.7.1', '6.7.1')).toBe(true)
|
||||
expect(versionIsAtLeast('7.0', '7.0')).toBe(true)
|
||||
expect(versionIsAtLeast('7.0', '7.0.0')).toBe(true)
|
||||
})
|
||||
it('newer version', async () => {
|
||||
expect(versionIsAtLeast('6.7.1', '6.7.2')).toBe(false)
|
||||
expect(versionIsAtLeast('7.0', '8.0')).toBe(false)
|
||||
expect(versionIsAtLeast('7.0', '7.0.1')).toBe(false)
|
||||
})
|
||||
it('older version', async () => {
|
||||
expect(versionIsAtLeast('6.7.2', '6.7.1')).toBe(true)
|
||||
expect(versionIsAtLeast('8.0', '7.0')).toBe(true)
|
||||
expect(versionIsAtLeast('7.0.1', '7.0')).toBe(true)
|
||||
})
|
||||
it('rc version', async () => {
|
||||
expect(versionIsAtLeast('8.0.2-rc-1', '8.0.1')).toBe(true)
|
||||
expect(versionIsAtLeast('8.0.2-rc-1', '8.0.2')).toBe(false)
|
||||
expect(versionIsAtLeast('8.1-rc-1', '8.0')).toBe(true)
|
||||
expect(versionIsAtLeast('8.0-rc-1', '8.0')).toBe(false)
|
||||
})
|
||||
it('snapshot version', async () => {
|
||||
expect(versionIsAtLeast('8.11-20240829002031+0000', '8.10')).toBe(true)
|
||||
expect(versionIsAtLeast('8.11-20240829002031+0000', '8.10.1')).toBe(true)
|
||||
expect(versionIsAtLeast('8.11-20240829002031+0000', '8.11')).toBe(false)
|
||||
describe('can compare versions that are', () => {
|
||||
function versionsAreOrdered(versions: string[]): void {
|
||||
for (let i = 0; i < versions.length; i++) {
|
||||
// Compare with all other versions
|
||||
for (let j = 0; j < versions.length; j++) {
|
||||
if (i >= j) {
|
||||
it(`${versions[i]} is at least ${versions[j]}`, () => {
|
||||
expect(versionIsAtLeast(versions[i], versions[j])).toBe(true)
|
||||
})
|
||||
} else {
|
||||
it(`${versions[i]} is NOT at least ${versions[j]}`, () => {
|
||||
expect(versionIsAtLeast(versions[i], versions[j])).toBe(false)
|
||||
})
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
expect(versionIsAtLeast('8.10.2-20240828012138+0000', '8.10')).toBe(true)
|
||||
expect(versionIsAtLeast('8.10.2-20240828012138+0000', '8.10.1')).toBe(true)
|
||||
expect(versionIsAtLeast('8.10.2-20240828012138+0000', '8.10.2')).toBe(false)
|
||||
expect(versionIsAtLeast('8.10.2-20240828012138+0000', '8.11')).toBe(false)
|
||||
function versionsAreNotOrdered(versions: string[]): void {
|
||||
for (let i = 0; i < versions.length; i++) {
|
||||
// Compare with all other versions
|
||||
for (let j = 0; j < versions.length; j++) {
|
||||
if (i !== j) {
|
||||
it(`${versions[i]} is NOT at least ${versions[j]}`, () => {
|
||||
expect(versionIsAtLeast(versions[i], versions[j])).toBe(false)
|
||||
})
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
expect(versionIsAtLeast('9.1-branch-provider_api_migration_public_api_changes-20240826121451+0000', '9.0')).toBe(true)
|
||||
expect(versionIsAtLeast('9.1-branch-provider_api_migration_public_api_changes-20240826121451+0000', '9.0.1')).toBe(true)
|
||||
expect(versionIsAtLeast('9.1-branch-provider_api_migration_public_api_changes-20240826121451+0000', '9.1')).toBe(false)
|
||||
function versionsAreEqual(versions: string[]): void {
|
||||
for (let i = 0; i < versions.length; i++) {
|
||||
// Compare with all other versions
|
||||
for (let j = 0; j < versions.length; j++) {
|
||||
it(`${versions[i]} is at least ${versions[j]}`, () => {
|
||||
expect(versionIsAtLeast(versions[i], versions[j])).toBe(true)
|
||||
})
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
describe('simple versions', () => {
|
||||
versionsAreOrdered(['6.0', '6.7', '6.7.1', '6.7.2', '7.0', '7.0.1', '7.1', '8.0', '8.12.1'])
|
||||
|
||||
versionsAreEqual(['7.0', '7.0.0'])
|
||||
versionsAreEqual(['7.1', '7.1.0'])
|
||||
})
|
||||
|
||||
describe('rc versions', () => {
|
||||
versionsAreOrdered([
|
||||
'8.10', '8.11-rc-1', '8.11-rc-2', '8.11', '8.11.1-rc-1', '8.11.1'
|
||||
])
|
||||
})
|
||||
|
||||
describe('milestone versions', () => {
|
||||
versionsAreOrdered([
|
||||
'8.12.1', '8.12.2-milestone-1', '8.12.2', '8.13-milestone-1', '8.13-milestone-2', '8.13'
|
||||
])
|
||||
versionsAreOrdered([
|
||||
'8.12.1', '8.12.2-milestone-1', '8.12.2-milestone-2', '8.12.2-rc-1', '8.12.2'
|
||||
])
|
||||
})
|
||||
|
||||
describe('preview versions', () => {
|
||||
versionsAreOrdered([
|
||||
'8.12.1', '8.12.2-preview-1', '8.12.2', '8.13-preview-1', '8.13-preview-2', '8.13'
|
||||
])
|
||||
versionsAreOrdered([
|
||||
'8.12.1', '8.12.2-milestone-1', '8.12.2-preview-1', '8.12.2-rc-1', '8.12.2'
|
||||
])
|
||||
})
|
||||
|
||||
describe('snapshot versions', () => {
|
||||
versionsAreOrdered([
|
||||
'8.10.1', '8.10.2-20240828012138+0000', '8.10.2', '8.11-20240829002031+0000', '8.11'
|
||||
])
|
||||
versionsAreOrdered([
|
||||
'9.0', '9.1-branch-provider_api_migration_public_api_changes-20240826121451+0000', '9.1'
|
||||
])
|
||||
versionsAreNotOrdered([
|
||||
'8.10.2-20240828012138+0000', '8.10.2-20240828010000+1000', '8.10.2-milestone-1'
|
||||
])
|
||||
})
|
||||
})
|
||||
|
||||
describe('can parse version from output', () => {
|
||||
it('major version', async () => {
|
||||
const output = `
|
||||
|
||||
@@ -1,7 +1,8 @@
|
||||
import { BuildResult } from '../../src/build-results'
|
||||
import { renderSummaryTable } from '../../src/job-summary'
|
||||
import dedent from 'dedent'
|
||||
import {describe, expect, it} from '@jest/globals'
|
||||
|
||||
import {BuildResult} from '../../src/build-results'
|
||||
import {renderSummaryTable} from '../../src/job-summary'
|
||||
|
||||
const successfulHelpBuild: BuildResult = {
|
||||
rootProjectName: 'root',
|
||||
|
||||
@@ -1,3 +1,5 @@
|
||||
import {afterAll, describe, expect, it, jest} from '@jest/globals'
|
||||
|
||||
import {getPredefinedToolchains, mergeToolchainContent} from "../../src/caching/gradle-user-home-utils";
|
||||
|
||||
describe('predefined-toolchains', () => {
|
||||
@@ -37,7 +39,7 @@ describe('predefined-toolchains', () => {
|
||||
<version>8</version>
|
||||
</provides>
|
||||
<configuration>
|
||||
<jdkHome>\${env.JAVA_HOME_8_X64}</jdkHome>
|
||||
<jdkHome>/jdks/foo_8</jdkHome>
|
||||
</configuration>
|
||||
</toolchain>
|
||||
<toolchain>
|
||||
@@ -46,7 +48,7 @@ describe('predefined-toolchains', () => {
|
||||
<version>11</version>
|
||||
</provides>
|
||||
<configuration>
|
||||
<jdkHome>\${env.JAVA_HOME_11_X64}</jdkHome>
|
||||
<jdkHome>/jdks/foo_11</jdkHome>
|
||||
</configuration>
|
||||
</toolchain>
|
||||
<toolchain>
|
||||
@@ -55,7 +57,7 @@ describe('predefined-toolchains', () => {
|
||||
<version>21</version>
|
||||
</provides>
|
||||
<configuration>
|
||||
<jdkHome>\${env.JAVA_HOME_21_ARM64}</jdkHome>
|
||||
<jdkHome>/jdks/foo_21</jdkHome>
|
||||
</configuration>
|
||||
</toolchain>
|
||||
</toolchains>
|
||||
@@ -79,7 +81,7 @@ describe('predefined-toolchains', () => {
|
||||
<version>8</version>
|
||||
</provides>
|
||||
<configuration>
|
||||
<jdkHome>\${env.JAVA_HOME_8_X64}</jdkHome>
|
||||
<jdkHome>/jdks/foo_8</jdkHome>
|
||||
</configuration>
|
||||
</toolchain>
|
||||
</toolchains>
|
||||
@@ -96,7 +98,7 @@ describe('predefined-toolchains', () => {
|
||||
<version>8</version>
|
||||
</provides>
|
||||
<configuration>
|
||||
<jdkHome>\${env.JAVA_HOME_8_X64}</jdkHome>
|
||||
<jdkHome>/jdks/foo_8</jdkHome>
|
||||
</configuration>
|
||||
</toolchain>
|
||||
|
||||
@@ -107,7 +109,7 @@ describe('predefined-toolchains', () => {
|
||||
<version>11</version>
|
||||
</provides>
|
||||
<configuration>
|
||||
<jdkHome>\${env.JAVA_HOME_11_X64}</jdkHome>
|
||||
<jdkHome>/jdks/foo_11</jdkHome>
|
||||
</configuration>
|
||||
</toolchain>
|
||||
</toolchains>
|
||||
|
||||
@@ -1,5 +1,7 @@
|
||||
import {DevelocityAccessCredentials, getToken} from "../../src/develocity/short-lived-token";
|
||||
import nock from "nock";
|
||||
import {describe, expect, it} from '@jest/globals'
|
||||
|
||||
import {DevelocityAccessCredentials, getToken} from "../../src/develocity/short-lived-token";
|
||||
|
||||
describe('short lived tokens', () => {
|
||||
it('parse valid access key should return an object', async () => {
|
||||
|
||||
@@ -4,7 +4,6 @@ import * as validate from '../../../src/wrapper-validation/validate'
|
||||
import {expect, test, jest} from '@jest/globals'
|
||||
import { WrapperChecksums, KNOWN_CHECKSUMS } from '../../../src/wrapper-validation/checksums'
|
||||
import { ChecksumCache } from '../../../src/wrapper-validation/cache'
|
||||
import exp from 'constants'
|
||||
|
||||
jest.setTimeout(30000)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user