-
Notifications
You must be signed in to change notification settings - Fork 57
54 lines (46 loc) · 1.08 KB
/
build_and_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: build and test
on:
push:
branches:
- master
pull_request:
jobs:
build:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
go:
- "1.20"
- "1.21"
name: run tests with go version ${{ matrix.go }}
steps:
- name: install go
uses: actions/setup-go@v5
with:
go-version: ${{ matrix.go }}
- name: checkout code
uses: actions/checkout@v4
- name: Build
run: make build
- name: Test
env:
COVERALLS_TOKEN: ${{ secrets.COVERALLS_TOKEN }}
run: |
make cover
- name: Coveralls
if: (matrix.go == '1.21')
env:
COVERALLS_TOKEN: ${{ secrets.COVERALLS_TOKEN }}
run: |
if [[ -n "$COVERALLS_TOKEN" ]]; then
make coveralls
fi
- name: Upload coverage
if: (matrix.go == '1.21')
uses: actions/upload-artifact@v4
with:
name: coverage
path: coverage.*
- name: Assert no changes
run: make assert-no-changes