Skip to content

Commit e0a12c4

Browse files
Add govulncheck GH Action (#235)
1 parent 69c01bf commit e0a12c4

File tree

3 files changed

+30
-120
lines changed

3 files changed

+30
-120
lines changed

.github/workflows/build-test.yaml

Lines changed: 20 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -20,14 +20,26 @@ jobs:
2020
- name: Checkout code
2121
uses: actions/checkout@c85c95e3d7251135ab7dc9ce3241c5835cc595a9 # v3.5.3
2222
- name: Setup Golang
23-
uses: actions/setup-go@fac708d6674e30b6ba41289acaab6d4b75aa0753 # v4.0.0
23+
uses: actions/setup-go@v4
24+
with:
25+
go-version-file: go.mod
2426
- name: Run golangci-lint
2527
uses: golangci/golangci-lint-action@3cfe3a4abbb849e10058ce4af15d205b6da42804 # v4.0.0
2628
with:
2729
version: v1.54
2830
args: --timeout 10m --exclude SA5011 --verbose --issues-exit-code=0
2931
only-new-issues: true
3032

33+
govulncheck:
34+
runs-on: ubuntu-latest
35+
name: Run govulncheck
36+
steps:
37+
- id: govulncheck
38+
uses: golang/govulncheck-action@v1
39+
with:
40+
go-version-file: go.mod
41+
go-package: ./...
42+
3143
test:
3244
name: Run unit tests for Go packages
3345
runs-on: ubuntu-latest
@@ -36,6 +48,8 @@ jobs:
3648
uses: actions/checkout@v3 # v3.5.3
3749
- name: Setup Go
3850
uses: actions/setup-go@v4
51+
with:
52+
go-version-file: go.mod
3953

4054
- name: Download and required packages
4155
run: |
@@ -44,13 +58,13 @@ jobs:
4458
- name: Run all unit tests
4559
run: make test
4660

47-
- name: check test coverage
48-
uses: vladopajic/go-test-coverage@v2
49-
with:
50-
config: ./.testcoverage.yml
61+
- name: Check test coverage
62+
run: |
63+
go install github.com/vladopajic/go-test-coverage/v2@latest
64+
go-test-coverage --config=./.testcoverage.yml
5165
5266
- name: Generate code coverage artifacts
53-
uses: actions/upload-artifact@0b7f8abb1508181956e8e162db84b466c27e18ce # v3.1.2
67+
uses: actions/upload-artifact@v4
5468
with:
5569
name: code-coverage
5670
path: coverage.out

go.mod

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,6 @@
11
module github.com/jetstack/version-checker
22

3-
go 1.22.0
4-
5-
toolchain go1.22.3
3+
go 1.22.6
64

75
// Do not remove this comment:
86
// please place any replace statements here at the top for visibility and add a
@@ -60,10 +58,8 @@ require (
6058
github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc // indirect
6159
github.com/docker/cli v27.1.2+incompatible // indirect
6260
github.com/docker/distribution v2.8.3+incompatible // indirect
63-
github.com/docker/docker v27.1.2+incompatible // indirect
6461
github.com/docker/docker-credential-helpers v0.8.2 // indirect
6562
github.com/emicklei/go-restful/v3 v3.12.1 // indirect
66-
github.com/evanphx/json-patch v5.9.0+incompatible // indirect
6763
github.com/fxamacker/cbor/v2 v2.7.0 // indirect
6864
github.com/go-errors/errors v1.5.1 // indirect
6965
github.com/go-logr/logr v1.4.2 // indirect

0 commit comments

Comments
 (0)