From a148b21183c0f92e751b04865b8181568d330b2b Mon Sep 17 00:00:00 2001 From: Daz DeBoer Date: Tue, 17 Aug 2021 16:32:51 -0600 Subject: [PATCH] Improve prod workflow - Use a separate job to test read-only cache - Use dependency jobs to avoid cache race conditions --- .github/workflows/prod.yml | 47 ++++++++++++++++++++++++++++---------- 1 file changed, 35 insertions(+), 12 deletions(-) diff --git a/.github/workflows/prod.yml b/.github/workflows/prod.yml index 5cd9f46..114e10f 100644 --- a/.github/workflows/prod.yml +++ b/.github/workflows/prod.yml @@ -7,7 +7,22 @@ on: workflow_dispatch: jobs: + basic-build: + strategy: + matrix: + os: [ubuntu-latest, macos-latest, windows-latest] + runs-on: ${{ matrix.os }} + steps: + - name: Checkout sources + uses: actions/checkout@v2 + - name: Build using Gradle wrapper + uses: ./ + with: + build-root-directory: __tests__/samples/basic + arguments: test + gradle-execution: + needs: basic-build strategy: matrix: os: [ubuntu-latest, macos-latest, windows-latest] @@ -18,11 +33,6 @@ jobs: steps: - name: Checkout sources uses: actions/checkout@v2 - - name: Test use Gradle wrapper - uses: ./ - with: - build-root-directory: __tests__/samples/basic - arguments: test - name: Test use defined Gradle version uses: ./ with: @@ -49,6 +59,7 @@ jobs: arguments: help dependencies-cache: + needs: basic-build strategy: matrix: os: [ubuntu-latest, macos-latest, windows-latest] @@ -62,15 +73,9 @@ jobs: build-root-directory: __tests__/samples/basic arguments: test --no-daemon dependencies-cache-enabled: true - - name: Test dependencies-cache-enabled - uses: ./ - with: - build-root-directory: __tests__/samples/basic - arguments: test --no-daemon - dependencies-cache-enabled: true - cache-read-only: true configuration-cache: + needs: basic-build strategy: matrix: os: [ubuntu-latest, macos-latest, windows-latest] @@ -87,8 +92,26 @@ jobs: dependencies-cache-enabled: true # Configuration cache requires dependencies cache, since it assumes dependencies are already downloaded. + cache-read-only: + needs: basic-build + strategy: + matrix: + os: [ubuntu-latest, macos-latest, windows-latest] + runs-on: ${{ matrix.os }} + steps: + - name: Checkout sources + uses: actions/checkout@v2 + - name: Test cache-read-only + uses: ./ + with: + build-root-directory: __tests__/samples/basic + arguments: test --no-daemon + dependencies-cache-enabled: true + configuration-cache-enabled: true + cache-read-only: true failures: # These build invocations are informational only, and are expected to fail + needs: basic-build runs-on: ubuntu-latest steps: - name: Checkout sources