@@ -2,9 +2,7 @@ name: Test & Build
22on :
33 pull_request :
44 branches :
5- - ' main'
6- paths :
7- - " !README.md"
5+ - " main"
86
97concurrency :
108 group : ${{ github.workflow }}-${{ github.ref }}
@@ -13,9 +11,9 @@ concurrency:
1311jobs :
1412 lint :
1513 permissions :
16- contents : read # for actions/checkout to fetch code
17- pull-requests : read # for golangci/golangci-lint-action to fetch pull requests
18- checks : write # for golangci/golangci-lint-action to annotate Pull Requests
14+ contents : read # for actions/checkout to fetch code
15+ pull-requests : read # for golangci/golangci-lint-action to fetch pull requests
16+ checks : write # for golangci/golangci-lint-action to annotate Pull Requests
1917 name : Lint Go code
2018 runs-on : ubuntu-latest
2119 steps :
2624 with :
2725 go-version-file : go.mod
2826 - name : Run golangci-lint
29- uses : golangci/golangci-lint-action@2226d7cb06a077cd73e56eedd38eecad18e5d837 # v6.5.0
27+ uses : golangci/golangci-lint-action@2226d7cb06a077cd73e56eedd38eecad18e5d837 # v6.5.0
3028 with :
3129 version : v1.54
3230 args : --timeout 10m --exclude SA5011 --verbose --issues-exit-code=0
@@ -39,40 +37,41 @@ jobs:
3937 - id : govulncheck
4038 uses : golang/govulncheck-action@v1
4139 with :
42- go-version-file : go.mod
43- go-package : ./...
40+ go-version-file : go.mod
41+ go-package : ./...
4442
4543 test :
4644 name : Run unit tests for Go packages
4745 runs-on : ubuntu-latest
4846 steps :
49- - name : Checkout code
50- uses : actions/checkout@v4 # v3.5.3
51- - name : Setup Go
52- uses : actions/setup-go@v5
53- with :
54- go-version-file : go.mod
47+ - name : Checkout code
48+ uses : actions/checkout@v4 # v3.5.3
49+ - name : Setup Go
50+ uses : actions/setup-go@v5
51+ with :
52+ go-version-file : go.mod
5553
56- - name : Download and required packages
57- run : |
58- make deps
54+ - name : Download and required packages
55+ run : |
56+ make deps
5957
60- - name : Run all unit tests
61- run : make test
58+ - name : Run all unit tests
59+ run : make test
6260
63- - name : check test coverage
64- uses : vladopajic/go-test-coverage@v2
65- with :
66- config : ./.testcoverage.yml
61+ - name : check test coverage
62+ uses : vladopajic/go-test-coverage@v2
63+ with :
64+ config : ./.testcoverage.yml
6765
68- - name : Trigger Coverage update
69- uses : ./coverage-badge.yaml
66+ - name : Trigger Coverage update
67+ uses : ./.github/workflows/coverage-badge.yaml
68+ continue-on-error : true
7069
71- - name : Generate code coverage artifacts
72- uses : actions/upload-artifact@v4
73- with :
74- name : code-coverage
75- path : coverage.out
70+ - name : Generate code coverage artifacts
71+ uses : actions/upload-artifact@v4
72+ with :
73+ name : code-coverage
74+ path : coverage.out
7675
7776 build :
7877 needs :
@@ -87,33 +86,33 @@ jobs:
8786 - linux/arm64
8887 name : Build Images
8988 steps :
90- - name : Checkout code
91- uses : actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7
92- - name : Set up QEMU
93- uses : docker/setup-qemu-action@v3
89+ - name : Checkout code
90+ uses : actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7
91+ - name : Set up QEMU
92+ uses : docker/setup-qemu-action@v3
9493
95- - name : Set up Docker Buildx
96- uses : docker/setup-buildx-action@v3
97- with :
98- platforms : ${{ matrix.platform }}
94+ - name : Set up Docker Buildx
95+ uses : docker/setup-buildx-action@v3
96+ with :
97+ platforms : ${{ matrix.platform }}
9998
100- - name : Build Images
101- uses : docker/build-push-action@v6
102- with :
103- context : .
104- platforms : ${{ matrix.platform }}
105- load : true
106- push : false
107- tags : quay.io/jetstack/version-checker:${{github.sha}}
108- cache-from : type=gha
109- cache-to : type=gha,mode=max
99+ - name : Build Images
100+ uses : docker/build-push-action@v6
101+ with :
102+ context : .
103+ platforms : ${{ matrix.platform }}
104+ load : true
105+ push : false
106+ tags : quay.io/jetstack/version-checker:${{github.sha}}
107+ cache-from : type=gha
108+ cache-to : type=gha,mode=max
110109
111- - name : Run Trivy vulnerability scanner
112- uses :
aquasecurity/[email protected] 113- with :
114- image-ref : ' quay.io/jetstack/version-checker:${{github.sha}}'
115- format : ' table'
116- exit-code : ' 1 '
117- ignore-unfixed : true
118- vuln-type : ' os,library'
119- severity : ' CRITICAL,HIGH'
110+ - name : Run Trivy vulnerability scanner
111+ uses :
aquasecurity/[email protected] 112+ with :
113+ image-ref : " quay.io/jetstack/version-checker:${{github.sha}}"
114+ format : " table"
115+ exit-code : " 1 "
116+ ignore-unfixed : true
117+ vuln-type : " os,library"
118+ severity : " CRITICAL,HIGH"
0 commit comments