Add golangci-lint and configure GitHub actions #3
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: tests | |
on: | |
push: | |
branches: [main] | |
pull_request: | |
branches: [main] | |
jobs: | |
test: | |
runs-on: ubuntu-latest | |
strategy: | |
matrix: | |
# Latest minor versions of Go 1.21 and 1.22 | |
go-version: ["1.21.x", "1.22.x"] | |
include: | |
# only update test coverage stats with Go 1.22 | |
- go-version: "1.22.x" | |
update-coverage: true | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v4 | |
- name: Setup Go ${{ matrix.go-version }} | |
uses: actions/setup-go@v5 | |
with: | |
go-version: ${{ matrix.go-version }} | |
- name: Run Go tests with coverage | |
run: make test-coverage | |
- name: Upload coverage reports to Codecov | |
uses: codecov/[email protected] | |
if: ${{ matrix.update-coverage }} |