-
Notifications
You must be signed in to change notification settings - Fork 0
89 lines (82 loc) · 2.31 KB
/
Copy pathci.yml
File metadata and controls
89 lines (82 loc) · 2.31 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
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
name: CI
on:
push:
branches: [main]
pull_request:
# Cancel superseded runs on the same ref (e.g. force-pushes to a PR).
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
permissions:
contents: read
jobs:
test:
name: test (${{ matrix.os }})
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, macos-latest]
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v6
- uses: actions/setup-go@v6
with:
go-version-file: go.mod
cache: true
- name: Check formatting
run: |
unformatted=$(gofmt -l .)
if [ -n "$unformatted" ]; then
echo "These files are not gofmt-clean:"
echo "$unformatted"
exit 1
fi
- name: Vet
run: go vet ./...
- name: Build
run: go build ./...
- name: Test
run: go test ./... -count=1
# Per-PR race tier: full suite (NOT -short — the -short gate skips the
# highest-value concurrency tests: TestParallelBuilderStress,
# TestParallelBuilderConcurrentBuilds, TestRapidOpenClose). A single full
# run is ~2 min; deeper stress (repeat + GOMAXPROCS variation) runs on
# merge to main via race-stress.yml.
race:
name: race (full)
runs-on: ubuntu-latest
env:
# Remember more prior accesses so races with longer gaps still report.
GORACE: history_size=2
steps:
- uses: actions/checkout@v6
- uses: actions/setup-go@v6
with:
go-version-file: go.mod
cache: true
- name: Test (race)
run: go test -race -count=1 -timeout 15m ./...
lint:
name: golangci-lint
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v6
- uses: actions/setup-go@v6
with:
go-version-file: go.mod
# golangci-lint-action manages its own analysis cache.
cache: false
- uses: golangci/golangci-lint-action@v9
with:
version: v2.12.2
govulncheck:
name: govulncheck
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v6
- uses: actions/setup-go@v6
with:
go-version-file: go.mod
cache: true
- name: Vulnerability scan
run: go run golang.org/x/vuln/cmd/govulncheck@latest ./...