Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ci: add test run with race detector #1674

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from
Draft
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
41 changes: 41 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -149,6 +149,47 @@ 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 gotest.tools/[email protected]

- name: Test
env:
GOTRACEBACK: crash
run: |
gotestsum --ignore-non-json-output-lines --junitfile junit.xml -- -exec 'sudo -E' -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
Loading