-
Notifications
You must be signed in to change notification settings - Fork 0
75 lines (69 loc) · 1.76 KB
/
ci.yml
File metadata and controls
75 lines (69 loc) · 1.76 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
name: CI
on:
push:
branches: [master]
pull_request:
workflow_dispatch:
permissions:
contents: read
jobs:
test:
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, macos-latest]
go: ['1.24', '1.25']
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v6
- uses: actions/setup-go@v6
with:
go-version: ${{ matrix.go }}
cache: true
- name: go vet
run: go vet ./...
- name: go test (race)
run: go test -race -count=1 -timeout 5m ./...
- name: coverage summary
if: matrix.os == 'ubuntu-latest' && matrix.go == '1.25'
run: |
go test -race -coverprofile=coverage.out ./...
go tool cover -func=coverage.out >> $GITHUB_STEP_SUMMARY
lint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v6
- uses: actions/setup-go@v6
with:
go-version: '1.25'
cache: true
- name: golangci-lint
uses: golangci/golangci-lint-action@v7
with:
version: v2.1.6
args: --timeout=5m
examples-build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v6
- uses: actions/setup-go@v6
with:
go-version: '1.25'
cache: true
- name: build examples
run: go build ./examples/...
- name: build cmd
run: if [ -d cmd ]; then go build ./cmd/...; fi
govulncheck:
runs-on: ubuntu-latest
continue-on-error: true
steps:
- uses: actions/checkout@v6
- uses: actions/setup-go@v6
with:
go-version: '1.25'
cache: true
- name: govulncheck
run: |
go install golang.org/x/vuln/cmd/govulncheck@latest
govulncheck ./...