Compare commits

..
30 changed files with 386 additions and 505 deletions
-3
View File
@@ -3,6 +3,3 @@
# Ignore Gradle build output directory
build
# Marker file written when the 'test' task is configured
task-configured.txt
@@ -1,5 +1,5 @@
plugins {
id "com.gradle.develocity" version "4.4.2"
id "com.gradle.develocity" version "4.5.0"
id "com.gradle.common-custom-user-data-gradle-plugin" version "2.4.0"
}
@@ -1,5 +1,5 @@
plugins {
id("com.gradle.develocity") version "4.4.2"
id("com.gradle.develocity") version "4.5.0"
id("com.gradle.common-custom-user-data-gradle-plugin") version "2.4.0"
}
@@ -1,5 +1,5 @@
plugins {
id "com.gradle.develocity" version "4.4.2"
id "com.gradle.develocity" version "4.5.0"
}
develocity {
@@ -1,5 +1,5 @@
plugins {
id "com.gradle.develocity" version "4.4.2"
id "com.gradle.develocity" version "4.5.0"
}
develocity {
@@ -1,5 +1,5 @@
plugins {
id "com.gradle.develocity" version "4.4.2"
id "com.gradle.develocity" version "4.5.0"
}
develocity {
-10
View File
@@ -14,16 +14,6 @@ permissions:
contents: read
jobs:
smoke-tests:
uses: ./.github/workflows/suite-smoke-test-caching.yml
concurrency:
group: CI-smoke-test-caching
cancel-in-progress: false
with:
skip-dist: true
runner-os: '["ubuntu-latest", "windows-latest"]'
secrets: inherit
caching-integ-tests:
uses: ./.github/workflows/suite-integ-test-caching.yml
concurrency:
+1 -13
View File
@@ -21,19 +21,9 @@ jobs:
- name: Checkout sources
uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6.0.3
- name: Build and upload distribution
if: ${{ needs.determine-suite.outputs.suite != 'full' }}
uses: ./.github/actions/build-dist
smoke-tests:
needs: build-distribution
uses: ./.github/workflows/suite-smoke-test-caching.yml
concurrency:
group: CI-smoke-test-caching-${{ github.ref }}
cancel-in-progress: false
with:
skip-dist: false
runner-os: '["ubuntu-latest", "windows-latest"]'
secrets: inherit
caching-integ-tests:
needs: build-distribution
uses: ./.github/workflows/suite-integ-test-caching.yml
@@ -74,7 +64,6 @@ jobs:
if: ${{ always() }}
needs:
- build-distribution
- smoke-tests
- caching-integ-tests
- other-integ-tests
- dependency-submission-integ-tests
@@ -85,7 +74,6 @@ jobs:
run: |
echo "One or more integ-test jobs did not succeed:"
echo " build-distribution: ${{ needs.build-distribution.result }}"
echo " smoke-tests: ${{ needs.smoke-tests.result }}"
echo " caching-integ-tests: ${{ needs.caching-integ-tests.result }}"
echo " other-integ-tests: ${{ needs.other-integ-tests.result }}"
echo " dependency-submission-integ-tests: ${{ needs.dependency-submission-integ-tests.result }}"
@@ -39,12 +39,9 @@ jobs:
with:
cache-provider: basic
cache-read-only: false # For testing, allow writing cache entries on non-default branches
# Basic caching does no daemon management, so the workflow must ensure no daemon is left
# holding locks on the Gradle User Home when the post-action save runs. Without this, `tar`
# cannot read the Gradle '*.lock' files on Windows and the cache entry is never saved.
- name: Build kotlin-dsl project
working-directory: .github/workflow-samples/kotlin-dsl
run: ./gradlew build --no-daemon
run: ./gradlew build
basic-cache-verify-build:
needs: basic-cache-seed-build
@@ -30,7 +30,7 @@ jobs:
matrix:
gradle: ['current', '8.14.3', '7.6.2', '6.9.4', '5.6.4']
os: ${{fromJSON(inputs.runner-os)}}
plugin-version: ['3.16.2', '4.4.2']
plugin-version: ['3.16.2', '4.5.0']
include:
- java-version: 17
- gradle: '8.14.3'
@@ -43,7 +43,7 @@ jobs:
java-version: 11
- plugin-version: '3.16.2'
accessKeyEnv: GRADLE_ENTERPRISE_ACCESS_KEY
- plugin-version: '4.4.2'
- plugin-version: '4.5.0'
accessKeyEnv: DEVELOCITY_ACCESS_KEY
runs-on: ${{ matrix.os }}
env:
@@ -92,7 +92,7 @@ jobs:
matrix:
gradle: ['current', '8.14.3', '7.6.2', '6.9.4', '5.6.4']
os: ${{fromJSON(inputs.runner-os)}}
plugin-version: ['3.16.2', '4.4.2']
plugin-version: ['3.16.2', '4.5.0']
include:
- java-version: 17
- gradle: '8.14.3'
@@ -148,7 +148,7 @@ jobs:
matrix:
gradle: ['current', '8.14.3', '7.6.2', '6.9.4', '5.6.4']
os: ${{fromJSON(inputs.runner-os)}}
plugin-version: [ '3.16.2', '4.4.2' ]
plugin-version: [ '3.16.2', '4.5.0' ]
include:
- java-version: 17
- gradle: '8.14.3'
@@ -191,7 +191,7 @@ jobs:
matrix:
gradle: ['current', '8.14.3', '7.6.2', '6.9.4', '5.6.4']
os: ${{fromJSON(inputs.runner-os)}}
plugin-version: [ '3.16.2', '4.4.2' ]
plugin-version: [ '3.16.2', '4.5.0' ]
include:
- java-version: 17
- gradle: '8.14.3'
@@ -43,6 +43,29 @@ jobs:
working-directory: .github/workflow-samples/groovy-dsl
run: ./gradlew test
# Test that the gradle-user-home cache will cache dependencies, by running build with --offline
restore-gradle-home-dependencies-cache:
needs: restore-gradle-home-seed-build
strategy:
max-parallel: 1
fail-fast: false
matrix:
os: ${{fromJSON(inputs.runner-os)}}
runs-on: ${{ matrix.os }}
steps:
- name: Checkout sources
uses: actions/checkout@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
restore-gradle-home-build-cache:
needs: restore-gradle-home-seed-build
@@ -91,16 +114,15 @@ jobs:
working-directory: .github/workflow-samples/groovy-dsl
run: ./gradlew test
# 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.
# Test that a pre-existing gradle-user-home can be overwritten by the restored cache
restore-gradle-home-pre-existing-gradle-home:
needs: restore-gradle-home-seed-build
runs-on: ubuntu-latest
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
@@ -1,69 +0,0 @@
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,3 +57,9 @@ jobs:
with:
runner-os: '${{ inputs.runner-os }}'
skip-dist: ${{ inputs.skip-dist }}
basic-cache-provider:
uses: ./.github/workflows/integ-test-basic-cache-provider.yml
with:
runner-os: '${{ inputs.runner-os }}'
skip-dist: ${{ inputs.skip-dist }}
@@ -1,27 +0,0 @@
name: suite-smoke-test-caching
on:
workflow_call:
inputs:
runner-os:
type: string
default: '["ubuntu-latest"]'
skip-dist:
type: boolean
default: false
permissions:
contents: read
jobs:
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 }}
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
+86 -86
View File
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
+85 -85
View File
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
+1 -1
View File
@@ -921,7 +921,7 @@ Here's a minimal example:
run: ./gradlew build
```
This configuration will automatically apply `v4.4.2` of the [Develocity Gradle plugin](https://docs.gradle.com/develocity/gradle-plugin/), and publish build scans to https://develocity.your-server.com.
This configuration will automatically apply `v4.5.0` of the [Develocity Gradle plugin](https://docs.gradle.com/develocity/gradle-plugin/), and publish build scans to https://develocity.your-server.com.
This example assumes that the `develocity.your-server.com` server allows anonymous publishing of build scans.
In the likely scenario that your Develocity server requires authentication, you will also need to pass a valid [Develocity access key](https://docs.gradle.com/develocity/gradle-plugin/#via_environment_variable) taken from a secret:
@@ -47,7 +47,6 @@ export async function run(): Promise<void> {
-Dorg.gradle.configureondemand=false
-Dorg.gradle.dependency.verification=off
-Dorg.gradle.unsafe.isolated-projects=false
-Dorg.gradle.isolated-projects=false
${taskList}
${additionalArgs}
`
+1 -22
View File
@@ -80,28 +80,7 @@ export class BasicCacheService implements CacheService {
const cachePaths = getCachePaths(gradleUserHome)
try {
// A cacheId of -1 means the save failed: `saveCache` reports the underlying cause and returns
// normally, rather than throwing. Warn and continue: caching failures should not fail the build.
const cacheId = await cache.saveCache(cachePaths, primaryKey)
if (cacheId === -1) {
core.warning(
`Basic caching failed to save entry with key \`${primaryKey}\`. See preceding log output for the cause.`
)
return {
status: 'enabled',
entries: [
entryReport({
primaryKey,
restoredKey,
restoredOutcome: restoredKey
? '(Entry restored: exact match found)'
: '(Entry not restored: no match found)',
savedOutcome: '(Entry not saved: save failed)'
})
]
}
}
await cache.saveCache(cachePaths, primaryKey)
core.info(`Basic caching saved entry with key: ${primaryKey}`)
return {
status: 'enabled',
+1 -1
View File
@@ -33,7 +33,7 @@ export function setup(config: DevelocityConfig): void {
// except if they are defined in the configuration
if (config.getBuildScanPublishEnabled()) {
maybeExportVariable('DEVELOCITY_INJECTION_ENABLED', 'true')
maybeExportVariable('DEVELOCITY_INJECTION_DEVELOCITY_PLUGIN_VERSION', '4.4.2')
maybeExportVariable('DEVELOCITY_INJECTION_DEVELOCITY_PLUGIN_VERSION', '4.5.0')
maybeExportVariable('DEVELOCITY_INJECTION_CCUD_PLUGIN_VERSION', '2.1')
maybeExportVariable('DEVELOCITY_INJECTION_TERMS_OF_USE_URL', config.getTermsOfUseUrl())
maybeExportVariable('DEVELOCITY_INJECTION_TERMS_OF_USE_AGREE', config.getTermsOfUseAgree())
@@ -6,7 +6,7 @@ buildscript {
def pluginRepositoryUrl = getInputParam('gradle.plugin-repository.url') ?: 'https://plugins.gradle.org/m2'
def pluginRepositoryUsername = getInputParam('gradle.plugin-repository.username')
def pluginRepositoryPassword = getInputParam('gradle.plugin-repository.password')
def dependencyGraphPluginVersion = getInputParam('dependency-graph-plugin.version') ?: '1.4.2'
def dependencyGraphPluginVersion = getInputParam('dependency-graph-plugin.version') ?: '1.4.1'
logger.lifecycle("Resolving dependency graph plugin ${dependencyGraphPluginVersion} from plugin repository: ${pluginRepositoryUrl}")
repositories {
+1 -1
View File
@@ -1,5 +1,5 @@
plugins {
id "com.gradle.develocity" version "4.4.2"
id "com.gradle.develocity" version "4.5.0"
id "com.gradle.common-custom-user-data-gradle-plugin" version "2.4.0"
}
@@ -16,7 +16,7 @@ import java.nio.file.Files
import java.util.zip.GZIPOutputStream
class BaseInitScriptTest extends Specification {
static final String DEVELOCITY_PLUGIN_VERSION = '4.4.2'
static final String DEVELOCITY_PLUGIN_VERSION = '4.5.0'
static final String CCUD_PLUGIN_VERSION = '2.1'
static final TestGradleVersion GRADLE_4_X = new TestGradleVersion(GradleVersion.version('4.10.3'), 7, 10)
@@ -248,7 +248,7 @@ task expectFailure {
when:
settingsFile.text = """
plugins {
id 'com.gradle.develocity' version '4.4.2' apply(false)
id 'com.gradle.develocity' version '4.5.0' apply(false)
}
gradle.settingsEvaluated {
apply plugin: 'com.gradle.develocity'