From e4ee2fa142fc72e5d9700fe11e009c2815fca26a Mon Sep 17 00:00:00 2001 From: Ben Ash <32777270+benashz@users.noreply.github.com> Date: Fri, 7 Jun 2024 21:53:17 -0400 Subject: [PATCH] CI: let unit-tests run in parallel to the build (#805) Since the build-done job determines pass/fail, we can update the build dependency to no longer require unit-tests. That allows us to get the results of the both integration unit tests independently. * Run go mod download to pre-cache test deps * Fail build on workflow cancellation --- .github/workflows/build.yaml | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/.github/workflows/build.yaml b/.github/workflows/build.yaml index 2157964c..a3519209 100644 --- a/.github/workflows/build.yaml +++ b/.github/workflows/build.yaml @@ -41,6 +41,11 @@ jobs: uses: actions/setup-go@cdcb36043654635271a94b9a6d1392de5bb323a7 # v5.0.1 with: go-version-file: .go-version + - name: go mod download all + run: | + # download all dependencies to warm up the module cache + # make sure to run go mod tidy after this since the go.sum file will be updated + go mod download all - name: go mod tidy run: | go mod tidy @@ -113,7 +118,6 @@ jobs: needs: - get-product-version - build-pre-checks - - unit-tests runs-on: ubuntu-latest strategy: matrix: @@ -416,9 +420,13 @@ jobs: - build-docker-ubi - build-docker-ubi-redhat - chart-upgrade-tests + - unit-tests - latest-vault - latest-k8s steps: + - name: cancelled + if: ${{ (contains(needs.*.result, 'cancelled')) }} + run: exit 2 - name: passed if: ${{ !(contains(needs.*.result, 'failure')) }} run: exit 0