From 755aebc7d12dac50065eb2dbac12a8a18e582146 Mon Sep 17 00:00:00 2001 From: Daz DeBoer Date: Mon, 17 Jan 2022 12:37:19 -0700 Subject: [PATCH] Test build-scan capture with pre-existing GUH --- .../workflows/integTest-caching-config.yml | 24 ++++++++++++++++++- 1 file changed, 23 insertions(+), 1 deletion(-) diff --git a/.github/workflows/integTest-caching-config.yml b/.github/workflows/integTest-caching-config.yml index 1bd9bba..7b521aa 100644 --- a/.github/workflows/integTest-caching-config.yml +++ b/.github/workflows/integTest-caching-config.yml @@ -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')