-
Notifications
You must be signed in to change notification settings - Fork 821
60 lines (52 loc) · 1.48 KB
/
ci.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
on:
push:
pull_request:
name: CI
jobs:
format:
runs-on: ubuntu-latest
steps:
- name: Install Go
uses: actions/setup-go@v3
with:
go-version: 1.18
- name: Code
uses: actions/checkout@v3
- name: Check diff between gofmt and code
run: diff <(gofmt -d .) <(echo -n)
test:
runs-on: ubuntu-latest
strategy:
matrix:
go-version: [1.13, 1.14, 1.15, 1.16, 1.17, 1.18]
steps:
- name: Install Go
uses: actions/setup-go@v3
with:
go-version: ${{ matrix.go-version }}
- name: Code
uses: actions/checkout@v3
- run: go test -v -race ./...
lint:
runs-on: ubuntu-latest
steps:
- name: Install Go
uses: actions/setup-go@v3
with:
go-version: 1.18
- name: Code
uses: actions/checkout@v3
- name: Go vet
run: go vet -x ./...
- name: GolangCI-Lint
uses: golangci/golangci-lint-action@v3
if: github.event.name == 'pull_request'
with:
only-new-issues: true
skip-pkg-cache: true
skip-build-cache: true
- name: GolangCI-Lint
if: github.event.name != 'pull_request' # See https://github.com/golangci/golangci-lint-action/issues/362
run: |
curl -sSfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | sh -s -- -b $(go env GOPATH)/bin v1.45.2
$(go env GOPATH)/bin/golangci-lint run