-
Notifications
You must be signed in to change notification settings - Fork 3
44 lines (38 loc) · 933 Bytes
/
tests.yml
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
37
38
39
40
41
42
43
44
name: tests
on:
push:
branches:
- "**"
pull_request:
branches:
- "**"
pull_request_target:
branches:
- "**"
env:
go_version: 1.18
jobs:
unit:
name: unit tests
runs-on: ubuntu-latest
env:
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
COVER_FILE: coverage.txt
steps:
- name: Setup Go ${{ env.go_version }}
uses: actions/setup-go@v3
with:
go-version: ${{ env.go_version }}
- name: Checkout code
uses: actions/checkout@v3
- name: Run tests
shell: bash
run: go test -race -coverprofile=$COVER_FILE -covermode=atomic $(go list ./...)
- name: Upload coverage to Codecov
uses: codecov/codecov-action@v3
with:
token: ${{ env.CODECOV_TOKEN }}
env_vars: OS,GOLANG
fail_ci_if_error: true
files: ${{ env.COVER_FILE }}
flags: unittests