From 950ddaf5033e30a53d1de06ecc8d671eb4391ec4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20Mart=C3=AD?= Date: Sun, 30 Apr 2023 17:45:35 +0100 Subject: [PATCH] CI: skip regular `go test` on linux See the added comment. An alternative would be to split up the work into more jobs, but that doesn't feel necessary, and we still have a global limit on how many free runners we can run jobs on at once. While here, update the comments, and remove unnecessary step names. --- .github/workflows/test.yml | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 92ef1b6..be2f6c6 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -35,21 +35,24 @@ jobs: with: go-version: ${{ matrix.go-version }} cache: false - - name: Test + # linux already runs the tests with -race below, plus extra checks, + # so skip the regular tests to prevent it from taking the longest. + - if: matrix.os != 'ubuntu-latest' run: go test -timeout=15m ./... + # macos and windows failures with bincmp can be hard to reproduce locally, + # so upload the binaries as artifacts. - uses: actions/upload-artifact@v3 if: failure() with: name: bincmp_output path: bincmp_output/ - - name: Test with -race - # macos and windows tend to be a bit slower, - # and it's rare that a race in garble would be OS-specific. - if: matrix.os == 'ubuntu-latest' + # macos and windows tend to be a bit slower, + # and it's rare that a race in garble would be OS-specific. + - if: matrix.os == 'ubuntu-latest' run: go test -race -timeout=20m ./... # Static checks from this point forward. Only run on one Go version and on - # Linux, since it's the fastest platform, and the tools behave the same. + # linux, since it's the fastest platform, and the tools behave the same. - name: Test third-party project builds if: matrix.os == 'ubuntu-latest' && matrix.go-version == '1.20.x' run: |