-
Notifications
You must be signed in to change notification settings - Fork 23
50 lines (47 loc) · 1.34 KB
/
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
45
46
47
48
49
50
name: Tests
on:
pull_request:
jobs:
unit-tests:
strategy:
fail-fast: false
matrix:
os: [ubuntu-20.04, macos-11, windows-2019]
runs-on: ${{ matrix.os }}
steps:
- name: Checkout Sources
uses: actions/checkout@v2
- name: Setup Go
uses: actions/setup-go@v2
with:
go-version: "1.21"
check-latest: true
# Load caches based on OS
- name: Linux Cache Go Modules
if: matrix.os == 'ubuntu-20.04'
uses: actions/cache@v2
with:
path: |
~/.cache/go-build
~/go/pkg/mod
key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }}
restore-keys: |
${{ runner.os }}-go-
- name: MacOS Cache Go Modules
if: matrix.os == 'macos-11'
uses: actions/cache@v2
with:
path: |
~/Library/Caches/go-build
~/go/pkg/mod
key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }}
restore-keys: |
${{ runner.os }}-go-
- name: Run Tests
run: go test -race -coverprofile coverage.txt -coverpkg ./... ./...
- name: Upload Codecov
# Only submit code coverage if OS is Linux
if: matrix.os == 'ubuntu-20.04'
uses: codecov/[email protected]
with:
files: ./coverage.txt