-
Notifications
You must be signed in to change notification settings - Fork 1
62 lines (61 loc) · 1.54 KB
/
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
55
56
57
58
59
60
61
62
name: CI
on:
push:
branches:
- "main"
pull_request:
branches:
- "*"
jobs:
test:
strategy:
# Don't abort the entire matrix if one element fails.
fail-fast: false
matrix:
gover: ["1.20.x", "1.21.x", "1.22.x"]
include:
- gover: "stable"
testflags: "-race"
runs-on: ubuntu-22.04
steps:
- name: Check out repository
uses: actions/checkout@v4
- name: Install Go
uses: actions/setup-go@v4
with:
go-version: ${{ matrix.gover }}
- name: Test all
run: go test ${{ matrix.testflags }} ./...
env:
GOARCH: ${{ matrix.goarch }}
apidiff:
runs-on: ubuntu-22.04
if: (github.event.action && 'pull_request' && !contains(github.event.pull_request.labels.*.name, 'breaking-change'))
steps:
- name: Check out repository
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Install Go
uses: actions/setup-go@v4
with:
go-version: stable
- name: Run api-diff
uses: joelanford/go-apidiff@main
lint:
if: github.event_name == 'pull_request'
runs-on: ubuntu-22.04
steps:
- name: Check out repository
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Install Go
uses: actions/setup-go@v4
with:
cache: false
go-version: stable
- name: Run golangci-lint
uses: golangci/golangci-lint-action@v6
with:
install-mode: "binary"