Test build-scan capture with pre-existing GUH

This commit is contained in:
Daz DeBoer 2022-01-17 12:37:19 -07:00
parent 06d64212d3
commit 755aebc7d1
No known key found for this signature in database
GPG key ID: DD6B9F0B06683D5D

View file

@ -46,7 +46,7 @@ jobs:
- name: Setup Gradle
uses: ./
with:
# Use the same configuration when restoring state from cache
# Use the same configuration as used in the seed build
gradle-home-cache-includes: |
caches
enterprise
@ -57,6 +57,7 @@ jobs:
working-directory: __tests__/samples/groovy-dsl
run: ./gradlew test --offline
# Test that build scans are captured when caching is explicitly disabled
cache-disabled:
strategy:
matrix:
@ -79,3 +80,24 @@ jobs:
with:
script: |
core.setFailed('No build scan detected')
# Test that build scans are captured when caching is disabled because Gradle User Home already exists
cache-disabled-pre-existing-gradle-home:
runs-on: ubuntu-latest
steps:
- name: Checkout sources
uses: actions/checkout@v2
- name: Create dummy Gradle User Home
run: mkdir -p ~/.gradle/caches
- name: Setup Gradle
uses: ./
- name: Run Gradle build
id: gradle
working-directory: __tests__/samples/no-wrapper${{ matrix.build-root-suffix }}
run: gradle help "-DgradleVersionCheck=${{matrix.gradle}}"
- name: Check build scan url is captured
if: ${{ !steps.gradle.outputs.build-scan-url }}
uses: actions/github-script@v3
with:
script: |
core.setFailed('No build scan detected')