23
23
go-version : ${{ env.GO_VERSION }}
24
24
25
25
- name : golangci-lint
26
- uses : golangci/golangci-lint-action@v4
26
+ uses : golangci/golangci-lint-action@v8
27
27
with :
28
28
version : latest
29
29
args : --timeout=5m
@@ -46,22 +46,21 @@ jobs:
46
46
- name : Verify dependencies
47
47
run : go mod verify
48
48
49
- - name : Run tests
50
- run : go test -v -race -coverprofile=coverage.out -covermode=atomic ./...
49
+ - name : Run Go tests (JSON + coverage)
50
+ run : |
51
+ go test -json -coverprofile=coverage.out -covermode=atomic ./... | tee test2json.log
51
52
52
- - name : Upload coverage to Codecov
53
- uses : codecov/codecov-action@v4
54
- with :
55
- file : ./coverage.out
56
- flags : unittests
57
- name : codecov-umbrella
53
+ - name : Convert test output to CTRF
54
+ run : |
55
+ go run github.com/ctrf-io/go-ctrf-json-reporter/cmd/go-ctrf-json-reporter@latest \
56
+ --input test2json.log --output ctrf/tests.json
58
57
59
- - name : Generate test summary
60
- uses : test-summary/action@v2
61
- with :
62
- paths : |
63
- coverage.out
58
+ - name : Publish Test Report
59
+ uses : ctrf-io/github-test-reporter@v1
64
60
if : always()
61
+ with :
62
+ report-path : ' ./ctrf/tests.json'
63
+ github-report : true
65
64
66
65
build :
67
66
name : Build
@@ -114,46 +113,6 @@ jobs:
114
113
go-version : ${{ env.GO_VERSION }}
115
114
116
115
- name : Run Gosec Security Scanner
117
- uses : securecodewarrior/github-action-gosec@master
118
- with :
119
- args : ' -fmt sarif -out gosec.sarif ./...'
120
-
121
- - name : Upload SARIF file
122
- uses : github/codeql-action/upload-sarif@v3
116
+ uses : securego/gosec@master
123
117
with :
124
- sarif_file : gosec.sarif
125
-
126
- - name : Run Trivy vulnerability scanner
127
- uses : aquasecurity/trivy-action@master
128
- with :
129
- scan-type : ' fs'
130
- scan-ref : ' .'
131
- format : ' sarif'
132
- output : ' trivy-results.sarif'
133
-
134
- - name : Upload Trivy scan results to GitHub Security tab
135
- uses : github/codeql-action/upload-sarif@v3
136
- with :
137
- sarif_file : ' trivy-results.sarif'
138
-
139
- dependency-check :
140
- name : Dependency Check
141
- runs-on : ubuntu-latest
142
- steps :
143
- - name : Checkout
144
- uses : actions/checkout@v4
145
-
146
- - name : Set up Go
147
- uses : actions/setup-go@v4
148
- with :
149
- go-version : ${{ env.GO_VERSION }}
150
-
151
- - name : Check for known vulnerabilities
152
- uses : sonatypecommunity/nancy-github-action@main
153
- with :
154
- nancyVersion : v1.0.46
155
-
156
- - name : Run govulncheck
157
- run : |
158
- go install golang.org/x/vuln/cmd/govulncheck@latest
159
- govulncheck ./...
118
+ args : ./...
0 commit comments