From 36a93554c51a4cf94728bfd256d1b3bcbd4382fe Mon Sep 17 00:00:00 2001 From: Paul Cacheux Date: Tue, 11 Feb 2025 08:09:36 +0100 Subject: [PATCH] ci: add test run with race detector Signed-off-by: Paul Cacheux --- .github/workflows/ci.yml | 41 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 41 insertions(+) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 81eefab3b..4bb9027b9 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -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/gotestsum@v1.8.1 + + - 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