Skip to content

Commit

Permalink
feat: bump checkout versions and use lint action (#4)
Browse files Browse the repository at this point in the history
  • Loading branch information
robinmuhia authored Jun 21, 2024
1 parent fa6fd3f commit 0dd658f
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 15 deletions.
29 changes: 14 additions & 15 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,40 +12,39 @@ jobs:
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/checkout@v3.1.0
- uses: actions/checkout@v4.1.7
- name: Install Go
uses: actions/setup-go@v3.3.1
uses: actions/setup-go@v5.0.1
with:
go-version: ${{ matrix.go-version }}

- name: Run lint
uses: golangci/golangci-lint-action@v3
with:
version: latest

- 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/staticcheck@2022.1
go mod download
go get github.com/axw/gocov/gocov@latest
go get github.com/ory/go-acc@latest
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
- name: Run test
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
Expand All @@ -54,4 +53,4 @@ jobs:
- name: Send coverage
env:
COVERALLS_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: goveralls -coverprofile=coverage.out -service=github
run: goveralls -coverprofile=coverage.out -service=github
4 changes: 4 additions & 0 deletions .golangci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,10 @@ linters-settings:
funlen:
lines: -1
statements: -1
gosec:
excludes:
- G304
- G101
revive:
rules:
- name: unused-parameter
Expand Down

0 comments on commit 0dd658f

Please sign in to comment.