-
Notifications
You must be signed in to change notification settings - Fork 1
50 lines (39 loc) · 1.05 KB
/
Copy pathci.yml
File metadata and controls
50 lines (39 loc) · 1.05 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
name: CI
on:
push:
branches: [master]
pull_request:
permissions:
contents: read
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v7
- name: Set up Go
uses: actions/setup-go@v7
with:
go-version-file: go.mod
check-latest: true
- name: Verify go.mod is tidy
run: |
go mod tidy
git diff --exit-code -- go.mod go.sum
- name: Check formatting
run: |
go install golang.org/x/tools/cmd/goimports@latest
test -z "$(goimports -l .)" || { echo "goimports found unformatted files:"; goimports -l .; exit 1; }
- name: go vet
run: go vet ./...
- name: staticcheck
run: |
go install honnef.co/go/tools/cmd/staticcheck@latest
staticcheck ./...
- name: Build
run: go build ./...
- name: Test (race)
run: go test -race ./...
- name: govulncheck
run: |
go install golang.org/x/vuln/cmd/govulncheck@latest
govulncheck ./...