Skip to content

Commit 36a9355

Browse files
committed
ci: add test run with race detector
Signed-off-by: Paul Cacheux <[email protected]>
1 parent 0cd3acc commit 36a9355

File tree

1 file changed

+41
-0
lines changed

1 file changed

+41
-0
lines changed

Diff for: .github/workflows/ci.yml

+41
Original file line numberDiff line numberDiff line change
@@ -149,6 +149,47 @@ jobs:
149149
name: Test Results (previous stable Go)
150150
path: junit.xml
151151

152+
test-race:
153+
name: Run tests with race detector
154+
runs-on: ubuntu-latest
155+
needs: build-and-lint
156+
timeout-minutes: 15
157+
env:
158+
CI_KERNEL_SELFTESTS: '/usr/src/linux/tools/testing/selftests/bpf'
159+
CGO_ENABLED: '1' # CGo is required by `-race`
160+
steps:
161+
- uses: actions/checkout@v4
162+
163+
- name: Set up Go
164+
uses: actions/setup-go@v5
165+
with:
166+
go-version: '${{ env.go_version }}'
167+
168+
- run: go install gotest.tools/[email protected]
169+
170+
- name: Test
171+
env:
172+
GOTRACEBACK: crash
173+
run: |
174+
gotestsum --ignore-non-json-output-lines --junitfile junit.xml -- -exec 'sudo -E' -timeout 5m -short -race -count 1 -json ./...
175+
176+
- name: Upload coredumps
177+
uses: actions/upload-artifact@v4
178+
if: ${{ failure() }}
179+
with:
180+
name: cores
181+
if-no-files-found: ignore
182+
path: |
183+
**/core-*
184+
**/*.test
185+
186+
- name: Upload Test Results
187+
if: always()
188+
uses: actions/upload-artifact@v4
189+
with:
190+
name: Test Results (previous stable Go)
191+
path: junit.xml
192+
152193
test-on-arm64:
153194
name: Run tests on arm64
154195
runs-on: ubuntu-22.04-arm64

0 commit comments

Comments
 (0)