Skip to content

Commit

Permalink
Merge pull request #31 from goark/fix-bugs-and-testing
Browse files Browse the repository at this point in the history
Update GitHub Actions
  • Loading branch information
spiegel-im-spiegel authored Feb 6, 2023
2 parents 643f44e + 69a8647 commit ad74daa
Show file tree
Hide file tree
Showing 4 changed files with 21 additions and 8 deletions.
8 changes: 6 additions & 2 deletions .github/workflows/lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,10 @@ jobs:
name: lint
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-go@v3
with:
go-version: ^1.18
- uses: actions/checkout@v3
go-version-file: 'go.mod'
- name: golangci-lint
uses: golangci/golangci-lint-action@v3
with:
Expand All @@ -44,3 +44,7 @@ jobs:
# skip-build-cache: true
- name: testing
run: go test -shuffle on ./...
- name: install govulncheck
run: go install golang.org/x/vuln/cmd/govulncheck@latest
- name: running govulncheck
run: govulncheck ./...
6 changes: 3 additions & 3 deletions .github/workflows/vulns.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,10 @@ jobs:
name: Vulnerability scanner
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/setup-go@v2
- uses: actions/checkout@v3
- uses: actions/setup-go@v3
with:
go-version: ^1.18
go-version: ^1.20
- name: WriteGoList
run: go list -json -m all > go.list
- name: Nancy
Expand Down
13 changes: 11 additions & 2 deletions Taskfile.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,18 +5,27 @@ tasks:
cmds:
- task: clean
- task: test
- task: nancy

test:
desc: Test and lint.
cmds:
- go mod verify
- go test -shuffle on ./...
- docker run --rm -v $(pwd):/app -w /app golangci/golangci-lint:v1.46.2 golangci-lint run --enable gosec --timeout 3m0s ./...
- docker run --rm -v $(pwd):/app -w /app golangci/golangci-lint:v1.51.1 golangci-lint run --enable gosec --timeout 3m0s ./...
sources:
- ./go.mod
- '**/*.go'

nancy:
desc: Check vulnerability of external packages with Nancy.
cmds:
- depm list -j | nancy sleuth -n
sources:
- ./go.mod
- '**/*.go'

clean:
desc: Initialize module and build cache, and remake go.sum file.
cmds:
- go mod tidy -v -go=1.18
- go mod tidy -v -go=1.20
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
module github.com/goark/pa-api

go 1.18
go 1.20

require (
github.com/goark/errs v1.1.0
Expand Down

0 comments on commit ad74daa

Please sign in to comment.