Changelog #87
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: Unit tests | |
on: | |
pull_request: | |
push: | |
branches: [master] | |
jobs: | |
unit: | |
name: test | |
runs-on: ubuntu-latest | |
steps: | |
- name: Setup go | |
uses: actions/setup-go@v4 | |
with: | |
go-version: '>=1.21.0' | |
- name: Check out code | |
uses: actions/checkout@v2 | |
- name: Install dependencies | |
run: | | |
go mod download | |
- name: Create empty test files as a workaround for https://github.com/golang/go/issues/24570 | |
run: python .github/scripts/create-empty-tests.py | |
- name: Run Unit tests | |
run: | | |
go test -v -coverpkg=./... -race -coverprofile=coverage.out.tmp -covermode=atomic ./... | |
cat coverage.out.tmp | grep -v "examples/" > coverage.out | |
- name: Upload coverage reports to Codecov | |
uses: codecov/codecov-action@v3 | |
with: | |
file: ./coverage.out | |
fail_ci_if_error: true | |
env: | |
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }} |