-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
c00a30c
commit aaa5a29
Showing
1 changed file
with
29 additions
and
19 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -12,44 +12,54 @@ env: | |
HEALTH_CRM_BASE_URL: ${{ secrets.HEALTH_CRM_BASE_URL }} | ||
|
||
jobs: | ||
lint_and_test: | ||
golangci: | ||
strategy: | ||
fail-fast: true | ||
matrix: | ||
go-version: [1.18.x] | ||
go-version: [1.21.x] | ||
os: [ubuntu-latest] | ||
runs-on: ${{ matrix.os }} | ||
steps: | ||
- uses: actions/setup-go@v4 | ||
with: | ||
go-version: ${{ matrix.go-version }} | ||
- uses: actions/checkout@v3 | ||
- name: golangci-lint | ||
uses: golangci/golangci-lint-action@v3 | ||
with: | ||
version: latest | ||
|
||
lint_and_test: | ||
needs: [golangci] | ||
strategy: | ||
matrix: | ||
go-version: [1.23.x] | ||
os: [ubuntu-latest] | ||
runs-on: ${{ matrix.os }} | ||
timeout-minutes: 80 | ||
steps: | ||
- uses: actions/checkout@v3.1.0 | ||
- uses: actions/checkout@v4 | ||
- name: Install Go | ||
uses: actions/setup-go@v3.3.1 | ||
uses: actions/setup-go@v4 | ||
with: | ||
go-version: ${{ matrix.go-version }} | ||
|
||
- name: Install Go dependencies | ||
run: | | ||
curl -sSfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | sh -s -- -b $(go env GOPATH)/bin v1.37.1 | ||
curl -sfL https://raw.githubusercontent.com/securego/gosec/master/install.sh | sh -s -- -b $(go env GOPATH)/bin v2.13.1 | ||
go install honnef.co/go/tools/cmd/[email protected] | ||
go install github.com/ory/go-acc@latest | ||
go install github.com/axw/gocov/gocov@latest | ||
go install github.com/kisielk/errcheck@latest | ||
- name: Run lint and test | ||
go mod download | ||
go get github.com/axw/gocov/gocov | ||
go get github.com/ory/go-acc | ||
go install github.com/ory/go-acc | ||
go install github.com/axw/gocov/gocov | ||
- name: Run tests | ||
run: | | ||
staticcheck ./... | ||
go fmt $(go list ./... | grep -v /vendor/) | ||
go vet $(go list ./... | grep -v /vendor/) | ||
errcheck -ignore 'os:.*,' $(go list ./... | grep -v /vendor/) | ||
gosec -exclude=G304,G101 ./... | ||
go-acc -o coverage.txt --ignore generated,cmd ./... -- -timeout 60m | ||
grep -v "generated.go" coverage.txt > coverage.out | ||
go tool cover -html=coverage.out -o coverage.html | ||
gocov convert coverage.out > coverage.json | ||
gocov report coverage.json > coverage_report.txt | ||
tail coverage_report.txt | ||
- name: Install goveralls | ||
env: | ||
GO111MODULE: off | ||
|