-
Notifications
You must be signed in to change notification settings - Fork 6
34 lines (34 loc) · 1.06 KB
/
go-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
name: go test
on: [push, pull_request]
jobs:
test:
strategy:
matrix:
os: [ ubuntu-latest, windows-latest ]
include:
- os: ubuntu-latest
upload-coverage: true
runs-on: ${{ matrix.os }}
name: "go test"
steps:
- name: "checkout"
uses: actions/checkout@v3
- name: "setup go"
uses: actions/setup-go@v3
with:
go-version: '1.20'
- name: "go mod download"
run: "go mod download"
- name: "go test ./..."
run: "go test -race '-coverprofile=coverage.txt' '-covermode=atomic' ./..."
- if: ${{ matrix.upload-coverage }}
name: verify codecov.yaml
run: curl -X POST --data-binary @codecov.yml https://codecov.io/validate
- if: ${{ matrix.upload-coverage }}
name: upload code coverage
uses: codecov/codecov-action@v3
with:
files: ./coverage.txt
name: codecov-umbrella # optional
fail_ci_if_error: true # optional (default = false)
verbose: true # optional (default = false)