diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 254fec3..a96c885 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -37,10 +37,7 @@ jobs: with: go-version: ${{ matrix.go-version }} cache: false - # 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 ./... + - 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@v4 @@ -48,10 +45,6 @@ jobs: with: name: bincmp_output path: bincmp_output/ - # 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. @@ -87,3 +80,18 @@ jobs: go-version: 1.26.x cache: false - run: go test -short ./... + + # Only run the short tests with -race, because otherwise the overhead is too much. + # We only test on Linux, as races are unlikely to be OS-specific. + # We use GOAMD64=v3 because that significantly speeds up the race detector. + test-race: + runs-on: ubuntu-latest + env: + GOAMD64: v3 + steps: + - uses: actions/checkout@v5 + - uses: actions/setup-go@v5 + with: + go-version: 1.26.x + cache: false + - run: go test -short -race ./...