mirror of
https://github.com/gradle/actions.git
synced 2026-04-19 18:12:58 +08:00
93b41b6790
Bumps the github-actions group with 5 updates in the / directory: | Package | From | To | | --- | --- | --- | | [gradle/actions](https://github.com/gradle/actions) | `6.0.1` | `6.1.0` | | [github/codeql-action](https://github.com/github/codeql-action) | `4.35.1` | `4.35.2` | | [actions/upload-artifact](https://github.com/actions/upload-artifact) | `7.0.0` | `7.0.1` | | [actions/github-script](https://github.com/actions/github-script) | `8.0.0` | `9.0.0` | | [peter-evans/create-pull-request](https://github.com/peter-evans/create-pull-request) | `8.1.0` | `8.1.1` | Bumps the github-actions group with 1 update in the /.github/actions/build-dist directory: [actions/upload-artifact](https://github.com/actions/upload-artifact). Updates `gradle/actions` from 6.0.1 to 6.1.0 - [Release notes](https://github.com/gradle/actions/releases) - [Commits](https://github.com/gradle/actions/compare/39e147cb9de83bb9910b8ef8bd7fff0ee20fcd6f...50e97c2cd7a37755bbfafc9c5b7cafaece252f6e) Updates `github/codeql-action` from 4.35.1 to 4.35.2 - [Release notes](https://github.com/github/codeql-action/releases) - [Changelog](https://github.com/github/codeql-action/blob/main/CHANGELOG.md) - [Commits](https://github.com/github/codeql-action/compare/c10b8064de6f491fea524254123dbe5e09572f13...95e58e9a2cdfd71adc6e0353d5c52f41a045d225) Updates `actions/upload-artifact` from 7.0.0 to 7.0.1 - [Release notes](https://github.com/actions/upload-artifact/releases) - [Commits](https://github.com/actions/upload-artifact/compare/bbbca2ddaa5d8feaa63e36b76fdaad77386f024f...043fb46d1a93c77aae656e7c1c64a875d1fc6a0a) Updates `actions/github-script` from 8.0.0 to 9.0.0 - [Release notes](https://github.com/actions/github-script/releases) - [Commits](https://github.com/actions/github-script/compare/ed597411d8f924073f98dfc5c65a23a2325f34cd...3a2844b7e9c422d3c10d287c895573f7108da1b3) Updates `peter-evans/create-pull-request` from 8.1.0 to 8.1.1 - [Release notes](https://github.com/peter-evans/create-pull-request/releases) - [Commits](https://github.com/peter-evans/create-pull-request/compare/c0f553fe549906ede9cf27b5156039d195d2ece0...5f6978faf089d4d20b00c7766989d076bb2fc7f1) Updates `actions/upload-artifact` from 7.0.0 to 7.0.1 - [Release notes](https://github.com/actions/upload-artifact/releases) - [Commits](https://github.com/actions/upload-artifact/compare/bbbca2ddaa5d8feaa63e36b76fdaad77386f024f...043fb46d1a93c77aae656e7c1c64a875d1fc6a0a) --- updated-dependencies: - dependency-name: gradle/actions dependency-version: 6.1.0 dependency-type: direct:production update-type: version-update:semver-minor dependency-group: github-actions - dependency-name: github/codeql-action dependency-version: 4.35.2 dependency-type: direct:production update-type: version-update:semver-patch dependency-group: github-actions - dependency-name: actions/upload-artifact dependency-version: 7.0.1 dependency-type: direct:production update-type: version-update:semver-patch dependency-group: github-actions - dependency-name: actions/github-script dependency-version: 9.0.0 dependency-type: direct:production update-type: version-update:semver-major dependency-group: github-actions - dependency-name: peter-evans/create-pull-request dependency-version: 8.1.1 dependency-type: direct:production update-type: version-update:semver-patch dependency-group: github-actions - dependency-name: actions/upload-artifact dependency-version: 7.0.1 dependency-type: direct:production update-type: version-update:semver-patch dependency-group: github-actions ... Signed-off-by: dependabot[bot] <support@github.com>
185 lines
5.8 KiB
YAML
185 lines
5.8 KiB
YAML
name: Test caching configuration
|
|
|
|
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 }}
|
|
GRADLE_BUILD_ACTION_CACHE_KEY_PREFIX: caching-config-${{ inputs.cache-key-prefix }}
|
|
|
|
permissions:
|
|
contents: read
|
|
|
|
jobs:
|
|
caching-config-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@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
|
|
- 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
|
|
# Add "application" to main cache entry but omit "notifications"
|
|
gradle-home-cache-includes: |
|
|
caches
|
|
application
|
|
# Exclude build-cache from main cache entry
|
|
gradle-home-cache-excludes: |
|
|
caches/build-cache-*
|
|
caches/*/executionHistory
|
|
- 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
|
|
caching-config-verify-build:
|
|
needs: caching-config-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@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
|
|
- name: Initialize integ-test
|
|
uses: ./.github/actions/init-integ-test
|
|
|
|
- name: Setup Gradle
|
|
uses: ./setup-gradle
|
|
with:
|
|
# Use the same configuration as used in the seed build
|
|
gradle-home-cache-includes: |
|
|
caches
|
|
application
|
|
gradle-home-cache-excludes: |
|
|
caches/build-cache-*
|
|
caches/*/executionHistory
|
|
cache-read-only: true
|
|
- name: Execute Gradle build with --offline
|
|
working-directory: .github/workflow-samples/groovy-dsl
|
|
run: ./gradlew test --offline
|
|
|
|
# Test that build scans are captured when caching is explicitly disabled
|
|
caching-config-cache-disabled:
|
|
strategy:
|
|
max-parallel: 1
|
|
fail-fast: false
|
|
matrix:
|
|
os: ${{fromJSON(inputs.runner-os)}}
|
|
runs-on: ${{ matrix.os }}
|
|
steps:
|
|
- name: Checkout sources
|
|
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
|
|
- name: Initialize integ-test
|
|
uses: ./.github/actions/init-integ-test
|
|
|
|
- name: Setup Gradle
|
|
uses: ./setup-gradle
|
|
with:
|
|
cache-disabled: true
|
|
- name: Build using Gradle wrapper
|
|
id: gradle
|
|
working-directory: .github/workflow-samples/groovy-dsl
|
|
run: ./gradlew help
|
|
- name: Check Build Scan url is captured
|
|
if: ${{ !steps.gradle.outputs.build-scan-url }}
|
|
uses: actions/github-script@3a2844b7e9c422d3c10d287c895573f7108da1b3 # v9.0.0
|
|
with:
|
|
script: |
|
|
core.setFailed('No Build Scan detected')
|
|
|
|
# Test that build scans are captured when caching is disabled because Gradle User Home already exists
|
|
caching-config-cache-disabled-pre-existing-gradle-home:
|
|
runs-on: ubuntu-latest # This test only runs on Ubuntu
|
|
steps:
|
|
- name: Checkout sources
|
|
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
|
|
- name: Initialize integ-test
|
|
uses: ./.github/actions/init-integ-test
|
|
|
|
- name: Create dummy Gradle User Home
|
|
run: mkdir -p ~/.gradle/caches
|
|
- name: Setup Gradle
|
|
uses: ./setup-gradle
|
|
- name: Build using Gradle wrapper
|
|
id: gradle
|
|
working-directory: .github/workflow-samples/groovy-dsl
|
|
run: ./gradlew help
|
|
- name: Check Build Scan url is captured
|
|
if: ${{ !steps.gradle.outputs.build-scan-url }}
|
|
uses: actions/github-script@3a2844b7e9c422d3c10d287c895573f7108da1b3 # v9.0.0
|
|
with:
|
|
script: |
|
|
core.setFailed('No Build Scan detected')
|
|
|
|
# Test seed the cache with cache-write-only and verify with cache-read-only
|
|
caching-config-seed-write-only:
|
|
env:
|
|
GRADLE_BUILD_ACTION_CACHE_KEY_PREFIX: caching-config-write-only-${{ inputs.cache-key-prefix }}
|
|
strategy:
|
|
max-parallel: 1
|
|
fail-fast: false
|
|
matrix:
|
|
os: ${{fromJSON(inputs.runner-os)}}
|
|
runs-on: ${{ matrix.os }}
|
|
steps:
|
|
- name: Checkout sources
|
|
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
|
|
- name: Initialize integ-test
|
|
uses: ./.github/actions/init-integ-test
|
|
|
|
- name: Setup Gradle
|
|
uses: ./setup-gradle
|
|
with:
|
|
cache-write-only: true
|
|
- name: Build using Gradle wrapper
|
|
working-directory: .github/workflow-samples/groovy-dsl
|
|
run: ./gradlew test
|
|
|
|
caching-config-verify-write-only:
|
|
env:
|
|
GRADLE_BUILD_ACTION_CACHE_KEY_PREFIX: caching-config-write-only-${{ inputs.cache-key-prefix }}
|
|
needs: caching-config-seed-write-only
|
|
strategy:
|
|
max-parallel: 1
|
|
fail-fast: false
|
|
matrix:
|
|
os: ${{fromJSON(inputs.runner-os)}}
|
|
runs-on: ${{ matrix.os }}
|
|
steps:
|
|
- name: Checkout sources
|
|
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
|
|
- 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
|
|
|