Fix some order dependent tests (#83) #84
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
on: | |
push: | |
branches: | |
- master | |
- main | |
pull_request: | |
# Only run if there are changes to Go code or related configurations | |
paths: | |
- "**.go" | |
- "go.mod" | |
- "go.sum" | |
- "codecov.yml" | |
name: Tests | |
jobs: | |
test-cache: | |
name: "Run unit tests" | |
runs-on: ubuntu-latest | |
strategy: | |
matrix: | |
go-version: [1.18.x, 1.x] | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Setup Go ${{ matrix.go-version }} | |
uses: actions/setup-go@v5 | |
with: | |
go-version: ${{ matrix.go-version }} | |
- name: Test with race and coverage | |
run: | | |
go test -race -coverprofile=coverage.out -covermode=atomic | |
go tool cover -func=coverage.out | |
- uses: codecov/codecov-action@v4 | |
with: | |
files: ./coverage.out | |
token: ${{ secrets.CODECOV_TOKEN }} # required | |
lint: | |
name: "Run static analysis" | |
runs-on: "ubuntu-latest" | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Setup Go ${{ matrix.go-version }} | |
uses: actions/setup-go@v5 | |
with: | |
go-version: "1.x" | |
- run: "go vet ./..." | |
- name: Staticcheck | |
uses: dominikh/staticcheck-action@v1.3.0 | |
with: | |
install-go: false |