feat: run rules #186
Workflow file for this run
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
name: CI | |
on: | |
push: | |
branches: | |
- master | |
pull_request: | |
jobs: | |
golangci: | |
name: Lint | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v2 | |
- name: Lint | |
uses: golangci/golangci-lint-action@v3 | |
with: | |
# Required: the version of golangci-lint is required and must be specified without patch version: we always use the latest patch version. | |
version: v1.55 | |
coverage: | |
name: Build | |
runs-on: ubuntu-latest | |
strategy: | |
matrix: | |
go: ['1.17', '1.18', '1.19', '1.20', '1.21', '1.22'] | |
env: | |
GOFLAGS: -mod=readonly | |
GOPROXY: https://proxy.golang.org | |
steps: | |
- name: Set up Go | |
uses: actions/setup-go@v3 | |
with: | |
go-version: ${{ matrix.go }} | |
- name: Checkout code | |
uses: actions/checkout@v3 | |
- name: go generate | |
run: go generate | |
- name: Run tests | |
run: go test ./... | |
- name: Calc coverage | |
run: | | |
export PATH=$PATH:$(go env GOPATH)/bin | |
go test -v -covermode=count -coverprofile=coverage.out | |
- name: Convert coverage to lcov | |
uses: jandelgado/gcov2lcov-action@v1 | |
with: | |
infile: coverage.out | |
outfile: coverage.lcov | |
- name: Coveralls | |
uses: coverallsapp/github-action@v1 | |
with: | |
github-token: ${{ secrets.github_token }} | |
path-to-lcov: coverage.lcov |