-
Notifications
You must be signed in to change notification settings - Fork 5
81 lines (71 loc) · 2.28 KB
/
pr.yml
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
name: Pull Request
on:
pull_request:
branches:
- main
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v1
- name: Setup Go 1.21.x
uses: actions/setup-go@v4
with:
go-version-file: ${{ github.workspace }}/src/go.mod
cache: true
cache-dependency-path: ${{ github.workspace }}/src/go.sum
- name: Install dependencies
working-directory: ${{ github.workspace }}/src
run: |
go get .
- name: Download modules
working-directory: ${{ github.workspace }}/src
run: |
go mod download
- name: Build
working-directory: ${{ github.workspace }}/src
run: go build -v ./...
- name: Test
working-directory: ${{ github.workspace }}/src
run: |
go install github.com/axw/gocov/gocov@latest
go install github.com/AlekSi/gocov-xml@latest
go install github.com/matm/gocov-html/cmd/gocov-html@latest
go test -coverprofile coverage.txt -covermode count -v ./...
gocov convert coverage.txt | gocov-xml > ../cobertura-coverage.xml
- name: Upload Code Coverage
uses: actions/upload-artifact@v4
with:
name: code-coverage
path: ${{ github.workspace }}/cobertura-coverage.xml
- name: Code Coverage Summary Report
uses: irongut/[email protected]
with:
filename: cobertura-coverage.xml
badge: true
fail_below_min: false
format: markdown
hide_branch_rate: false
hide_complexity: false
indicators: true
output: both
thresholds: "40 80"
- name: Add Coverage PR Comment
if: false
uses: marocchino/sticky-pull-request-comment@v2
with:
recreate: true
path: code-coverage-results.md
- name: Run Gosec Security Scanner
uses: securego/gosec@master
with:
args: "-no-fail -fmt sarif -out results.sarif ./..."
- name: Upload SARIF file
if: false
uses: github/codeql-action/upload-sarif@v3
with:
sarif_file: results.sarif
- name: Build Helm Chart
run: |
helm lint ./helm
make build-helm-chart