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 - name: Setup Gradle
uses: ./ uses: ./
with: with:
# Use the same configuration when restoring state from cache # Use the same configuration as used in the seed build
gradle-home-cache-includes: | gradle-home-cache-includes: |
caches caches
enterprise enterprise
@ -57,6 +57,7 @@ jobs:
working-directory: __tests__/samples/groovy-dsl working-directory: __tests__/samples/groovy-dsl
run: ./gradlew test --offline run: ./gradlew test --offline
# Test that build scans are captured when caching is explicitly disabled
cache-disabled: cache-disabled:
strategy: strategy:
matrix: matrix:
@ -79,3 +80,24 @@ jobs:
with: with:
script: | script: |
core.setFailed('No build scan detected') 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')