Skip to content

Commit

Permalink
internal/ci/github: skip non-race tests when running race tests
Browse files Browse the repository at this point in the history
Running both the non-race tests and race tests in the same workflow run
is a waste. In the case we are going to run race tests, don't run
regular tests.

Signed-off-by: Paul Jolly <[email protected]>
Change-Id: I699b9968b613aa8e297a6b35651494d07126351e
Reviewed-on: https://review.gerrithub.io/c/cue-lang/cue/+/541288
Reviewed-by: Daniel Martí <[email protected]>
Unity-Result: CUEcueckoo <[email protected]>
TryBot-Result: CUEcueckoo <[email protected]>
  • Loading branch information
myitcv committed Jul 18, 2022
1 parent 236a565 commit 4113ec3
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 6 deletions.
9 changes: 5 additions & 4 deletions .github/workflows/trybot.yml
Original file line number Diff line number Diff line change
Expand Up @@ -62,14 +62,15 @@ jobs:
- if: matrix.go-version == '1.18.x' && matrix.os == 'ubuntu-20.04'
name: Generate
run: go generate ./...
- name: Test
- if: ${{ github.ref == 'refs/heads/master' || matrix.go-version != '1.18.x' || matrix.os != 'ubuntu-20.04' }}
name: Test
run: go test ./...
- if: matrix.go-version == '1.18.x' && matrix.os == 'ubuntu-20.04'
name: Check
run: go vet ./...
- if: ${{ matrix.go-version == '1.18.x' && matrix.os == 'ubuntu-20.04' }}
name: Test with -race
run: go test -race ./...
- if: matrix.go-version == '1.18.x' && matrix.os == 'ubuntu-20.04'
name: Check
run: go vet ./...
- name: Check that git is clean at the end of the job
run: test -z "$(git status --porcelain)" || (git status; git diff; false)
- if: ${{ github.ref == 'refs/heads/master' }}
Expand Down
6 changes: 4 additions & 2 deletions internal/ci/github/trybot.cue
Original file line number Diff line number Diff line change
Expand Up @@ -59,11 +59,13 @@ trybot: _base.#bashWorkflow & {
run: "echo CUE_LONG=true >> $GITHUB_ENV"
},
_#goGenerate,
_#goTest,
_#goCheck,
_#goTest & {
if: "${{ \(_base.#isDefaultBranch) || matrix.go-version != '\(_#latestStableGo)' || matrix.os != '\(_#linuxMachine)' }}"
},
_#goTestRace & {
if: "${{ matrix.go-version == '\(_#latestStableGo)' && matrix.os == '\(_#linuxMachine)' }}"
},
_#goCheck,
_base.#checkGitClean,
_#pullThroughProxy,
]
Expand Down

0 comments on commit 4113ec3

Please sign in to comment.