-
Notifications
You must be signed in to change notification settings - Fork 114
71 lines (58 loc) · 1.33 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
69
70
71
name: Go
on:
push:
branches: [ "*" ]
pull_request:
branches: [ main ]
jobs:
build:
name: Test
runs-on: ubuntu-latest
strategy:
matrix:
go: [ '1.22', '1.23' ]
steps:
- name: Set up Go
uses: actions/setup-go@v4
with:
go-version: ${{ matrix.go }}
id: go
- name: Git checkout
uses: actions/checkout@v2
- name: Run tests
env:
# Needed for the example-test to run.
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
go test -cover -v ./...
lint:
name: Lint
runs-on: ubuntu-latest
steps:
- name: Set up Go
uses: actions/setup-go@v4
with:
go-version: '1.23'
id: go
- name: Git checkout
uses: actions/checkout@v2
- name: Run lint
uses: golangci/golangci-lint-action@v3
with:
version: v1.62.2 # should match internal/lint/go.mod
generate:
name: Check generated code
runs-on: ubuntu-latest
steps:
- name: Set up Go
uses: actions/setup-go@v4
with:
go-version: '1.23'
id: go
- name: Git checkout
uses: actions/checkout@v2
- name: Check up to date
run: |
go generate -v -x ./...
echo "if this fails, please check in the results of `go generate ./...`"
git diff --exit-code