-
Notifications
You must be signed in to change notification settings - Fork 0
104 lines (86 loc) · 2.44 KB
/
Copy pathci.yml
File metadata and controls
104 lines (86 loc) · 2.44 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
103
104
name: CI
on:
pull_request:
push:
branches: [main]
permissions:
contents: read
env:
GOTOOLCHAIN: local
jobs:
test:
name: test (${{ matrix.go-version }})
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
go-version: ["1.25", "1.26"]
steps:
- name: Checkout repository
uses: actions/checkout@v6
- name: Set up Go
uses: actions/setup-go@v6
with:
go-version: ${{ matrix.go-version }}
cache-dependency-path: go.sum
- name: Install gotestsum
run: go install gotest.tools/gotestsum@v1.13.0
- name: Run tests
run: gotestsum --format short-verbose --packages="./..." --junitfile unit.xml -- -short -race -coverprofile=coverage.out -timeout=30m ./...
- name: Upload test artifacts
uses: actions/upload-artifact@v7
with:
name: test-artifacts-go${{ matrix.go-version }}
path: |
coverage.out
unit.xml
if-no-files-found: error
- name: Coverage Report
if: matrix.go-version == '1.26'
run: |
echo "### Coverage Report" >> "$GITHUB_STEP_SUMMARY"
echo "" >> "$GITHUB_STEP_SUMMARY"
if [ -f coverage.out ]; then
go tool cover -func=coverage.out | tail -1 >> "$GITHUB_STEP_SUMMARY"
fi
lint:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v6
- name: Set up Go
uses: actions/setup-go@v6
with:
go-version: "1.26"
cache-dependency-path: go.sum
- name: Check validator markers
run: make check-validator-markers
- name: Run golangci-lint
uses: golangci/golangci-lint-action@v9
with:
version: v2.11.4
args: --config=.golangci.yml
build:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v6
- name: Set up Go
uses: actions/setup-go@v6
with:
go-version: "1.26"
cache-dependency-path: go.sum
- name: Build
run: make build
govulncheck:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v6
- name: Run govulncheck
uses: golang/govulncheck-action@v1
with:
go-version-input: "1.26"
go-package: ./...
repo-checkout: false
output-format: text