Add tests. #105
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: build | |
on: [push, pull_request] | |
jobs: | |
build: | |
runs-on: ${{ matrix.os }} | |
strategy: | |
matrix: | |
os: [ubuntu-latest, windows-latest, macos-latest] | |
# last 2 major versions are supported | |
# https://go.dev/doc/devel/release#policy | |
go-version: ['1.22', '1.23'] | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Using Go ${{ matrix.go-version }} | |
uses: actions/setup-go@v5 | |
with: | |
go-version: ${{ matrix.go-version }} | |
- name: Build | |
run: go build -v ./... | |
- name: Lint | |
if: ${{ matrix.go-version == '1.23' && matrix.os == 'ubuntu-latest' }} | |
uses: golangci/golangci-lint-action@v6 | |
- name: Test | |
run: go test -v -race ./... -covermode atomic -coverprofile coverage.out | |
- name: Upload coverage to Codecov | |
if: ${{ matrix.go-version == '1.23' && matrix.os == 'ubuntu-latest' }} | |
uses: codecov/codecov-action@v4 | |
with: | |
token: ${{ secrets.CODECOV_TOKEN }} |