-
Notifications
You must be signed in to change notification settings - Fork 4
45 lines (36 loc) · 1010 Bytes
/
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
name: Go
on:
push:
branches: [ master ]
pull_request:
branches: [ master ]
schedule:
- cron: '0 12 * * 0'
jobs:
build:
runs-on: ubuntu-latest
strategy:
matrix:
go: ['1.20.x', '1.21.x']
steps:
- uses: actions/checkout@v3
- name: Set up Go
uses: actions/setup-go@v3
with:
go-version: ${{ matrix.go }}
- name: Install errcheck
run: go install github.com/kisielk/errcheck@latest
- name: errcheck
run: errcheck -verbose ./...
- name: gofmt check
run: diff <(gofmt -d .) <(echo -n "")
- name: Test
run: go test -race -v ./...
- name: Coveralls
if: ${{ startsWith(matrix.go, '1.21') && github.event_name == 'push' }}
env:
COVERALLS_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
go install github.com/mattn/goveralls@latest && \
go test -covermode=count -coverprofile=profile.cov ./... && \
goveralls -coverprofile=profile.cov -service=github