mirror of
https://github.com/gradle/actions.git
synced 2026-08-19 04:12:51 +00:00
Compare commits
8
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
528e626588 | ||
|
|
3711048846 | ||
|
|
4318659b28 | ||
|
|
79b19cd50f | ||
|
|
9d31058114 | ||
|
|
0088877924 | ||
|
|
ff4dbcd5fa | ||
|
|
6550634d3e |
@@ -3,3 +3,6 @@
|
|||||||
|
|
||||||
# Ignore Gradle build output directory
|
# Ignore Gradle build output directory
|
||||||
build
|
build
|
||||||
|
|
||||||
|
# Marker file written when the 'test' task is configured
|
||||||
|
task-configured.txt
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
distributionBase=GRADLE_USER_HOME
|
distributionBase=GRADLE_USER_HOME
|
||||||
distributionPath=wrapper/dists
|
distributionPath=wrapper/dists
|
||||||
distributionSha256Sum=bbaeb2fef8710818cf0e261201dab964c572f92b942812df0c3620d62a529a01
|
distributionSha256Sum=bafc141b619ad6350fd975fc903156dd5c151998cc8b058e8c1044ab5f7b031f
|
||||||
distributionUrl=https\://services.gradle.org/distributions/gradle-9.6.0-bin.zip
|
distributionUrl=https\://services.gradle.org/distributions/gradle-9.5.1-bin.zip
|
||||||
networkTimeout=10000
|
networkTimeout=10000
|
||||||
retries=0
|
retries=0
|
||||||
retryBackOffMs=500
|
retryBackOffMs=500
|
||||||
|
|||||||
@@ -20,7 +20,7 @@
|
|||||||
|
|
||||||
##############################################################################
|
##############################################################################
|
||||||
#
|
#
|
||||||
# gradlew start up script for POSIX generated by Gradle.
|
# Gradle start up script for POSIX generated by Gradle.
|
||||||
#
|
#
|
||||||
# Important for running:
|
# Important for running:
|
||||||
#
|
#
|
||||||
@@ -29,7 +29,7 @@
|
|||||||
# bash, then to run this script, type that shell name before the whole
|
# bash, then to run this script, type that shell name before the whole
|
||||||
# command line, like:
|
# command line, like:
|
||||||
#
|
#
|
||||||
# ksh gradlew
|
# ksh Gradle
|
||||||
#
|
#
|
||||||
# Busybox and similar reduced shells will NOT work, because this script
|
# Busybox and similar reduced shells will NOT work, because this script
|
||||||
# requires all of these POSIX shell features:
|
# requires all of these POSIX shell features:
|
||||||
|
|||||||
@@ -19,7 +19,7 @@
|
|||||||
@if "%DEBUG%"=="" @echo off
|
@if "%DEBUG%"=="" @echo off
|
||||||
@rem ##########################################################################
|
@rem ##########################################################################
|
||||||
@rem
|
@rem
|
||||||
@rem gradlew startup script for Windows
|
@rem Gradle startup script for Windows
|
||||||
@rem
|
@rem
|
||||||
@rem ##########################################################################
|
@rem ##########################################################################
|
||||||
|
|
||||||
@@ -72,7 +72,7 @@ echo location of your Java installation. 1>&2
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
@rem Execute gradlew
|
@rem Execute Gradle
|
||||||
@rem endlocal doesn't take effect until after the line is parsed and variables are expanded
|
@rem endlocal doesn't take effect until after the line is parsed and variables are expanded
|
||||||
@rem which allows us to clear the local environment before executing the java command
|
@rem which allows us to clear the local environment before executing the java command
|
||||||
endlocal & "%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -jar "%APP_HOME%\gradle\wrapper\gradle-wrapper.jar" %* & call :exitWithErrorLevel
|
endlocal & "%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -jar "%APP_HOME%\gradle\wrapper\gradle-wrapper.jar" %* & call :exitWithErrorLevel
|
||||||
|
|||||||
@@ -14,6 +14,16 @@ permissions:
|
|||||||
contents: read
|
contents: read
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
|
smoke-tests:
|
||||||
|
uses: ./.github/workflows/suite-smoke-test-caching.yml
|
||||||
|
concurrency:
|
||||||
|
group: CI-smoke-test-caching
|
||||||
|
cancel-in-progress: false
|
||||||
|
with:
|
||||||
|
skip-dist: true
|
||||||
|
runner-os: '["ubuntu-latest", "windows-latest"]'
|
||||||
|
secrets: inherit
|
||||||
|
|
||||||
caching-integ-tests:
|
caching-integ-tests:
|
||||||
uses: ./.github/workflows/suite-integ-test-caching.yml
|
uses: ./.github/workflows/suite-integ-test-caching.yml
|
||||||
concurrency:
|
concurrency:
|
||||||
|
|||||||
@@ -21,9 +21,19 @@ jobs:
|
|||||||
- name: Checkout sources
|
- name: Checkout sources
|
||||||
uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6.0.3
|
uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6.0.3
|
||||||
- name: Build and upload distribution
|
- name: Build and upload distribution
|
||||||
if: ${{ needs.determine-suite.outputs.suite != 'full' }}
|
|
||||||
uses: ./.github/actions/build-dist
|
uses: ./.github/actions/build-dist
|
||||||
|
|
||||||
|
smoke-tests:
|
||||||
|
needs: build-distribution
|
||||||
|
uses: ./.github/workflows/suite-smoke-test-caching.yml
|
||||||
|
concurrency:
|
||||||
|
group: CI-smoke-test-caching-${{ github.ref }}
|
||||||
|
cancel-in-progress: false
|
||||||
|
with:
|
||||||
|
skip-dist: false
|
||||||
|
runner-os: '["ubuntu-latest", "windows-latest"]'
|
||||||
|
secrets: inherit
|
||||||
|
|
||||||
caching-integ-tests:
|
caching-integ-tests:
|
||||||
needs: build-distribution
|
needs: build-distribution
|
||||||
uses: ./.github/workflows/suite-integ-test-caching.yml
|
uses: ./.github/workflows/suite-integ-test-caching.yml
|
||||||
@@ -64,6 +74,7 @@ jobs:
|
|||||||
if: ${{ always() }}
|
if: ${{ always() }}
|
||||||
needs:
|
needs:
|
||||||
- build-distribution
|
- build-distribution
|
||||||
|
- smoke-tests
|
||||||
- caching-integ-tests
|
- caching-integ-tests
|
||||||
- other-integ-tests
|
- other-integ-tests
|
||||||
- dependency-submission-integ-tests
|
- dependency-submission-integ-tests
|
||||||
@@ -74,6 +85,7 @@ jobs:
|
|||||||
run: |
|
run: |
|
||||||
echo "One or more integ-test jobs did not succeed:"
|
echo "One or more integ-test jobs did not succeed:"
|
||||||
echo " build-distribution: ${{ needs.build-distribution.result }}"
|
echo " build-distribution: ${{ needs.build-distribution.result }}"
|
||||||
|
echo " smoke-tests: ${{ needs.smoke-tests.result }}"
|
||||||
echo " caching-integ-tests: ${{ needs.caching-integ-tests.result }}"
|
echo " caching-integ-tests: ${{ needs.caching-integ-tests.result }}"
|
||||||
echo " other-integ-tests: ${{ needs.other-integ-tests.result }}"
|
echo " other-integ-tests: ${{ needs.other-integ-tests.result }}"
|
||||||
echo " dependency-submission-integ-tests: ${{ needs.dependency-submission-integ-tests.result }}"
|
echo " dependency-submission-integ-tests: ${{ needs.dependency-submission-integ-tests.result }}"
|
||||||
|
|||||||
@@ -43,29 +43,6 @@ jobs:
|
|||||||
working-directory: .github/workflow-samples/groovy-dsl
|
working-directory: .github/workflow-samples/groovy-dsl
|
||||||
run: ./gradlew test
|
run: ./gradlew test
|
||||||
|
|
||||||
# Test that the gradle-user-home cache will cache dependencies, by running build with --offline
|
|
||||||
restore-gradle-home-dependencies-cache:
|
|
||||||
needs: restore-gradle-home-seed-build
|
|
||||||
strategy:
|
|
||||||
max-parallel: 1
|
|
||||||
fail-fast: false
|
|
||||||
matrix:
|
|
||||||
os: ${{fromJSON(inputs.runner-os)}}
|
|
||||||
runs-on: ${{ matrix.os }}
|
|
||||||
steps:
|
|
||||||
- name: Checkout sources
|
|
||||||
uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6.0.3
|
|
||||||
- name: Initialize integ-test
|
|
||||||
uses: ./.github/actions/init-integ-test
|
|
||||||
|
|
||||||
- name: Setup Gradle
|
|
||||||
uses: ./setup-gradle
|
|
||||||
with:
|
|
||||||
cache-read-only: true
|
|
||||||
- name: Execute Gradle build with --offline
|
|
||||||
working-directory: .github/workflow-samples/groovy-dsl
|
|
||||||
run: ./gradlew test --offline
|
|
||||||
|
|
||||||
# Test that the gradle-user-home cache will cache and restore local build-cache
|
# Test that the gradle-user-home cache will cache and restore local build-cache
|
||||||
restore-gradle-home-build-cache:
|
restore-gradle-home-build-cache:
|
||||||
needs: restore-gradle-home-seed-build
|
needs: restore-gradle-home-seed-build
|
||||||
@@ -114,15 +91,16 @@ jobs:
|
|||||||
working-directory: .github/workflow-samples/groovy-dsl
|
working-directory: .github/workflow-samples/groovy-dsl
|
||||||
run: ./gradlew test
|
run: ./gradlew test
|
||||||
|
|
||||||
# Test that a pre-existing gradle-user-home can be overwritten by the restored cache
|
# Test that a pre-existing gradle-user-home can be overwritten by the restored cache.
|
||||||
|
#
|
||||||
|
# Deliberately not run against the 'runner-os' matrix: creating ~/.gradle up-front is precisely
|
||||||
|
# what stops setup-gradle relocating the Gradle User Home to D:\a\.gradle on Windows, so this job
|
||||||
|
# would look for a cache entry rooted at a different path than the one the seed build saved.
|
||||||
|
# Cache entries are identified by key *and* by a version derived from the cache paths, so that
|
||||||
|
# never matches.
|
||||||
restore-gradle-home-pre-existing-gradle-home:
|
restore-gradle-home-pre-existing-gradle-home:
|
||||||
needs: restore-gradle-home-seed-build
|
needs: restore-gradle-home-seed-build
|
||||||
strategy:
|
runs-on: ubuntu-latest
|
||||||
max-parallel: 1
|
|
||||||
fail-fast: false
|
|
||||||
matrix:
|
|
||||||
os: ${{fromJSON(inputs.runner-os)}}
|
|
||||||
runs-on: ${{ matrix.os }}
|
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout sources
|
- name: Checkout sources
|
||||||
uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6.0.3
|
uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6.0.3
|
||||||
|
|||||||
+4
-1
@@ -39,9 +39,12 @@ jobs:
|
|||||||
with:
|
with:
|
||||||
cache-provider: basic
|
cache-provider: basic
|
||||||
cache-read-only: false # For testing, allow writing cache entries on non-default branches
|
cache-read-only: false # For testing, allow writing cache entries on non-default branches
|
||||||
|
# Basic caching does no daemon management, so the workflow must ensure no daemon is left
|
||||||
|
# holding locks on the Gradle User Home when the post-action save runs. Without this, `tar`
|
||||||
|
# cannot read the Gradle '*.lock' files on Windows and the cache entry is never saved.
|
||||||
- name: Build kotlin-dsl project
|
- name: Build kotlin-dsl project
|
||||||
working-directory: .github/workflow-samples/kotlin-dsl
|
working-directory: .github/workflow-samples/kotlin-dsl
|
||||||
run: ./gradlew build
|
run: ./gradlew build --no-daemon
|
||||||
|
|
||||||
basic-cache-verify-build:
|
basic-cache-verify-build:
|
||||||
needs: basic-cache-seed-build
|
needs: basic-cache-seed-build
|
||||||
@@ -0,0 +1,69 @@
|
|||||||
|
name: Smoke test restore Gradle Home
|
||||||
|
|
||||||
|
on:
|
||||||
|
workflow_call:
|
||||||
|
inputs:
|
||||||
|
cache-key-prefix:
|
||||||
|
type: string
|
||||||
|
default: '0'
|
||||||
|
runner-os:
|
||||||
|
type: string
|
||||||
|
default: '["ubuntu-latest"]'
|
||||||
|
skip-dist:
|
||||||
|
type: boolean
|
||||||
|
default: false
|
||||||
|
|
||||||
|
env:
|
||||||
|
SKIP_DIST: ${{ inputs.skip-dist }}
|
||||||
|
# Distinct from the keys used by integ-test-restore-gradle-home.yml, which seeds an equivalent
|
||||||
|
# cache entry. Both suites run concurrently, so they must not write to the same cache key.
|
||||||
|
GRADLE_BUILD_ACTION_CACHE_KEY_PREFIX: smoke-test-restore-gradle-home-${{ inputs.cache-key-prefix }}
|
||||||
|
GRADLE_BUILD_ACTION_CACHE_KEY_JOB: smoke-test-restore-gradle-home
|
||||||
|
|
||||||
|
permissions:
|
||||||
|
contents: read
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
restore-gradle-home-seed-build:
|
||||||
|
strategy:
|
||||||
|
max-parallel: 1
|
||||||
|
fail-fast: false
|
||||||
|
matrix:
|
||||||
|
os: ${{fromJSON(inputs.runner-os)}}
|
||||||
|
runs-on: ${{ matrix.os }}
|
||||||
|
steps:
|
||||||
|
- name: Checkout sources
|
||||||
|
uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6.0.3
|
||||||
|
- name: Initialize integ-test
|
||||||
|
uses: ./.github/actions/init-integ-test
|
||||||
|
|
||||||
|
- name: Setup Gradle
|
||||||
|
uses: ./setup-gradle
|
||||||
|
with:
|
||||||
|
cache-read-only: false # For testing, allow writing cache entries on non-default branches
|
||||||
|
- name: Build using Gradle wrapper
|
||||||
|
working-directory: .github/workflow-samples/groovy-dsl
|
||||||
|
run: ./gradlew test
|
||||||
|
|
||||||
|
# Test that the gradle-user-home cache will cache dependencies, by running build with --offline
|
||||||
|
restore-gradle-home-dependencies-cache:
|
||||||
|
needs: restore-gradle-home-seed-build
|
||||||
|
strategy:
|
||||||
|
max-parallel: 1
|
||||||
|
fail-fast: false
|
||||||
|
matrix:
|
||||||
|
os: ${{fromJSON(inputs.runner-os)}}
|
||||||
|
runs-on: ${{ matrix.os }}
|
||||||
|
steps:
|
||||||
|
- name: Checkout sources
|
||||||
|
uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6.0.3
|
||||||
|
- name: Initialize integ-test
|
||||||
|
uses: ./.github/actions/init-integ-test
|
||||||
|
|
||||||
|
- name: Setup Gradle
|
||||||
|
uses: ./setup-gradle
|
||||||
|
with:
|
||||||
|
cache-read-only: true
|
||||||
|
- name: Execute Gradle build with --offline
|
||||||
|
working-directory: .github/workflow-samples/groovy-dsl
|
||||||
|
run: ./gradlew test --offline
|
||||||
@@ -57,9 +57,3 @@ jobs:
|
|||||||
with:
|
with:
|
||||||
runner-os: '${{ inputs.runner-os }}'
|
runner-os: '${{ inputs.runner-os }}'
|
||||||
skip-dist: ${{ inputs.skip-dist }}
|
skip-dist: ${{ inputs.skip-dist }}
|
||||||
|
|
||||||
basic-cache-provider:
|
|
||||||
uses: ./.github/workflows/integ-test-basic-cache-provider.yml
|
|
||||||
with:
|
|
||||||
runner-os: '${{ inputs.runner-os }}'
|
|
||||||
skip-dist: ${{ inputs.skip-dist }}
|
|
||||||
|
|||||||
@@ -0,0 +1,27 @@
|
|||||||
|
name: suite-smoke-test-caching
|
||||||
|
|
||||||
|
on:
|
||||||
|
workflow_call:
|
||||||
|
inputs:
|
||||||
|
runner-os:
|
||||||
|
type: string
|
||||||
|
default: '["ubuntu-latest"]'
|
||||||
|
skip-dist:
|
||||||
|
type: boolean
|
||||||
|
default: false
|
||||||
|
|
||||||
|
permissions:
|
||||||
|
contents: read
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
restore-gradle-home:
|
||||||
|
uses: ./.github/workflows/smoke-test-restore-gradle-home.yml
|
||||||
|
with:
|
||||||
|
runner-os: '${{ inputs.runner-os }}'
|
||||||
|
skip-dist: ${{ inputs.skip-dist }}
|
||||||
|
|
||||||
|
basic-cache-provider:
|
||||||
|
uses: ./.github/workflows/smoke-test-basic-cache-provider.yml
|
||||||
|
with:
|
||||||
|
runner-os: '${{ inputs.runner-os }}'
|
||||||
|
skip-dist: ${{ inputs.skip-dist }}
|
||||||
+83
-82
File diff suppressed because one or more lines are too long
+2
-2
File diff suppressed because one or more lines are too long
+70
-70
File diff suppressed because one or more lines are too long
+2
-2
File diff suppressed because one or more lines are too long
Vendored
+86
-86
File diff suppressed because one or more lines are too long
Vendored
+2
-2
File diff suppressed because one or more lines are too long
Vendored
+85
-85
File diff suppressed because one or more lines are too long
Vendored
+2
-2
File diff suppressed because one or more lines are too long
@@ -47,6 +47,7 @@ export async function run(): Promise<void> {
|
|||||||
-Dorg.gradle.configureondemand=false
|
-Dorg.gradle.configureondemand=false
|
||||||
-Dorg.gradle.dependency.verification=off
|
-Dorg.gradle.dependency.verification=off
|
||||||
-Dorg.gradle.unsafe.isolated-projects=false
|
-Dorg.gradle.unsafe.isolated-projects=false
|
||||||
|
-Dorg.gradle.isolated-projects=false
|
||||||
${taskList}
|
${taskList}
|
||||||
${additionalArgs}
|
${additionalArgs}
|
||||||
`
|
`
|
||||||
|
|||||||
@@ -80,7 +80,28 @@ export class BasicCacheService implements CacheService {
|
|||||||
const cachePaths = getCachePaths(gradleUserHome)
|
const cachePaths = getCachePaths(gradleUserHome)
|
||||||
|
|
||||||
try {
|
try {
|
||||||
await cache.saveCache(cachePaths, primaryKey)
|
// A cacheId of -1 means the save failed: `saveCache` reports the underlying cause and returns
|
||||||
|
// normally, rather than throwing. Warn and continue: caching failures should not fail the build.
|
||||||
|
const cacheId = await cache.saveCache(cachePaths, primaryKey)
|
||||||
|
if (cacheId === -1) {
|
||||||
|
core.warning(
|
||||||
|
`Basic caching failed to save entry with key \`${primaryKey}\`. See preceding log output for the cause.`
|
||||||
|
)
|
||||||
|
return {
|
||||||
|
status: 'enabled',
|
||||||
|
entries: [
|
||||||
|
entryReport({
|
||||||
|
primaryKey,
|
||||||
|
restoredKey,
|
||||||
|
restoredOutcome: restoredKey
|
||||||
|
? '(Entry restored: exact match found)'
|
||||||
|
: '(Entry not restored: no match found)',
|
||||||
|
savedOutcome: '(Entry not saved: save failed)'
|
||||||
|
})
|
||||||
|
]
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
core.info(`Basic caching saved entry with key: ${primaryKey}`)
|
core.info(`Basic caching saved entry with key: ${primaryKey}`)
|
||||||
return {
|
return {
|
||||||
status: 'enabled',
|
status: 'enabled',
|
||||||
|
|||||||
+1
-1
@@ -6,7 +6,7 @@ buildscript {
|
|||||||
def pluginRepositoryUrl = getInputParam('gradle.plugin-repository.url') ?: 'https://plugins.gradle.org/m2'
|
def pluginRepositoryUrl = getInputParam('gradle.plugin-repository.url') ?: 'https://plugins.gradle.org/m2'
|
||||||
def pluginRepositoryUsername = getInputParam('gradle.plugin-repository.username')
|
def pluginRepositoryUsername = getInputParam('gradle.plugin-repository.username')
|
||||||
def pluginRepositoryPassword = getInputParam('gradle.plugin-repository.password')
|
def pluginRepositoryPassword = getInputParam('gradle.plugin-repository.password')
|
||||||
def dependencyGraphPluginVersion = getInputParam('dependency-graph-plugin.version') ?: '1.4.1'
|
def dependencyGraphPluginVersion = getInputParam('dependency-graph-plugin.version') ?: '1.4.2'
|
||||||
|
|
||||||
logger.lifecycle("Resolving dependency graph plugin ${dependencyGraphPluginVersion} from plugin repository: ${pluginRepositoryUrl}")
|
logger.lifecycle("Resolving dependency graph plugin ${dependencyGraphPluginVersion} from plugin repository: ${pluginRepositoryUrl}")
|
||||||
repositories {
|
repositories {
|
||||||
|
|||||||
Reference in New Issue
Block a user