Skip to content

Commit ad74daa

Browse files
authoredFeb 6, 2023
Merge pull request #31 from goark/fix-bugs-and-testing
Update GitHub Actions
2 parents 643f44e + 69a8647 commit ad74daa

File tree

4 files changed

+21
-8
lines changed

4 files changed

+21
-8
lines changed
 

‎.github/workflows/lint.yml

+6-2
Original file line numberDiff line numberDiff line change
@@ -14,10 +14,10 @@ jobs:
1414
name: lint
1515
runs-on: ubuntu-latest
1616
steps:
17+
- uses: actions/checkout@v3
1718
- uses: actions/setup-go@v3
1819
with:
19-
go-version: ^1.18
20-
- uses: actions/checkout@v3
20+
go-version-file: 'go.mod'
2121
- name: golangci-lint
2222
uses: golangci/golangci-lint-action@v3
2323
with:
@@ -44,3 +44,7 @@ jobs:
4444
# skip-build-cache: true
4545
- name: testing
4646
run: go test -shuffle on ./...
47+
- name: install govulncheck
48+
run: go install golang.org/x/vuln/cmd/govulncheck@latest
49+
- name: running govulncheck
50+
run: govulncheck ./...

‎.github/workflows/vulns.yml

+3-3
Original file line numberDiff line numberDiff line change
@@ -9,10 +9,10 @@ jobs:
99
name: Vulnerability scanner
1010
runs-on: ubuntu-latest
1111
steps:
12-
- uses: actions/checkout@v2
13-
- uses: actions/setup-go@v2
12+
- uses: actions/checkout@v3
13+
- uses: actions/setup-go@v3
1414
with:
15-
go-version: ^1.18
15+
go-version: ^1.20
1616
- name: WriteGoList
1717
run: go list -json -m all > go.list
1818
- name: Nancy

‎Taskfile.yml

+11-2
Original file line numberDiff line numberDiff line change
@@ -5,18 +5,27 @@ tasks:
55
cmds:
66
- task: clean
77
- task: test
8+
- task: nancy
89

910
test:
1011
desc: Test and lint.
1112
cmds:
1213
- go mod verify
1314
- go test -shuffle on ./...
14-
- docker run --rm -v $(pwd):/app -w /app golangci/golangci-lint:v1.46.2 golangci-lint run --enable gosec --timeout 3m0s ./...
15+
- docker run --rm -v $(pwd):/app -w /app golangci/golangci-lint:v1.51.1 golangci-lint run --enable gosec --timeout 3m0s ./...
16+
sources:
17+
- ./go.mod
18+
- '**/*.go'
19+
20+
nancy:
21+
desc: Check vulnerability of external packages with Nancy.
22+
cmds:
23+
- depm list -j | nancy sleuth -n
1524
sources:
1625
- ./go.mod
1726
- '**/*.go'
1827

1928
clean:
2029
desc: Initialize module and build cache, and remake go.sum file.
2130
cmds:
22-
- go mod tidy -v -go=1.18
31+
- go mod tidy -v -go=1.20

‎go.mod

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
module github.com/goark/pa-api
22

3-
go 1.18
3+
go 1.20
44

55
require (
66
github.com/goark/errs v1.1.0

0 commit comments

Comments
 (0)
Please sign in to comment.