Skip to content

Test and Coverage

Test and Coverage #62

Workflow file for this run

name: Test and Coverage
on: [ push, pull_request, workflow_dispatch ]
jobs:
converage:
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ ubuntu-latest, macos-latest, windows-latest ]
go: [ 1.18.x, 1.19.x, 1.20.x ]
env:
OS: ${{ matrix.os }}
GO: ${{ matrix.go }}
steps:
- uses: actions/checkout@v2
- name: Setup Go
uses: actions/setup-go@v2
with:
go-version: ${{ matrix.go }}
- name: Run tests
run: go test -race -coverprofile coverage.txt -covermode atomic ./...
- name: Upload coverage to Codecov
uses: codecov/codecov-action@v3
with:
env_vars: OS,GO
flags: unittests
fail_ci_if_error: true
files: ./coverage.txt
verbose: true