-
Notifications
You must be signed in to change notification settings - Fork 1
68 lines (56 loc) · 1.75 KB
/
go.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: Go
on:
push:
branches: [ master ]
pull_request:
branches: [ master ]
jobs:
test:
env:
GO_VERSION: "1.18"
strategy:
matrix:
goVersion:
- "1.16" # oldest supported
- "1.18" # first with generic
- "oldstable" # prev go version
- "stable" # latest stable
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Set up Go
uses: actions/setup-go@v3
with:
go-version: ${{ matrix.goVersion }}
- name: Build
run: go build -v ./...
- name: Build examples
if: ${{ matrix.goVersion == env.GO_VERSION }}
run: cd examples; go build -v ./...
- name: Test
run: go test ./...
- name: Test examples
if: ${{ matrix.goVersion == env.GO_VERSION }}
run: cd examples; go test ./...
- name: Test library with coverage profiler
if: ${{ matrix.goVersion == env.GO_VERSION }}
run: go test -test.count=10 -race -covermode atomic -coverprofile=covprofile.out ./...
- name: golangci-lint
if: ${{ matrix.goVersion == env.GO_VERSION }}
uses: golangci/golangci-lint-action@v2
with:
version: latest
- name: golangci-lint examples
if: ${{ matrix.goVersion == env.GO_VERSION }}
uses: golangci/golangci-lint-action@v2
with:
version: latest
working-directory: examples
- name: Coveralls install goveralls
if: ${{ matrix.goVersion == env.GO_VERSION }}
run: go install github.com/mattn/goveralls@latest
- name: Coveralls push
if: ${{ matrix.goVersion == env.GO_VERSION }}
run: goveralls -coverprofile=covprofile.out -service=github
env:
COVERALLS_TOKEN: ${{ secrets.GITHUB_TOKEN }}