Skip to content

Commit

Permalink
ci: add test run with race detector
Browse files Browse the repository at this point in the history
Signed-off-by: Paul Cacheux <[email protected]>
  • Loading branch information
paulcacheux committed Feb 11, 2025
1 parent 0cd3acc commit 1e9c8d8
Showing 1 changed file with 44 additions and 0 deletions.
44 changes: 44 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -149,6 +149,50 @@ jobs:
name: Test Results (previous stable Go)
path: junit.xml

test-race:
name: Run tests with race detector
runs-on: ubuntu-latest
needs: build-and-lint
timeout-minutes: 15
env:
CI_KERNEL_SELFTESTS: '/usr/src/linux/tools/testing/selftests/bpf'
CGO_ENABLED: '1' # CGo is required by `-race`
steps:
- uses: actions/checkout@v4

- name: Set up Go
uses: actions/setup-go@v5
with:
go-version: '${{ env.go_version }}'

- run: go install lmb.io/vimto@latest
- run: go install gotest.tools/[email protected]
- run: sudo apt-get update && sudo apt-get install -y --no-install-recommends qemu-system-x86
- run: sudo chmod 0666 /dev/kvm

- name: Test
env:
GOTRACEBACK: crash
run: |
gotestsum --raw-command --ignore-non-json-output-lines --junitfile junit.xml -- vimto -kernel :stable-selftests -- go test -timeout 5m -short -race -count 1 -json ./...
- name: Upload coredumps
uses: actions/upload-artifact@v4
if: ${{ failure() }}
with:
name: cores
if-no-files-found: ignore
path: |
**/core-*
**/*.test
- name: Upload Test Results
if: always()
uses: actions/upload-artifact@v4
with:
name: Test Results (previous stable Go)
path: junit.xml

test-on-arm64:
name: Run tests on arm64
runs-on: ubuntu-22.04-arm64
Expand Down

0 comments on commit 1e9c8d8

Please sign in to comment.