-
Notifications
You must be signed in to change notification settings - Fork 0
102 lines (85 loc) · 2.31 KB
/
test.yml
File metadata and controls
102 lines (85 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
90
91
92
93
94
95
96
97
98
99
100
101
102
name: Tests
on:
workflow_call:
workflow_dispatch:
permissions:
contents: read
jobs:
go-test:
name: Go 1.26.x on Ubuntu
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v6
- name: Setup Go
uses: actions/setup-go@v6
with:
go-version: '1.26.x'
check-latest: true
cache: true
cache-dependency-path: go.sum
- name: Run tests
run: go test ./...
race-and-coverage:
name: Race and coverage
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v6
- name: Setup Go
uses: actions/setup-go@v6
with:
go-version: '1.26.x'
check-latest: true
cache: true
cache-dependency-path: go.sum
- name: Run race detector with coverage
run: go test -race -coverprofile=coverage.out ./...
- name: Upload coverage artifact
uses: actions/upload-artifact@v7
with:
name: coverage.out
path: coverage.out
govulncheck:
name: Govulncheck
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v6
- name: Setup Go
uses: actions/setup-go@v6
with:
go-version: '1.26.x'
check-latest: true
cache: true
cache-dependency-path: go.sum
- name: Install govulncheck
run: go install golang.org/x/vuln/cmd/govulncheck@latest
- name: Run govulncheck
run: |
"$(go env GOPATH)/bin/govulncheck" ./...
api-compat:
name: API compatibility
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v6
with:
fetch-depth: 0
- name: Setup Go
uses: actions/setup-go@v6
with:
go-version: '1.26.x'
check-latest: true
cache: true
cache-dependency-path: go.sum
- name: Install gorelease
run: go install golang.org/x/exp/cmd/gorelease@latest
- name: Run API compatibility check
run: |
git fetch --tags --force
if git tag --list 'v*' | grep -q .; then
"$(go env GOPATH)/bin/gorelease"
else
echo "No release tags found; skipping API compatibility bootstrap check."
fi