-
Notifications
You must be signed in to change notification settings - Fork 45
44 lines (37 loc) · 1023 Bytes
/
test.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
37
38
39
40
41
42
43
44
name: Unit Tests & Coverage
on:
workflow_dispatch:
push:
jobs:
test:
runs-on: ubuntu-latest
strategy:
matrix:
go: [ 'stable', '^1.22', '^1.21', '^1.20', '^1.19', '~1.18', '~1.17', '~1.16', '~1.15', '~1.14', '~1.13', '~1.12' ]
name: Go ${{ matrix.go }} sample
steps:
- name: Checkout repo
uses: actions/checkout@v4
- name: Install Go
uses: actions/setup-go@v5
with:
go-version: ${{ matrix.go }}
- name: Run Race tests
run: |
go test --race
coverage:
runs-on: ubuntu-latest
steps:
- name: Checkout repo
uses: actions/checkout@v4
- name: Install Go
uses: actions/setup-go@v5
with:
go-version: "stable"
- name: Run tests with Coverage report
run: |
go test -coverprofile=coverage.txt -covermode=atomic
- name: Upload coverage report
uses: codecov/codecov-action@v4
with:
file: ./coverage.txt