Skip to content

Commit eac0566

Browse files
committed
ci: add audit setup
1 parent a45ed85 commit eac0566

File tree

2 files changed

+32
-2
lines changed

2 files changed

+32
-2
lines changed

.github/workflows/go.yml

Lines changed: 21 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,10 @@ name: Continues Integration
22

33
on:
44
push:
5-
branches: [master]
5+
branches:
6+
- master
7+
- feature/*
8+
- bugfix/*
69
pull_request:
710
branches:
811
- master
@@ -47,9 +50,25 @@ jobs:
4750
flags: unittests
4851
name: codecov-umbrella
4952

50-
lint:
53+
audit:
5154
runs-on: ubuntu-latest
55+
steps:
56+
- name: Checkout repo
57+
uses: actions/checkout@v2
5258

59+
- name: Set up Go ${{ matrix.go }}
60+
uses: actions/setup-go@v2
61+
with:
62+
go-version: ${{ matrix.go }}
63+
64+
- name: WriteGoList
65+
run: go list -json -deps > go.list
66+
67+
- name: Nancy
68+
uses: sonatype-nexus-community/nancy-github-action@main
69+
70+
lint:
71+
runs-on: ubuntu-latest
5372
steps:
5473
- name: Checkout repo
5574
uses: actions/checkout@v2

Makefile

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,11 @@ dependencies: ## Install dependencies requried for development operations.
3333
@go get github.com/stretchr/testify/mock
3434
@go get github.com/vektra/mockery/.../
3535
@go install github.com/golangci/golangci-lint/cmd/golangci-lint@v1.45.0
36+
@go install github.com/psampaz/go-mod-outdated@latest
37+
@go install github.com/jondot/goweight@latest
38+
@go get -t -u golang.org/x/tools/cmd/cover
39+
@go get -t -u github.com/sonatype-nexus-community/nancy@latest
40+
@go get -u ./...
3641
@go mod tidy
3742

3843
.PHONY: clean
@@ -49,3 +54,9 @@ coverage: ## Show the test coverage on browser.
4954
go test -covermode=count -coverprofile=coverage.out ./...
5055
go tool cover -func=coverage.out | tail -n 1
5156
go tool cover -html=coverage.out
57+
58+
.PHONY: audit
59+
audit: ## Audit the code for updates, vulnerabilities and binary weight.
60+
go list -u -m -json all | go-mod-outdated -update -direct
61+
go list -json -deps | nancy sleuth
62+
goweight | head -n 20

0 commit comments

Comments
 (0)