Skip to content

Commit

Permalink
Support new testing toolset (#129)
Browse files Browse the repository at this point in the history
* Support new testing
  • Loading branch information
hayorov authored Apr 30, 2022
1 parent 1209dab commit 52555b1
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 14 deletions.
6 changes: 3 additions & 3 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2
uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Run Trivy vulnerability scanner in repo mode
Expand All @@ -23,11 +23,11 @@ jobs:
output: "trivy-results.sarif"
severity: "CRITICAL"
- name: Upload Trivy scan results to GitHub Security tab
uses: github/codeql-action/upload-sarif@v1
uses: github/codeql-action/upload-sarif@v2
with:
sarif_file: "trivy-results.sarif"
- name: Set up Go
uses: actions/setup-go@v2
uses: actions/setup-go@v3
with:
go-version: 1.18
- name: git cleanup
Expand Down
21 changes: 10 additions & 11 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,32 +9,31 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Run Trivy vulnerability scanner in repo mode
uses: actions/checkout@v3
- name: Trivy vulnerability scanner
uses: aquasecurity/trivy-action@master
with:
scan-type: "fs"
ignore-unfixed: true
format: "template"
template: "@/contrib/sarif.tpl"
format: "sarif"
output: "trivy-results.sarif"
severity: "CRITICAL"
- name: Upload Trivy scan results to GitHub Security tab
uses: github/codeql-action/upload-sarif@v1
uses: github/codeql-action/upload-sarif@v2
with:
sarif_file: "trivy-results.sarif"
- name: Set up Go
uses: actions/setup-go@v2
uses: actions/setup-go@v3
with:
go-version: 1.18
- 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/
go get -u golang.org/x/lint/golint # Linter
go get github.com/fzipp/gocyclo/cmd/gocyclo
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
gocyclo -over 19 cmd pkg # forbid code with huge/complex functions
golint -set_exit_status $(go list ./...) # one last linter
go build cmd/helm-gcs/main.go # compilation
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
2 changes: 2 additions & 0 deletions .golangci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
run:
timeout: 5m

0 comments on commit 52555b1

Please sign in to comment.