-
Notifications
You must be signed in to change notification settings - Fork 0
65 lines (53 loc) · 1.44 KB
/
ci.yml
File metadata and controls
65 lines (53 loc) · 1.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
name: CI
on:
push:
branches: [main]
pull_request:
branches: [main]
permissions:
contents: read
jobs:
ci:
name: Build, test, lint, and scan
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
go: ["1.25", "1.26"]
steps:
- name: Check out repository
uses: actions/checkout@v6
- name: Set up Go
uses: actions/setup-go@v6
with:
go-version: "${{ matrix.go }}.x"
cache: true
- name: Download dependencies
run: go mod download
- name: Run golangci-lint
continue-on-error: true
uses: golangci/golangci-lint-action@v9
with:
version: v2.12.2
- name: Run tests
run: go test -v -coverprofile=coverage.txt ./...
- name: Show coverage summary
run: go tool cover -func=coverage.txt | tail -1
- name: Upload coverage report
if: matrix.go == '1.26'
uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7
with:
name: coverage-report
path: coverage.txt
retention-days: 30
- name: Build plugin binary
run: go build -v ./cmd/plugin
- name: Run Trivy filesystem scan
uses: aquasecurity/trivy-action@v0.36.0
with:
scan-type: fs
scan-ref: .
format: table
exit-code: '1'
ignore-unfixed: true
severity: CRITICAL,HIGH