mirror of
https://github.com/gradle/actions.git
synced 2026-06-11 06:00:40 +00:00
Compare commits
12 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| a03a9c198b | |||
| 2577c609e7 | |||
| 8b6cdb5f58 | |||
| 5852e0e5d8 | |||
| 318eed7038 | |||
| a740661292 | |||
| 7ae0d0208c | |||
| e473973a5b | |||
| 35a4a3f355 | |||
| b6eebf33f1 | |||
| 9901393644 | |||
| 20ce680c89 |
@@ -8,10 +8,6 @@ on:
|
||||
paths-ignore:
|
||||
- 'dist/**'
|
||||
pull_request:
|
||||
paths:
|
||||
- '.github/workflows/ci-init-script-check.yml'
|
||||
- 'sources/src/resources/init-scripts/**'
|
||||
- 'sources/test/init-scripts/**'
|
||||
workflow_dispatch:
|
||||
|
||||
permissions:
|
||||
@@ -23,16 +19,34 @@ jobs:
|
||||
steps:
|
||||
- name: Checkout sources
|
||||
uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6.0.3
|
||||
with:
|
||||
fetch-depth: 0
|
||||
# Detect whether anything relevant to the init-script tests changed.
|
||||
# The workflow always runs (so it always reports a status check, making it safe
|
||||
# to mark as required), but the heavy steps below are skipped on pull requests
|
||||
# that don't touch the init-scripts. Pushes and manual runs always execute fully.
|
||||
- name: Check for relevant changes
|
||||
id: changes
|
||||
if: github.event_name == 'pull_request'
|
||||
uses: tj-actions/changed-files@9426d40962ed5378910ee2e21d5f8c6fcbf2dd96 # v47.0.6
|
||||
with:
|
||||
files: |
|
||||
.github/workflows/ci-init-script-check.yml
|
||||
sources/src/resources/init-scripts/**
|
||||
sources/test/init-scripts/**
|
||||
- name: Setup Java
|
||||
if: steps.changes.outputs.any_changed == 'true' || github.event_name != 'pull_request'
|
||||
uses: actions/setup-java@be666c2fcd27ec809703dec50e508c2fdc7f6654 # v5.2.0
|
||||
with:
|
||||
distribution: temurin
|
||||
java-version: 17
|
||||
- name: Setup Gradle
|
||||
if: steps.changes.outputs.any_changed == 'true' || github.event_name != 'pull_request'
|
||||
# Use a released version to avoid breakages
|
||||
uses: gradle/actions/setup-gradle@50e97c2cd7a37755bbfafc9c5b7cafaece252f6e # v6.1.0
|
||||
env:
|
||||
ALLOWED_GRADLE_WRAPPER_CHECKSUMS: e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855 # Invalid wrapper jar used for testing
|
||||
- name: Run integration tests
|
||||
if: steps.changes.outputs.any_changed == 'true' || github.event_name != 'pull_request'
|
||||
working-directory: sources/test/init-scripts
|
||||
run: ./gradlew check
|
||||
|
||||
@@ -28,7 +28,7 @@ jobs:
|
||||
needs: build-distribution
|
||||
uses: ./.github/workflows/suite-integ-test-caching.yml
|
||||
concurrency:
|
||||
group: CI-integ-test-caching
|
||||
group: CI-integ-test-caching-${{ github.ref }}
|
||||
cancel-in-progress: false
|
||||
with:
|
||||
skip-dist: false
|
||||
@@ -40,7 +40,7 @@ jobs:
|
||||
needs: caching-integ-tests
|
||||
uses: ./.github/workflows/suite-integ-test-other.yml
|
||||
concurrency:
|
||||
group: CI-integ-test-other
|
||||
group: CI-integ-test-other-${{ github.ref }}
|
||||
cancel-in-progress: false
|
||||
with:
|
||||
skip-dist: false
|
||||
@@ -52,8 +52,29 @@ jobs:
|
||||
needs: other-integ-tests
|
||||
uses: ./.github/workflows/suite-integ-test-dependency-submission.yml
|
||||
concurrency:
|
||||
group: CI-integ-test-dependency-submission
|
||||
group: CI-integ-test-dependency-submission-${{ github.ref }}
|
||||
cancel-in-progress: false
|
||||
with:
|
||||
skip-dist: false
|
||||
secrets: inherit
|
||||
|
||||
# Aggregate gate: a single check that succeeds only when all integ-test jobs succeed.
|
||||
# Require this one check in branch protection instead of every fanned-out matrix job.
|
||||
integ-test-success:
|
||||
if: ${{ always() }}
|
||||
needs:
|
||||
- build-distribution
|
||||
- caching-integ-tests
|
||||
- other-integ-tests
|
||||
- dependency-submission-integ-tests
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Fail if any integ-test job failed or was cancelled
|
||||
if: ${{ contains(needs.*.result, 'failure') || contains(needs.*.result, 'cancelled') }}
|
||||
run: |
|
||||
echo "One or more integ-test jobs did not succeed:"
|
||||
echo " build-distribution: ${{ needs.build-distribution.result }}"
|
||||
echo " caching-integ-tests: ${{ needs.caching-integ-tests.result }}"
|
||||
echo " other-integ-tests: ${{ needs.other-integ-tests.result }}"
|
||||
echo " dependency-submission-integ-tests: ${{ needs.dependency-submission-integ-tests.result }}"
|
||||
exit 1
|
||||
|
||||
+4
-4
@@ -11,16 +11,16 @@
|
||||
- Note: The gradle actions follow the GitHub Actions convention of including a .0 patch number for the first release of a minor version, unlike the Gradle convention which omits the trailing .0.
|
||||
|
||||
## Release gradle/actions
|
||||
- Create a tag for the release. The tag should have the format `v5.0.0`
|
||||
- From CLI: `git tag -s -m "v5.0.0" v5.0.0 && git push --tags`
|
||||
- Create a tag for the release. The tag should have the format `v6.2.0`
|
||||
- From CLI: `git tag -s -m "v6.2.0" v6.2.0 && git push --tags`
|
||||
- Note that we sign the tag and set the commit message for the tag to the newly released version.
|
||||
- Go to https://github.com/gradle/actions/releases and "Draft new release"
|
||||
- Use the newly created tag and copy the tag name exactly as the release title.
|
||||
- Craft release notes content based on issues closed, PRs merged and commits
|
||||
- Include a Full changelog link in the format https://github.com/gradle/actions/compare/v2.12.0...v3.0.0
|
||||
- Publish the release.
|
||||
- Force push the `v5` tag (or current major version) to point to the new release. It is conventional for users to bind to a major release version using this tag.
|
||||
- From CLI: `git tag -f -s -a -m "v5.0.0" v5 && git push -f --tags`
|
||||
- Force push the `v6` tag (or current major version) to point to the new release. It is conventional for users to bind to a major release version using this tag.
|
||||
- From CLI: `git tag -f -s -a -m "v6.2.0" v6 && git push -f --tags`
|
||||
- Note that we sign the tag and set the commit message for the tag to the newly released version.
|
||||
- Your HEAD must point at the commit to be tagged.
|
||||
|
||||
|
||||
@@ -8,10 +8,16 @@ inputs:
|
||||
type: string
|
||||
|
||||
dependency-resolution-task:
|
||||
type: string
|
||||
type: list
|
||||
separator: ' '
|
||||
list-item:
|
||||
type: string
|
||||
|
||||
additional-arguments:
|
||||
type: string
|
||||
type: list
|
||||
separator: ' '
|
||||
list-item:
|
||||
type: string
|
||||
|
||||
# Cache configuration
|
||||
cache-provider:
|
||||
@@ -115,7 +121,7 @@ inputs:
|
||||
build-scan-terms-of-use-agree:
|
||||
type: enum
|
||||
allowed-values:
|
||||
- 'yes'
|
||||
- yes
|
||||
|
||||
develocity-access-key:
|
||||
type: string
|
||||
|
||||
+140
-125
File diff suppressed because one or more lines are too long
+4
-4
File diff suppressed because one or more lines are too long
+137
-106
File diff suppressed because one or more lines are too long
+4
-4
File diff suppressed because one or more lines are too long
Vendored
+139
-124
File diff suppressed because one or more lines are too long
Vendored
+4
-4
File diff suppressed because one or more lines are too long
Vendored
+192
-160
File diff suppressed because one or more lines are too long
Vendored
+4
-4
File diff suppressed because one or more lines are too long
+76
-62
File diff suppressed because one or more lines are too long
+4
-4
File diff suppressed because one or more lines are too long
@@ -548,6 +548,11 @@ jobs:
|
||||
- run: ./gradlew build --scan
|
||||
```
|
||||
|
||||
When a comment is added, any earlier Job Summary comments posted by the same job on that Pull Request are
|
||||
automatically minimized, so only the most recent result remains expanded. This also applies when
|
||||
`add-job-summary-as-pr-comment: 'on-failure'` is used: once a later run of the job succeeds, the previous
|
||||
failure comment is collapsed.
|
||||
|
||||
Note that to add a Pull Request comment, the workflow must be configured with the `pull-requests: write` permission.
|
||||
|
||||
|
||||
|
||||
@@ -69,6 +69,7 @@ inputs:
|
||||
- disabled
|
||||
- generate
|
||||
- generate-and-submit
|
||||
- generate-submit-and-upload
|
||||
- generate-and-upload
|
||||
- download-and-submit
|
||||
|
||||
@@ -106,7 +107,7 @@ inputs:
|
||||
build-scan-terms-of-use-agree:
|
||||
type: enum
|
||||
allowed-values:
|
||||
- 'yes'
|
||||
- yes
|
||||
|
||||
develocity-access-key:
|
||||
type: string
|
||||
@@ -153,7 +154,10 @@ inputs:
|
||||
|
||||
# Deprecated action inputs
|
||||
arguments:
|
||||
type: string
|
||||
type: list
|
||||
separator: ' '
|
||||
list-item:
|
||||
type: string
|
||||
|
||||
# Experimental action inputs
|
||||
gradle-home-cache-strict-match:
|
||||
|
||||
Generated
+125
-172
@@ -92,6 +92,19 @@
|
||||
"node": ">= 20"
|
||||
}
|
||||
},
|
||||
"node_modules/@actions/artifact/node_modules/@octokit/endpoint": {
|
||||
"version": "11.0.3",
|
||||
"resolved": "https://registry.npmjs.org/@octokit/endpoint/-/endpoint-11.0.3.tgz",
|
||||
"integrity": "sha512-FWFlNxghg4HrXkD3ifYbS/IdL/mDHjh9QcsNyhQjN8dplUoZbejsdpmuqdA76nxj2xoWPs7p8uX2SNr9rYu0Ag==",
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"@octokit/types": "^16.0.0",
|
||||
"universal-user-agent": "^7.0.2"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">= 20"
|
||||
}
|
||||
},
|
||||
"node_modules/@actions/artifact/node_modules/@octokit/graphql": {
|
||||
"version": "9.0.3",
|
||||
"license": "MIT",
|
||||
@@ -129,6 +142,35 @@
|
||||
"@octokit/core": ">=7"
|
||||
}
|
||||
},
|
||||
"node_modules/@actions/artifact/node_modules/@octokit/request": {
|
||||
"version": "10.0.10",
|
||||
"resolved": "https://registry.npmjs.org/@octokit/request/-/request-10.0.10.tgz",
|
||||
"integrity": "sha512-KxNC2pTqqhszMNrf12ZRd4PonRgyJdsM4F/jySiddQK+DsRcfBtUvqn8t7UsyZhnRJHvX46OohDt5N3VqIWC2w==",
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"@octokit/endpoint": "^11.0.3",
|
||||
"@octokit/request-error": "^7.0.2",
|
||||
"@octokit/types": "^16.0.0",
|
||||
"content-type": "^2.0.0",
|
||||
"json-with-bigint": "^3.5.3",
|
||||
"universal-user-agent": "^7.0.2"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">= 20"
|
||||
}
|
||||
},
|
||||
"node_modules/@actions/artifact/node_modules/@octokit/request-error": {
|
||||
"version": "7.1.0",
|
||||
"resolved": "https://registry.npmjs.org/@octokit/request-error/-/request-error-7.1.0.tgz",
|
||||
"integrity": "sha512-KMQIfq5sOPpkQYajXHwnhjCC0slzCNScLHs9JafXc4RAJI+9f+jNDlBNaIMTvazOPLgb4BnlhGJOTbnN0wIjPw==",
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"@octokit/types": "^16.0.0"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">= 20"
|
||||
}
|
||||
},
|
||||
"node_modules/@actions/artifact/node_modules/before-after-hook": {
|
||||
"version": "4.0.0",
|
||||
"license": "Apache-2.0"
|
||||
@@ -227,6 +269,19 @@
|
||||
"node": ">= 20"
|
||||
}
|
||||
},
|
||||
"node_modules/@actions/github/node_modules/@octokit/endpoint": {
|
||||
"version": "11.0.3",
|
||||
"resolved": "https://registry.npmjs.org/@octokit/endpoint/-/endpoint-11.0.3.tgz",
|
||||
"integrity": "sha512-FWFlNxghg4HrXkD3ifYbS/IdL/mDHjh9QcsNyhQjN8dplUoZbejsdpmuqdA76nxj2xoWPs7p8uX2SNr9rYu0Ag==",
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"@octokit/types": "^16.0.0",
|
||||
"universal-user-agent": "^7.0.2"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">= 20"
|
||||
}
|
||||
},
|
||||
"node_modules/@actions/github/node_modules/@octokit/graphql": {
|
||||
"version": "9.0.3",
|
||||
"license": "MIT",
|
||||
@@ -239,6 +294,21 @@
|
||||
"node": ">= 20"
|
||||
}
|
||||
},
|
||||
"node_modules/@actions/github/node_modules/@octokit/plugin-paginate-rest": {
|
||||
"version": "14.0.0",
|
||||
"resolved": "https://registry.npmjs.org/@octokit/plugin-paginate-rest/-/plugin-paginate-rest-14.0.0.tgz",
|
||||
"integrity": "sha512-fNVRE7ufJiAA3XUrha2omTA39M6IXIc6GIZLvlbsm8QOQCYvpq/LkMNGyFlB1d8hTDzsAXa3OKtybdMAYsV/fw==",
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"@octokit/types": "^16.0.0"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">= 20"
|
||||
},
|
||||
"peerDependencies": {
|
||||
"@octokit/core": ">=6"
|
||||
}
|
||||
},
|
||||
"node_modules/@actions/github/node_modules/@octokit/plugin-rest-endpoint-methods": {
|
||||
"version": "17.0.0",
|
||||
"license": "MIT",
|
||||
@@ -252,6 +322,35 @@
|
||||
"@octokit/core": ">=6"
|
||||
}
|
||||
},
|
||||
"node_modules/@actions/github/node_modules/@octokit/request": {
|
||||
"version": "10.0.10",
|
||||
"resolved": "https://registry.npmjs.org/@octokit/request/-/request-10.0.10.tgz",
|
||||
"integrity": "sha512-KxNC2pTqqhszMNrf12ZRd4PonRgyJdsM4F/jySiddQK+DsRcfBtUvqn8t7UsyZhnRJHvX46OohDt5N3VqIWC2w==",
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"@octokit/endpoint": "^11.0.3",
|
||||
"@octokit/request-error": "^7.0.2",
|
||||
"@octokit/types": "^16.0.0",
|
||||
"content-type": "^2.0.0",
|
||||
"json-with-bigint": "^3.5.3",
|
||||
"universal-user-agent": "^7.0.2"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">= 20"
|
||||
}
|
||||
},
|
||||
"node_modules/@actions/github/node_modules/@octokit/request-error": {
|
||||
"version": "7.1.0",
|
||||
"resolved": "https://registry.npmjs.org/@octokit/request-error/-/request-error-7.1.0.tgz",
|
||||
"integrity": "sha512-KMQIfq5sOPpkQYajXHwnhjCC0slzCNScLHs9JafXc4RAJI+9f+jNDlBNaIMTvazOPLgb4BnlhGJOTbnN0wIjPw==",
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"@octokit/types": "^16.0.0"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">= 20"
|
||||
}
|
||||
},
|
||||
"node_modules/@actions/github/node_modules/before-after-hook": {
|
||||
"version": "4.0.0",
|
||||
"license": "Apache-2.0"
|
||||
@@ -520,13 +619,16 @@
|
||||
}
|
||||
},
|
||||
"node_modules/@azure/logger": {
|
||||
"version": "1.1.4",
|
||||
"version": "1.3.0",
|
||||
"resolved": "https://registry.npmjs.org/@azure/logger/-/logger-1.3.0.tgz",
|
||||
"integrity": "sha512-fCqPIfOcLE+CGqGPd66c8bZpwAji98tZ4JI9i/mlTNTlsIWslCfpg48s/ypyLxZTump5sypjrKn2/kY7q8oAbA==",
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"@typespec/ts-http-runtime": "^0.3.0",
|
||||
"tslib": "^2.6.2"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=18.0.0"
|
||||
"node": ">=20.0.0"
|
||||
}
|
||||
},
|
||||
"node_modules/@azure/storage-blob": {
|
||||
@@ -1793,167 +1895,10 @@
|
||||
],
|
||||
"license": "MIT"
|
||||
},
|
||||
"node_modules/@octokit/auth-token": {
|
||||
"version": "4.0.0",
|
||||
"license": "MIT",
|
||||
"peer": true,
|
||||
"engines": {
|
||||
"node": ">= 18"
|
||||
}
|
||||
},
|
||||
"node_modules/@octokit/core": {
|
||||
"version": "5.2.1",
|
||||
"license": "MIT",
|
||||
"peer": true,
|
||||
"dependencies": {
|
||||
"@octokit/auth-token": "^4.0.0",
|
||||
"@octokit/graphql": "^7.1.0",
|
||||
"@octokit/request": "^8.4.1",
|
||||
"@octokit/request-error": "^5.1.1",
|
||||
"@octokit/types": "^13.0.0",
|
||||
"before-after-hook": "^2.2.0",
|
||||
"universal-user-agent": "^6.0.0"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">= 18"
|
||||
}
|
||||
},
|
||||
"node_modules/@octokit/core/node_modules/@octokit/openapi-types": {
|
||||
"version": "24.2.0",
|
||||
"license": "MIT",
|
||||
"peer": true
|
||||
},
|
||||
"node_modules/@octokit/core/node_modules/@octokit/types": {
|
||||
"version": "13.10.0",
|
||||
"license": "MIT",
|
||||
"peer": true,
|
||||
"dependencies": {
|
||||
"@octokit/openapi-types": "^24.2.0"
|
||||
}
|
||||
},
|
||||
"node_modules/@octokit/endpoint": {
|
||||
"version": "9.0.6",
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"@octokit/types": "^13.1.0",
|
||||
"universal-user-agent": "^6.0.0"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">= 18"
|
||||
}
|
||||
},
|
||||
"node_modules/@octokit/endpoint/node_modules/@octokit/openapi-types": {
|
||||
"version": "24.2.0",
|
||||
"license": "MIT"
|
||||
},
|
||||
"node_modules/@octokit/endpoint/node_modules/@octokit/types": {
|
||||
"version": "13.10.0",
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"@octokit/openapi-types": "^24.2.0"
|
||||
}
|
||||
},
|
||||
"node_modules/@octokit/graphql": {
|
||||
"version": "7.1.1",
|
||||
"license": "MIT",
|
||||
"peer": true,
|
||||
"dependencies": {
|
||||
"@octokit/request": "^8.4.1",
|
||||
"@octokit/types": "^13.0.0",
|
||||
"universal-user-agent": "^6.0.0"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">= 18"
|
||||
}
|
||||
},
|
||||
"node_modules/@octokit/graphql/node_modules/@octokit/openapi-types": {
|
||||
"version": "24.2.0",
|
||||
"license": "MIT",
|
||||
"peer": true
|
||||
},
|
||||
"node_modules/@octokit/graphql/node_modules/@octokit/types": {
|
||||
"version": "13.10.0",
|
||||
"license": "MIT",
|
||||
"peer": true,
|
||||
"dependencies": {
|
||||
"@octokit/openapi-types": "^24.2.0"
|
||||
}
|
||||
},
|
||||
"node_modules/@octokit/openapi-types": {
|
||||
"version": "27.0.0",
|
||||
"license": "MIT"
|
||||
},
|
||||
"node_modules/@octokit/plugin-paginate-rest": {
|
||||
"version": "9.2.2",
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"@octokit/types": "^12.6.0"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">= 18"
|
||||
},
|
||||
"peerDependencies": {
|
||||
"@octokit/core": "5"
|
||||
}
|
||||
},
|
||||
"node_modules/@octokit/plugin-paginate-rest/node_modules/@octokit/openapi-types": {
|
||||
"version": "20.0.0",
|
||||
"license": "MIT"
|
||||
},
|
||||
"node_modules/@octokit/plugin-paginate-rest/node_modules/@octokit/types": {
|
||||
"version": "12.6.0",
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"@octokit/openapi-types": "^20.0.0"
|
||||
}
|
||||
},
|
||||
"node_modules/@octokit/request": {
|
||||
"version": "8.4.1",
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"@octokit/endpoint": "^9.0.6",
|
||||
"@octokit/request-error": "^5.1.1",
|
||||
"@octokit/types": "^13.1.0",
|
||||
"universal-user-agent": "^6.0.0"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">= 18"
|
||||
}
|
||||
},
|
||||
"node_modules/@octokit/request-error": {
|
||||
"version": "5.1.1",
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"@octokit/types": "^13.1.0",
|
||||
"deprecation": "^2.0.0",
|
||||
"once": "^1.4.0"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">= 18"
|
||||
}
|
||||
},
|
||||
"node_modules/@octokit/request-error/node_modules/@octokit/openapi-types": {
|
||||
"version": "24.2.0",
|
||||
"license": "MIT"
|
||||
},
|
||||
"node_modules/@octokit/request-error/node_modules/@octokit/types": {
|
||||
"version": "13.10.0",
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"@octokit/openapi-types": "^24.2.0"
|
||||
}
|
||||
},
|
||||
"node_modules/@octokit/request/node_modules/@octokit/openapi-types": {
|
||||
"version": "24.2.0",
|
||||
"license": "MIT"
|
||||
},
|
||||
"node_modules/@octokit/request/node_modules/@octokit/types": {
|
||||
"version": "13.10.0",
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"@octokit/openapi-types": "^24.2.0"
|
||||
}
|
||||
},
|
||||
"node_modules/@octokit/types": {
|
||||
"version": "16.0.0",
|
||||
"license": "MIT",
|
||||
@@ -3210,11 +3155,6 @@
|
||||
],
|
||||
"license": "MIT"
|
||||
},
|
||||
"node_modules/before-after-hook": {
|
||||
"version": "2.2.3",
|
||||
"license": "Apache-2.0",
|
||||
"peer": true
|
||||
},
|
||||
"node_modules/binary": {
|
||||
"version": "0.3.0",
|
||||
"license": "MIT",
|
||||
@@ -3640,6 +3580,19 @@
|
||||
"version": "0.0.1",
|
||||
"license": "MIT"
|
||||
},
|
||||
"node_modules/content-type": {
|
||||
"version": "2.0.0",
|
||||
"resolved": "https://registry.npmjs.org/content-type/-/content-type-2.0.0.tgz",
|
||||
"integrity": "sha512-j/O/d7GcZCyNl7/hwZAb606rzqkyvaDctLmckbxLzHvFBzTJHuGEdodATcP3yIRoDrLHkIATJuvzbFlp/ki2cQ==",
|
||||
"license": "MIT",
|
||||
"engines": {
|
||||
"node": ">=18"
|
||||
},
|
||||
"funding": {
|
||||
"type": "opencollective",
|
||||
"url": "https://opencollective.com/express"
|
||||
}
|
||||
},
|
||||
"node_modules/convert-source-map": {
|
||||
"version": "2.0.0",
|
||||
"dev": true,
|
||||
@@ -3848,10 +3801,6 @@
|
||||
"url": "https://github.com/sponsors/ljharb"
|
||||
}
|
||||
},
|
||||
"node_modules/deprecation": {
|
||||
"version": "2.3.1",
|
||||
"license": "ISC"
|
||||
},
|
||||
"node_modules/detect-newline": {
|
||||
"version": "3.1.0",
|
||||
"resolved": "https://registry.npmjs.org/detect-newline/-/detect-newline-3.1.0.tgz",
|
||||
@@ -6246,6 +6195,12 @@
|
||||
"dev": true,
|
||||
"license": "ISC"
|
||||
},
|
||||
"node_modules/json-with-bigint": {
|
||||
"version": "3.5.8",
|
||||
"resolved": "https://registry.npmjs.org/json-with-bigint/-/json-with-bigint-3.5.8.tgz",
|
||||
"integrity": "sha512-eq/4KP6K34kwa7TcFdtvnftvHCD9KvHOGGICWwMFc4dOOKF5t4iYqnfLK8otCRCRv06FXOzGGyqE8h8ElMvvdw==",
|
||||
"license": "MIT"
|
||||
},
|
||||
"node_modules/json5": {
|
||||
"version": "2.2.3",
|
||||
"dev": true,
|
||||
@@ -6803,6 +6758,7 @@
|
||||
},
|
||||
"node_modules/once": {
|
||||
"version": "1.4.0",
|
||||
"dev": true,
|
||||
"license": "ISC",
|
||||
"dependencies": {
|
||||
"wrappy": "1"
|
||||
@@ -8385,10 +8341,6 @@
|
||||
"version": "1.0.6",
|
||||
"license": "MIT"
|
||||
},
|
||||
"node_modules/universal-user-agent": {
|
||||
"version": "6.0.1",
|
||||
"license": "ISC"
|
||||
},
|
||||
"node_modules/unrs-resolver": {
|
||||
"version": "1.12.2",
|
||||
"resolved": "https://registry.npmjs.org/unrs-resolver/-/unrs-resolver-1.12.2.tgz",
|
||||
@@ -8714,6 +8666,7 @@
|
||||
},
|
||||
"node_modules/wrappy": {
|
||||
"version": "1.0.2",
|
||||
"dev": true,
|
||||
"license": "ISC"
|
||||
},
|
||||
"node_modules/write-file-atomic": {
|
||||
|
||||
@@ -68,17 +68,5 @@
|
||||
"prettier": "3.8.4",
|
||||
"ts-jest": "29.4.11",
|
||||
"typescript": "5.9.3"
|
||||
},
|
||||
"overrides": {
|
||||
"@azure/logger": "1.1.4",
|
||||
"@octokit/request": "8.4.1",
|
||||
"@octokit/request-error": "5.1.1",
|
||||
"@octokit/plugin-paginate-rest": "9.2.2",
|
||||
"shell-quote": "1.8.4",
|
||||
"fast-xml-parser": "5.8.0",
|
||||
"fast-xml-builder": "1.2.0",
|
||||
"eslint": {
|
||||
"brace-expansion": "5.0.6"
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -44,9 +44,9 @@ export class BasicCacheService implements CacheService {
|
||||
if (cacheOptions.readOnly) {
|
||||
const restoredKey = core.getState(RESTORED_KEY_STATE)
|
||||
if (restoredKey) {
|
||||
return `Basic caching was read-only. Restored from cache key \`${restoredKey}\`.`
|
||||
return `Basic caching was read-only. Restored from cache key \`${restoredKey}\`.\n`
|
||||
}
|
||||
return 'Basic caching was read-only. No cache entry was found to restore.'
|
||||
return 'Basic caching was read-only. No cache entry was found to restore.\n'
|
||||
}
|
||||
|
||||
const primaryKey = core.getState(PRIMARY_KEY_STATE)
|
||||
@@ -54,7 +54,7 @@ export class BasicCacheService implements CacheService {
|
||||
|
||||
if (restoredKey === primaryKey) {
|
||||
core.info(`Basic caching restored entry with key \`${primaryKey}\`. Save was skipped.`)
|
||||
return `Basic caching restored entry with key \`${primaryKey}\`. Save was skipped.`
|
||||
return `Basic caching restored entry with key \`${primaryKey}\`. Save was skipped.\n`
|
||||
}
|
||||
|
||||
const cachePaths = getCachePaths(gradleUserHome)
|
||||
@@ -62,10 +62,10 @@ export class BasicCacheService implements CacheService {
|
||||
try {
|
||||
await cache.saveCache(cachePaths, primaryKey)
|
||||
core.info(`Basic caching saved entry with key: ${primaryKey}`)
|
||||
return `Basic caching saved entry with key \`${primaryKey}\`.`
|
||||
return `Basic caching saved entry with key \`${primaryKey}\`.\n`
|
||||
} catch (error) {
|
||||
core.warning(`Basic caching failed to save entry with key \`${primaryKey}\`: ${error}`)
|
||||
return `Basic caching save failed: ${error}`
|
||||
return `Basic caching save failed: ${error}\n`
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -14,21 +14,17 @@ const NOOP_CACHING_REPORT = `
|
||||
const ENHANCED_CACHE_MESSAGE = `Enhanced Caching: This build is using the proprietary 'gradle-actions-caching' provider for optimized caching support. See https://github.com/gradle/actions/blob/main/DISTRIBUTION.md for terms of use and opt-out instructions.`
|
||||
|
||||
const ENHANCED_CACHE_SUMMARY = `
|
||||
> [!NOTE]
|
||||
> ### ⚡️ Enhanced Caching enabled
|
||||
> This build provides optimized caching support via the proprietary **gradle-actions-caching** provider.
|
||||
> **⚡️ [Enhanced Caching](https://github.com/gradle/actions/blob/main/docs/setup-gradle.md#enhanced-caching)** This build provides optimized caching support via the proprietary **gradle-actions-caching** provider.
|
||||
> See [DISTRIBUTION.md](https://github.com/gradle/actions/blob/main/DISTRIBUTION.md) for terms of use and opt-out instructions.
|
||||
`
|
||||
|
||||
const BASIC_CACHE_MESSAGE = `Basic Caching: This build uses the open-source caching provider for reliable, path-based caching of Gradle dependencies. Upgrade available: for faster builds and advanced features, consider switching to the Enhanced Caching provider. See https://github.com/gradle/actions/blob/main/DISTRIBUTION.md for details.`
|
||||
const BASIC_CACHE_MESSAGE = `Basic Caching: This build uses the basic open-source caching provider. For faster builds and advanced features, consider switching to the Enhanced Caching provider. See https://github.com/gradle/actions/blob/main/DISTRIBUTION.md for details.`
|
||||
|
||||
const BASIC_CACHE_SUMMARY = `
|
||||
> [!NOTE]
|
||||
> ### 🛡️ Basic Caching enabled
|
||||
> This build uses the open-source caching provider for reliable, path-based caching of Gradle dependencies.
|
||||
>
|
||||
> **Upgrade Available:** For faster builds and advanced features, consider switching to the **Enhanced Caching** provider.
|
||||
> See [DISTRIBUTION.md](https://github.com/gradle/actions/blob/main/DISTRIBUTION.md) for details.`
|
||||
> **🛡️ [Basic Caching](https://github.com/gradle/actions/blob/main/docs/setup-gradle.md#basic-caching)** This build uses the basic open-source caching provider.
|
||||
> For faster builds and advanced features, consider switching to the **[Enhanced Caching](https://github.com/gradle/actions/blob/main/docs/setup-gradle.md#enhanced-caching)** provider.
|
||||
> See [DISTRIBUTION.md](https://github.com/gradle/actions/blob/main/DISTRIBUTION.md) for details.
|
||||
`
|
||||
|
||||
class NoOpCacheService implements CacheService {
|
||||
async restore(_gradleUserHome: string, _cacheOptions: CacheOptions): Promise<void> {
|
||||
|
||||
@@ -206,6 +206,10 @@ export class SummaryConfig {
|
||||
return this.shouldAddJobSummary(this.getJobSummaryOption(), hasFailure)
|
||||
}
|
||||
|
||||
canAddPRComment(): boolean {
|
||||
return this.getPRCommentOption() !== JobSummaryOption.Never
|
||||
}
|
||||
|
||||
shouldAddPRComment(hasFailure: boolean): boolean {
|
||||
return this.shouldAddJobSummary(this.getPRCommentOption(), hasFailure)
|
||||
}
|
||||
|
||||
@@ -2,7 +2,7 @@ import * as core from '@actions/core'
|
||||
import * as github from '@actions/github'
|
||||
|
||||
import {BuildResult} from './build-results'
|
||||
import {SummaryConfig, getActionId, getGithubToken} from './configuration'
|
||||
import {DependencyGraphConfig, getActionId, getGithubToken, getJobMatrix, SummaryConfig} from './configuration'
|
||||
import {Deprecation, getDeprecations, getErrors} from './deprecation-collector'
|
||||
|
||||
export async function generateJobSummary(
|
||||
@@ -33,6 +33,10 @@ export async function generateJobSummary(
|
||||
core.info('============================')
|
||||
}
|
||||
|
||||
if (config.canAddPRComment()) {
|
||||
await minimizeObsoletePRComments()
|
||||
}
|
||||
|
||||
if (config.shouldAddPRComment(hasFailure)) {
|
||||
await addPRComment(summaryTable)
|
||||
}
|
||||
@@ -48,7 +52,8 @@ async function addPRComment(jobSummary: string): Promise<void> {
|
||||
const pull_request_number = context.payload.pull_request.number
|
||||
core.info(`Adding Job Summary as comment to PR #${pull_request_number}.`)
|
||||
|
||||
const prComment = `<h3>Job Summary for Gradle</h3>
|
||||
const prComment = `${jobMarker(context)}
|
||||
<h3>Job Summary for Gradle</h3>
|
||||
<a href="${context.serverUrl}/${context.repo.owner}/${context.repo.repo}/actions/runs/${context.runId}" target="_blank">
|
||||
<h5>${context.workflow} :: <em>${context.job}</em></h5>
|
||||
</a>
|
||||
@@ -57,6 +62,7 @@ ${jobSummary}`
|
||||
|
||||
const github_token = getGithubToken()
|
||||
const octokit = github.getOctokit(github_token)
|
||||
|
||||
try {
|
||||
await octokit.rest.issues.createComment({
|
||||
...context.repo,
|
||||
@@ -201,3 +207,77 @@ function truncateString(str: string, maxLength: number): string {
|
||||
return str
|
||||
}
|
||||
}
|
||||
|
||||
async function minimizeObsoletePRComments(): Promise<void> {
|
||||
const context = github.context
|
||||
if (context.payload.pull_request == null) {
|
||||
core.info('No pull_request trigger detected: not minimizing obsolete PR comments')
|
||||
return
|
||||
}
|
||||
|
||||
const prNumber = context.payload.pull_request.number
|
||||
core.info(`Minimizing obsolete Job Summary comments on PR #${prNumber}.`)
|
||||
|
||||
const marker = jobMarker(context)
|
||||
const octokit = github.getOctokit(getGithubToken())
|
||||
const {owner, repo} = context.repo
|
||||
|
||||
const query = `
|
||||
query($owner: String!, $repo: String!, $prNumber: Int!) {
|
||||
repository(owner: $owner, name: $repo) {
|
||||
pullRequest(number: $prNumber) {
|
||||
comments(last: 100) {
|
||||
nodes { id body isMinimized url }
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
`
|
||||
let comments: PullRequestComment[]
|
||||
try {
|
||||
const {repository} = await octokit.graphql<CommentsQueryResult>(query, {owner, repo, prNumber})
|
||||
comments = repository.pullRequest?.comments?.nodes?.filter((c): c is PullRequestComment => c !== null) ?? []
|
||||
} catch (error) {
|
||||
return core.warning(`Failed to fetch comments: ${error}`)
|
||||
}
|
||||
|
||||
const mutation = `
|
||||
mutation($id: ID!) {
|
||||
minimizeComment(input: {subjectId: $id, classifier: OUTDATED}) {
|
||||
clientMutationId
|
||||
}
|
||||
}
|
||||
`
|
||||
|
||||
const commentsToMinimize = comments
|
||||
.filter(c => !c.isMinimized && c.body.includes(marker))
|
||||
.map(async c =>
|
||||
octokit
|
||||
.graphql(mutation, {id: c.id})
|
||||
.then(() => core.info(`Successfully minimized (id:${c.id}, url:${c.url})`))
|
||||
.catch(e => core.warning(`Failed to minimize (id:${c.id}, url:${c.url}, error:${e?.message || e})`))
|
||||
)
|
||||
await Promise.allSettled(commentsToMinimize)
|
||||
}
|
||||
|
||||
export function jobMarker(context: typeof github.context): string {
|
||||
const jobCorrelator = DependencyGraphConfig.constructJobCorrelator(context.workflow, context.job, getJobMatrix())
|
||||
return `<!-- gradle-job-summary: ${jobCorrelator} -->`
|
||||
}
|
||||
|
||||
interface PullRequestComment {
|
||||
id: string
|
||||
body: string
|
||||
isMinimized: boolean
|
||||
url: string
|
||||
}
|
||||
|
||||
interface CommentsQueryResult {
|
||||
repository: {
|
||||
pullRequest?: {
|
||||
comments?: {
|
||||
nodes?: (PullRequestComment | null)[] | null
|
||||
} | null
|
||||
} | null
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,8 +1,15 @@
|
||||
import dedent from 'dedent'
|
||||
import {describe, expect, it} from '@jest/globals'
|
||||
import * as github from '@actions/github'
|
||||
import {afterEach, describe, expect, it} from '@jest/globals'
|
||||
|
||||
import {BuildResult} from '../../src/build-results'
|
||||
import {renderSummaryTable} from '../../src/job-summary'
|
||||
import {jobMarker, renderSummaryTable} from '../../src/job-summary'
|
||||
|
||||
const MATRIX_INPUT_ENV = 'INPUT_WORKFLOW-JOB-CONTEXT'
|
||||
|
||||
function fakeContext(workflow: string, job: string): typeof github.context {
|
||||
return {workflow, job} as unknown as typeof github.context
|
||||
}
|
||||
|
||||
const successfulHelpBuild: BuildResult = {
|
||||
rootProjectName: 'root',
|
||||
@@ -177,3 +184,27 @@ describe('renderSummaryTable', () => {
|
||||
})
|
||||
})
|
||||
})
|
||||
|
||||
describe('jobMarker', () => {
|
||||
const original = process.env[MATRIX_INPUT_ENV]
|
||||
|
||||
afterEach(() => {
|
||||
if (original === undefined) {
|
||||
delete process.env[MATRIX_INPUT_ENV]
|
||||
} else {
|
||||
process.env[MATRIX_INPUT_ENV] = original
|
||||
}
|
||||
})
|
||||
|
||||
it('builds a hidden marker from the workflow and job', () => {
|
||||
process.env[MATRIX_INPUT_ENV] = 'null'
|
||||
const marker = jobMarker(fakeContext('CI', 'build'))
|
||||
expect(marker).toBe('<!-- gradle-job-summary: ci-build -->')
|
||||
})
|
||||
|
||||
it('includes the job matrix in the marker', () => {
|
||||
process.env[MATRIX_INPUT_ENV] = JSON.stringify({os: 'ubuntu', java: '17'})
|
||||
const marker = jobMarker(fakeContext('CI', 'build'))
|
||||
expect(marker).toBe('<!-- gradle-job-summary: ci-build-ubuntu-17 -->')
|
||||
})
|
||||
})
|
||||
|
||||
+1
-1
@@ -18,7 +18,7 @@ export declare interface CacheOptions {
|
||||
writeOnly: boolean;
|
||||
overwriteExisting: boolean;
|
||||
strictMatch: boolean;
|
||||
cleanup: string;
|
||||
cleanup: 'always' | 'on-success' | 'never';
|
||||
encryptionKey?: string;
|
||||
includes: string[];
|
||||
excludes: string[];
|
||||
|
||||
+2
-1
File diff suppressed because one or more lines are too long
+1
-1
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "gradle-actions-caching",
|
||||
"version": "0.3.0",
|
||||
"version": "0.6.0",
|
||||
"type": "module",
|
||||
"main": "./index.js",
|
||||
"types": "./index.d.ts",
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
"toolPackages": [
|
||||
{
|
||||
"packageName": "@microsoft/api-extractor",
|
||||
"packageVersion": "7.57.6"
|
||||
"packageVersion": "7.58.8"
|
||||
}
|
||||
]
|
||||
}
|
||||
|
||||
@@ -14,4 +14,7 @@ inputs:
|
||||
|
||||
outputs:
|
||||
failed-wrapper:
|
||||
type: string
|
||||
type: list
|
||||
separator: '|'
|
||||
list-item:
|
||||
type: string
|
||||
|
||||
Reference in New Issue
Block a user