-
Notifications
You must be signed in to change notification settings - Fork 61
39 lines (37 loc) · 1.32 KB
/
test.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
name: test
on:
pull_request:
types: [synchronize]
jobs:
test:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Trivy vulnerability scanner
uses: aquasecurity/trivy-action@master
with:
scan-type: "fs"
ignore-unfixed: true
format: "sarif"
output: "trivy-results.sarif"
severity: "CRITICAL"
- name: Upload Trivy scan results to GitHub Security tab
uses: github/codeql-action/upload-sarif@v2
with:
sarif_file: "trivy-results.sarif"
- name: Set up Go
uses: actions/setup-go@v3
with:
go-version: 1.20
- name: golangci-lint
uses: golangci/golangci-lint-action@v3
- name: Series of tests
run: |
GO_FILES=$(find . -iname '*.go' -type f) # All the .go files, excluding vendor/
test -z $(gofmt -s -l $GO_FILES) # Fail if a .go file hasn't been formatted with gofmt
go test -v -race ./... # Run all the tests with the race detector enabled
go vet ./... # go vet is the official Go static analyzer
go install github.com/fzipp/gocyclo/cmd/gocyclo@latest
/home/runner/go/bin/gocyclo -over 19 cmd pkg # forbid code with huge/complex functions
go build cmd/helm-gcs/main.go