Skip to content

Commit

Permalink
Explicitly allow cache-write for test invocations
Browse files Browse the repository at this point in the history
The `gradle-build-action` test workflows need to write cache entries,
even when run on non-default branches. This change add explicit configuration
to set `cache-read-only: false` when cache writing is required.
  • Loading branch information
bigdaz committed Jun 4, 2022
1 parent b02f4f1 commit 00cdd4d
Show file tree
Hide file tree
Showing 10 changed files with 22 additions and 0 deletions.
1 change: 1 addition & 0 deletions .github/workflows/integ-test-action-inputs-caching.yml
Expand Up @@ -31,6 +31,7 @@ jobs:
- name: Setup Gradle
uses: ./
with:
cache-read-only: false # For testing, allow writing cache entries on non-default branches
# Add "enterprise" to main cache entry but omit "notifications"
gradle-home-cache-includes: |
caches
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/integ-test-execution-with-caching.yml
Expand Up @@ -31,6 +31,7 @@ jobs:
- name: Execute Gradle build
uses: ./
with:
cache-read-only: false # For testing, allow writing cache entries on non-default branches
build-root-directory: .github/workflow-samples/groovy-dsl
arguments: test

Expand Down
2 changes: 2 additions & 0 deletions .github/workflows/integ-test-execution.yml
Expand Up @@ -36,6 +36,7 @@ jobs:
- name: Test use defined Gradle version
uses: ./
with:
cache-read-only: false # For testing, allow writing cache entries on non-default branches
gradle-version: 6.9
build-root-directory: .github/workflow-samples/no-wrapper
arguments: help -DgradleVersionCheck=6.9
Expand Down Expand Up @@ -72,6 +73,7 @@ jobs:
uses: ./
id: gradle
with:
cache-read-only: false # For testing, allow writing cache entries on non-default branches
gradle-version: ${{matrix.gradle}}
build-root-directory: .github/workflow-samples/no-wrapper${{ matrix.build-root-suffix }}
arguments: help -DgradleVersionCheck=${{matrix.gradle}}
Expand Down
2 changes: 2 additions & 0 deletions .github/workflows/integ-test-provision-gradle-versions.yml
Expand Up @@ -36,6 +36,7 @@ jobs:
- name: Setup Gradle with v6.9
uses: ./
with:
cache-read-only: false # For testing, allow writing cache entries on non-default branches
gradle-version: 6.9
- name: Test uses Gradle v6.9
working-directory: .github/workflow-samples/no-wrapper
Expand Down Expand Up @@ -74,6 +75,7 @@ jobs:
- name: Setup Gradle
uses: ./
with:
cache-read-only: false # For testing, allow writing cache entries on non-default branches
gradle-version: ${{ matrix.gradle }}
- name: Run Gradle build
id: gradle
Expand Down
6 changes: 6 additions & 0 deletions .github/workflows/integ-test-restore-configuration-cache.yml
Expand Up @@ -32,6 +32,8 @@ jobs:
uses: ./.github/actions/download-dist
- name: Setup Gradle
uses: ./
with:
cache-read-only: false # For testing, allow writing cache entries on non-default branches
- name: Groovy build with configuration-cache enabled
working-directory: .github/workflow-samples/groovy-dsl
run: ./gradlew test --configuration-cache
Expand Down Expand Up @@ -102,6 +104,8 @@ jobs:
uses: ./.github/actions/download-dist
- name: Setup Gradle
uses: ./
with:
cache-read-only: false # For testing, allow writing cache entries on non-default branches
- name: Execute 'help' with configuration-cache enabled
working-directory: .github/workflow-samples/kotlin-dsl
run: ./gradlew help --configuration-cache
Expand All @@ -121,6 +125,8 @@ jobs:
uses: ./.github/actions/download-dist
- name: Setup Gradle
uses: ./
with:
cache-read-only: false # For testing, allow writing cache entries on non-default branches
- name: Execute 'test' with configuration-cache enabled
working-directory: .github/workflow-samples/kotlin-dsl
run: ./gradlew test --configuration-cache
Expand Down
2 changes: 2 additions & 0 deletions .github/workflows/integ-test-restore-custom-gradle-home.yml
Expand Up @@ -30,6 +30,8 @@ jobs:
uses: ./.github/actions/download-dist
- name: Setup Gradle
uses: ./
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 --info
Expand Down
2 changes: 2 additions & 0 deletions .github/workflows/integ-test-restore-gradle-home.yml
Expand Up @@ -31,6 +31,8 @@ jobs:
uses: ./.github/actions/download-dist
- name: Setup Gradle
uses: ./
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
Expand Down
2 changes: 2 additions & 0 deletions .github/workflows/integ-test-restore-java-toolchain.yml
Expand Up @@ -30,6 +30,8 @@ jobs:
uses: ./.github/actions/download-dist
- name: Setup Gradle
uses: ./
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/java-toolchain
run: ./gradlew test --info
Expand Down
2 changes: 2 additions & 0 deletions .github/workflows/integ-test-sample-gradle-plugin.yml
Expand Up @@ -30,6 +30,8 @@ jobs:
uses: ./.github/actions/download-dist
- name: Setup Gradle
uses: ./
with:
cache-read-only: false # For testing, allow writing cache entries on non-default branches
- name: Build gradle-plugin project
working-directory: .github/workflow-samples/gradle-plugin
run: ./gradlew build
Expand Down
2 changes: 2 additions & 0 deletions .github/workflows/integ-test-sample-kotlin-dsl.yml
Expand Up @@ -30,6 +30,8 @@ jobs:
uses: ./.github/actions/download-dist
- name: Setup Gradle
uses: ./
with:
cache-read-only: false # For testing, allow writing cache entries on non-default branches
- name: Build kotlin-dsl project
working-directory: .github/workflow-samples/kotlin-dsl
run: ./gradlew build
Expand Down

0 comments on commit 00cdd4d

Please sign in to comment.