-
Notifications
You must be signed in to change notification settings - Fork 23
54 lines (51 loc) · 1.21 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
43
44
45
46
47
48
49
50
51
52
53
54
name: tests
on:
push:
branches:
- master
pull_request:
branches:
- master
jobs:
unittest:
strategy:
matrix:
go-version: ['1.18', '1.19', '1.20', '1.21.0', '1.22.0']
os: [ubuntu-latest, macos-latest, windows-latest]
runs-on: ${{ matrix.os }}
steps:
- name: Install Go
uses: actions/setup-go@v2
with:
go-version: ${{ matrix.go-version }}
- name: Checkout code
uses: actions/checkout@v2
- name: Run unit tests
run: go test -v -race -cover
lint:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v2
- name: Run golangci-lint
uses: golangci/golangci-lint-action@v2
with:
version: latest
coverage:
runs-on: ubuntu-latest
steps:
- name: Install Go
uses: actions/setup-go@v2
with:
go-version: '1.17'
- name: Checkout code
uses: actions/checkout@v2
- name: Run unit tests with coverage
run: go test -v -race -coverprofile=coverage.txt
- name: Codecov
uses: codecov/codecov-action@v2
with:
file: coverage.txt
flags: unittests
verbose: true
fail_ci_if_error: false