-
Notifications
You must be signed in to change notification settings - Fork 51
68 lines (59 loc) · 1.52 KB
/
run-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
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
name: CI Checks
# run this workflow on commits and pull requests
on:
push:
branches: [ master ]
pull_request:
jobs:
lint:
name: Lint
runs-on: ubuntu-latest
steps:
- uses: actions/setup-go@v3
with:
go-version: 1.20.x # Avoid latest here. New Go versions can break linters.
- uses: actions/checkout@v3
- name: golangci-lint
uses: golangci/golangci-lint-action@v3
with:
version: v1.52.2
build:
name: Build release binaries
runs-on: ubuntu-latest
steps:
- name: Use latest Go version
uses: actions/setup-go@v3
with:
go-version: ^1.20
- name: Checkout source
uses: actions/checkout@master
with:
ref: ${{ github.ref }}
- name: Build
run: make -j8 build # '-j N' runs each build task in parallel.
tests:
name: Test with Go ${{ matrix.go }}
runs-on: ubuntu-latest
strategy:
matrix:
go:
- 1.17.x
- 1.18.x
- 1.19.x
- ^1.20 # Latest version of Go
steps:
- name: Use Go ${{ matrix.go }}
uses: actions/setup-go@v3
with:
go-version: ${{ matrix.go }}
- name: Checkout source
uses: actions/checkout@master
with:
ref: ${{ github.ref }}
- name: Run tests
run: make test
- name: Report to Coveralls
if: matrix.go == '^1.20'
uses: shogo82148/actions-goveralls@v1
with:
path-to-profile: cover.out