Explicitly allow cache-write for test invocations

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.
This commit is contained in:
Daz DeBoer 2022-06-04 11:37:13 -06:00
parent b02f4f1968
commit 00cdd4dcf9
No known key found for this signature in database
GPG key ID: DD6B9F0B06683D5D
10 changed files with 22 additions and 0 deletions

View file

@ -31,6 +31,7 @@ jobs:
- name: Setup Gradle - name: Setup Gradle
uses: ./ uses: ./
with: with:
cache-read-only: false # For testing, allow writing cache entries on non-default branches
# Add "enterprise" to main cache entry but omit "notifications" # Add "enterprise" to main cache entry but omit "notifications"
gradle-home-cache-includes: | gradle-home-cache-includes: |
caches caches

View file

@ -31,6 +31,7 @@ jobs:
- name: Execute Gradle build - name: Execute Gradle build
uses: ./ uses: ./
with: with:
cache-read-only: false # For testing, allow writing cache entries on non-default branches
build-root-directory: .github/workflow-samples/groovy-dsl build-root-directory: .github/workflow-samples/groovy-dsl
arguments: test arguments: test

View file

@ -36,6 +36,7 @@ jobs:
- name: Test use defined Gradle version - name: Test use defined Gradle version
uses: ./ uses: ./
with: with:
cache-read-only: false # For testing, allow writing cache entries on non-default branches
gradle-version: 6.9 gradle-version: 6.9
build-root-directory: .github/workflow-samples/no-wrapper build-root-directory: .github/workflow-samples/no-wrapper
arguments: help -DgradleVersionCheck=6.9 arguments: help -DgradleVersionCheck=6.9
@ -72,6 +73,7 @@ jobs:
uses: ./ uses: ./
id: gradle id: gradle
with: with:
cache-read-only: false # For testing, allow writing cache entries on non-default branches
gradle-version: ${{matrix.gradle}} gradle-version: ${{matrix.gradle}}
build-root-directory: .github/workflow-samples/no-wrapper${{ matrix.build-root-suffix }} build-root-directory: .github/workflow-samples/no-wrapper${{ matrix.build-root-suffix }}
arguments: help -DgradleVersionCheck=${{matrix.gradle}} arguments: help -DgradleVersionCheck=${{matrix.gradle}}

View file

@ -36,6 +36,7 @@ jobs:
- name: Setup Gradle with v6.9 - name: Setup Gradle with v6.9
uses: ./ uses: ./
with: with:
cache-read-only: false # For testing, allow writing cache entries on non-default branches
gradle-version: 6.9 gradle-version: 6.9
- name: Test uses Gradle v6.9 - name: Test uses Gradle v6.9
working-directory: .github/workflow-samples/no-wrapper working-directory: .github/workflow-samples/no-wrapper
@ -74,6 +75,7 @@ jobs:
- name: Setup Gradle - name: Setup Gradle
uses: ./ uses: ./
with: with:
cache-read-only: false # For testing, allow writing cache entries on non-default branches
gradle-version: ${{ matrix.gradle }} gradle-version: ${{ matrix.gradle }}
- name: Run Gradle build - name: Run Gradle build
id: gradle id: gradle

View file

@ -32,6 +32,8 @@ jobs:
uses: ./.github/actions/download-dist uses: ./.github/actions/download-dist
- name: Setup Gradle - name: Setup Gradle
uses: ./ uses: ./
with:
cache-read-only: false # For testing, allow writing cache entries on non-default branches
- name: Groovy build with configuration-cache enabled - name: Groovy build with configuration-cache enabled
working-directory: .github/workflow-samples/groovy-dsl working-directory: .github/workflow-samples/groovy-dsl
run: ./gradlew test --configuration-cache run: ./gradlew test --configuration-cache
@ -102,6 +104,8 @@ jobs:
uses: ./.github/actions/download-dist uses: ./.github/actions/download-dist
- name: Setup Gradle - name: Setup Gradle
uses: ./ uses: ./
with:
cache-read-only: false # For testing, allow writing cache entries on non-default branches
- name: Execute 'help' with configuration-cache enabled - name: Execute 'help' with configuration-cache enabled
working-directory: .github/workflow-samples/kotlin-dsl working-directory: .github/workflow-samples/kotlin-dsl
run: ./gradlew help --configuration-cache run: ./gradlew help --configuration-cache
@ -121,6 +125,8 @@ jobs:
uses: ./.github/actions/download-dist uses: ./.github/actions/download-dist
- name: Setup Gradle - name: Setup Gradle
uses: ./ uses: ./
with:
cache-read-only: false # For testing, allow writing cache entries on non-default branches
- name: Execute 'test' with configuration-cache enabled - name: Execute 'test' with configuration-cache enabled
working-directory: .github/workflow-samples/kotlin-dsl working-directory: .github/workflow-samples/kotlin-dsl
run: ./gradlew test --configuration-cache run: ./gradlew test --configuration-cache

View file

@ -30,6 +30,8 @@ jobs:
uses: ./.github/actions/download-dist uses: ./.github/actions/download-dist
- name: Setup Gradle - name: Setup Gradle
uses: ./ uses: ./
with:
cache-read-only: false # For testing, allow writing cache entries on non-default branches
- name: Build using Gradle wrapper - name: Build using Gradle wrapper
working-directory: .github/workflow-samples/groovy-dsl working-directory: .github/workflow-samples/groovy-dsl
run: ./gradlew test --info run: ./gradlew test --info

View file

@ -31,6 +31,8 @@ jobs:
uses: ./.github/actions/download-dist uses: ./.github/actions/download-dist
- name: Setup Gradle - name: Setup Gradle
uses: ./ uses: ./
with:
cache-read-only: false # For testing, allow writing cache entries on non-default branches
- name: Build using Gradle wrapper - name: Build using Gradle wrapper
working-directory: .github/workflow-samples/groovy-dsl working-directory: .github/workflow-samples/groovy-dsl
run: ./gradlew test run: ./gradlew test

View file

@ -30,6 +30,8 @@ jobs:
uses: ./.github/actions/download-dist uses: ./.github/actions/download-dist
- name: Setup Gradle - name: Setup Gradle
uses: ./ uses: ./
with:
cache-read-only: false # For testing, allow writing cache entries on non-default branches
- name: Build using Gradle wrapper - name: Build using Gradle wrapper
working-directory: .github/workflow-samples/java-toolchain working-directory: .github/workflow-samples/java-toolchain
run: ./gradlew test --info run: ./gradlew test --info

View file

@ -30,6 +30,8 @@ jobs:
uses: ./.github/actions/download-dist uses: ./.github/actions/download-dist
- name: Setup Gradle - name: Setup Gradle
uses: ./ uses: ./
with:
cache-read-only: false # For testing, allow writing cache entries on non-default branches
- name: Build gradle-plugin project - name: Build gradle-plugin project
working-directory: .github/workflow-samples/gradle-plugin working-directory: .github/workflow-samples/gradle-plugin
run: ./gradlew build run: ./gradlew build

View file

@ -30,6 +30,8 @@ jobs:
uses: ./.github/actions/download-dist uses: ./.github/actions/download-dist
- name: Setup Gradle - name: Setup Gradle
uses: ./ uses: ./
with:
cache-read-only: false # For testing, allow writing cache entries on non-default branches
- 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