-
Notifications
You must be signed in to change notification settings - Fork 0
36 lines (32 loc) · 953 Bytes
/
unit.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
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 }}