-
Notifications
You must be signed in to change notification settings - Fork 5
69 lines (54 loc) · 1.29 KB
/
ci.yaml
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
69
name: CI
on:
push:
branches: [ main ]
pull_request:
branches: [ main ]
env:
GO_VERSION: 1.20.6
jobs:
run:
runs-on: ubuntu-latest
strategy:
matrix:
go: [ '1.20', '1.21', '1.22' ]
steps:
- name: Checkout code
uses: actions/checkout@v3
- name: Install Go
uses: actions/setup-go@v3
with:
go-version: ${{ matrix.go }}
- name: Go Format
run: gofmt -s -w . && git diff --exit-code
- name: Go Tidy
run: go mod tidy && git diff --exit-code
- name: Go Test
run: go test -v -race ./...
- name: Lint
uses: golangci/[email protected]
with:
version: latest
args: --timeout 5m
tests-on-windows:
needs: run
runs-on: windows-latest
steps:
- uses: actions/checkout@v3
- name: Install Go
uses: actions/setup-go@v3
with:
go-version: ${{ env.GO_VERSION }}
- name: Go Test
run: go test -v -race ./...
tests-on-macos:
needs: run
runs-on: macos-latest
steps:
- uses: actions/checkout@v3
- name: Install Go
uses: actions/setup-go@v3
with:
go-version: ${{ env.GO_VERSION }}
- name: Go Test
run: go test -v -race ./...