mirror of
https://github.com/gradle/gradle-build-action.git
synced 2025-06-08 01:06:12 +02:00
Update most test workflows to separate config from execution
This commit is contained in:
parent
0e8b9655a0
commit
e977669c8c
7 changed files with 154 additions and 76 deletions
|
@ -10,8 +10,6 @@ env:
|
|||
GRADLE_BUILD_ACTION_CACHE_KEY_PREFIX: ${{github.workflow}}#${{github.run_number}}-
|
||||
|
||||
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:
|
||||
|
@ -20,11 +18,11 @@ 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
|
||||
- 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
|
||||
dependencies-cache:
|
||||
|
@ -36,12 +34,13 @@ 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
|
||||
- name: Execute Gradle build with --offline
|
||||
working-directory: __tests__/samples/groovy-dsl
|
||||
run: ./gradlew test --offline
|
||||
|
||||
# Test that the gradle-user-home cache will cache and restore local build-cache
|
||||
build-cache:
|
||||
|
@ -53,12 +52,13 @@ jobs:
|
|||
steps:
|
||||
- name: Checkout sources
|
||||
uses: actions/checkout@v2
|
||||
- name: Execute Gradle build and verify tasks from cache
|
||||
- name: Setup Gradle
|
||||
uses: ./
|
||||
with:
|
||||
build-root-directory: __tests__/samples/groovy-dsl
|
||||
arguments: test -DverifyCachedBuild=true
|
||||
cache-read-only: true
|
||||
- name: Execute Gradle build and verify tasks from cache
|
||||
working-directory: __tests__/samples/groovy-dsl
|
||||
run: ./gradlew test -DverifyCachedBuild=true
|
||||
|
||||
# Check that the build can run when Gradle User Home is not fully restored
|
||||
no-extracted-cache-entries-restored:
|
||||
|
@ -70,11 +70,12 @@ jobs:
|
|||
steps:
|
||||
- name: Checkout sources
|
||||
uses: actions/checkout@v2
|
||||
- name: Execute Gradle build with no extracted cache entries restored
|
||||
- name: Setup Gradle with no extracted cache entries restored
|
||||
uses: ./
|
||||
with:
|
||||
build-root-directory: __tests__/samples/groovy-dsl
|
||||
arguments: test
|
||||
cache-read-only: true
|
||||
gradle-home-extracted-cache-entries: '[]'
|
||||
- name: Check executee Gradle build
|
||||
working-directory: __tests__/samples/groovy-dsl
|
||||
run: ./gradlew test
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue