File tree Expand file tree Collapse file tree 4 files changed +97
-116
lines changed Expand file tree Collapse file tree 4 files changed +97
-116
lines changed Original file line number Diff line number Diff line change 1+ name : CI
2+
3+ on :
4+ push :
5+ pull_request :
6+
7+ jobs :
8+ test :
9+ name : Test
10+ runs-on : ubuntu-latest
11+ permissions :
12+ contents : read
13+ strategy :
14+ matrix :
15+ go-version : ['1.24.x', '1.25.x']
16+
17+ steps :
18+ - name : Checkout code
19+ uses : actions/checkout@v4
20+
21+ - name : Set up Go
22+ uses : actions/setup-go@v5
23+ with :
24+ go-version : ${{ matrix.go-version }}
25+
26+ - name : Cache Go modules
27+ uses : actions/cache@v4
28+ with :
29+ path : |
30+ ~/.cache/go-build
31+ ~/go/pkg/mod
32+ key : ${{ runner.os }}-go-${{ matrix.go-version }}-${{ hashFiles('**/go.sum') }}
33+ restore-keys : |
34+ ${{ runner.os }}-go-${{ matrix.go-version }}-
35+
36+ - name : Download dependencies
37+ run : go mod download
38+
39+ - name : Verify dependencies
40+ run : go mod verify
41+
42+ - name : Build
43+ run : go build -v ./...
44+
45+ - name : Run tests with coverage
46+ run : go test -v -race -coverprofile=coverage.out -covermode=atomic ./...
47+
48+ - name : Upload coverage to Codecov
49+ if : matrix.go-version == '1.25.x'
50+ uses : codecov/codecov-action@v4
51+ with :
52+ files : ./coverage.out
53+ flags : unittests
54+ name : codecov-go-netconf
55+ token : ${{ secrets.CODECOV_TOKEN }}
56+
57+ lint :
58+ name : Lint
59+ runs-on : ubuntu-latest
60+ permissions :
61+ contents : read
62+
63+ steps :
64+ - name : Checkout code
65+ uses : actions/checkout@v4
66+
67+ - name : Set up Go
68+ uses : actions/setup-go@v5
69+ with :
70+ go-version : ' 1.25.x'
71+
72+ - name : Run golangci-lint
73+ uses : golangci/golangci-lint-action@v8
74+ with :
75+ version : v2.5
76+ args : --timeout=5m
77+
78+ security :
79+ name : Security
80+ runs-on : ubuntu-latest
81+ permissions :
82+ contents : read
83+
84+ steps :
85+ - name : Checkout code
86+ uses : actions/checkout@v4
87+
88+ - name : Set up Go
89+ uses : actions/setup-go@v5
90+ with :
91+ go-version : ' 1.25.x'
92+
93+ - name : Install govulncheck
94+ run : go install golang.org/x/vuln/cmd/govulncheck@latest
95+
96+ - name : Run govulncheck
97+ run : govulncheck ./...
Load Diff This file was deleted.
Load Diff This file was deleted.
Load Diff This file was deleted.
You can’t perform that action at this time.
0 commit comments