Skip to content

Commit 12bd29a

Browse files
committed
Consolidate ci workflows
1 parent ba1d20c commit 12bd29a

File tree

4 files changed

+97
-116
lines changed

4 files changed

+97
-116
lines changed

.github/workflows/ci.yml

Lines changed: 97 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,97 @@
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 ./...

.github/workflows/lint.yml

Lines changed: 0 additions & 46 deletions
This file was deleted.

.github/workflows/security.yml

Lines changed: 0 additions & 28 deletions
This file was deleted.

.github/workflows/test.yml

Lines changed: 0 additions & 42 deletions
This file was deleted.

0 commit comments

Comments
 (0)