Update most test workflows to separate config from execution

This commit is contained in:
Daz DeBoer 2021-12-08 10:29:13 -07:00
parent 0e8b9655a0
commit e977669c8c
No known key found for this signature in database
GPG key ID: DD6B9F0B06683D5D
7 changed files with 154 additions and 76 deletions

View file

@ -11,8 +11,6 @@ env:
GRADLE_BUILD_ACTION_CACHE_DEBUG_ENABLED: true
jobs:
# Run initial Gradle builds to push initial cache entries
# These builds should start fresh without cache hits, due to the seed injected into the cache key above.
seed-build:
strategy:
matrix:
@ -21,11 +19,9 @@ jobs:
steps:
- name: Checkout sources
uses: actions/checkout@v2
- name: Build using Gradle wrapper
- name: Setup Gradle
uses: ./
with:
build-root-directory: __tests__/samples/groovy-dsl
arguments: test
# Add "wrapper" to main cache entry and remove 'wrapper-zips' cache entry
# Exclude build-cache from main cache entry
gradle-home-cache-includes: |
@ -41,6 +37,9 @@ jobs:
["instrumented-jars", "caches/jars-*/*/"],
["kotlin-dsl", "caches/*/kotlin-dsl/*/*/"]
]
- name: Build using Gradle wrapper
working-directory: __tests__/samples/groovy-dsl
run: ./gradlew test
# Test that the gradle-user-home cache will cache dependencies, by running build with --offline
verify-build:
@ -52,13 +51,10 @@ jobs:
steps:
- name: Checkout sources
uses: actions/checkout@v2
- name: Execute Gradle build with --offline
- name: Setup Gradle
uses: ./
with:
build-root-directory: __tests__/samples/groovy-dsl
arguments: test --offline
cache-read-only: true
# Need the same configuration when restoring state from cache
# Use the same configuration when restoring state from cache
gradle-home-cache-includes: |
caches
notifications
@ -72,5 +68,9 @@ jobs:
["instrumented-jars", "caches/jars-*/*/"],
["kotlin-dsl", "caches/*/kotlin-dsl/*/*/"]
]
cache-read-only: true
- name: Execute Gradle build with --offline
working-directory: __tests__/samples/groovy-dsl
run: ./gradlew test --offline