Skip to content

Commit 80e95ad

Browse files
authored
Enable race conditions detector (#620)
1 parent fec371b commit 80e95ad

1 file changed

Lines changed: 6 additions & 3 deletions

File tree

.github/workflows/go.yml

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,6 @@ jobs:
1212
build:
1313
name: Build And Test Go code
1414
runs-on: ubuntu-latest
15-
env:
16-
CGO_ENABLED: 0
1715
steps:
1816
- name: Check out code into the Go module directory
1917
uses: actions/checkout@v4
@@ -26,11 +24,16 @@ jobs:
2624
# https://stackoverflow.com/questions/76269119/github-actions-go-lambda-project-different-sha256sums
2725
- name: Build
2826
run: go build -v -buildvcs=false ./...
27+
env:
28+
# Make sure to not use dependencies that rely on CGO
29+
CGO_ENABLED: 0
2930

31+
# Make sure to detect eventual race conditions
32+
# (CGO must be enabled to use -race detector)
3033
- name: Test
3134
# -count=2 ensures that test fixtures cleanup after themselves
3235
# because any leftover state will generally cause the second run to fail.
33-
run: go test -p 1 -v -shuffle=on -count=2 ./...
36+
run: go test -race -p 1 -v -shuffle=on -count=2 ./...
3437

3538
- name: Linter
3639
uses: golangci/golangci-lint-action@v6

0 commit comments

Comments
 (0)