Repository navigation
56 lines (48 loc) · 1.57 KB
/
Copy pathrace.yml
File metadata and controls
56 lines (48 loc) · 1.57 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
name: Race Detection
on:
push:
branches: [ main ]
pull_request:
branches: [ main ]
jobs:
race-test:
name: Race Detector
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
arch: [amd64, arm64]
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Setup Go and Envtest
id: setup-envtest
uses: ./.github/actions/setup-go-envtest
with:
go-version: '1.24.2'
envtest-version: '1.32'
- name: Run tests with race detector (amd64)
if: matrix.arch == 'amd64'
run: |
make test-race
env:
KUBEBUILDER_ASSETS: ${{ steps.setup-envtest.outputs.envtest_assets }}
- name: Build for arm64 (optimized)
if: matrix.arch == 'arm64'
run: |
echo "Static analysis and minimal compilation for linux/arm64"
# Static analysis only to check for basic errors
GOOS=linux GOARCH=arm64 go vet ./...
# Generate minimal binaries without linking (no actual test execution)
# -run=^$ indicates that no tests will be executed
GOOS=linux GOARCH=arm64 go test -run=^$ -c ./internal/controller
GOOS=linux GOARCH=arm64 go test -run=^$ -c ./api/...
env:
KUBEBUILDER_ASSETS: ${{ steps.setup-envtest.outputs.envtest_assets }}
- name: Upload coverage
if: matrix.arch == 'amd64'
uses: actions/upload-artifact@v4
with:
name: coverage-race-linux-amd64
path: coverage.out
if-no-files-found: warn