generated from nano-interactive/go-library-template
-
Notifications
You must be signed in to change notification settings - Fork 0
42 lines (41 loc) · 1.08 KB
/
test.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
name: 'Testing'
on:
workflow_call:
push:
branches:
- master
- develop
pull_request:
branches:
- master
- develop
jobs:
test:
strategy:
matrix:
os: [ubuntu-latest]
go: [1.21]
runs-on: ${{ matrix.os }}
container: golang:${{ matrix.go }}-bullseye
steps:
- name: Checkout code
uses: actions/checkout@v3
- uses: actions/cache@v2
with:
path: ~/go/pkg/mod
key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }}
restore-keys: |
${{ runner.os }}-go-
- name: Set up gotestfmt
run: go install github.com/gotesttools/gotestfmt/v2/cmd/gotestfmt@latest
- name: Test ${{ matrix.go }}
run: |
go test -race -covermode=atomic -coverprofile=coverage.txt -timeout 5m -json -v ./... 2>&1 | gotestfmt
- uses: codecov/codecov-action@v1
with:
token: ${{ secrets.CODECOV_TOKEN }}
file: ./coverage.txt
flags: tests
name: codecov-umbrella
fail_ci_if_error: true
verbose: true