-
Notifications
You must be signed in to change notification settings - Fork 0
96 lines (94 loc) · 2.65 KB
/
pr-check.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
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
name: Pull Request Validation
on:
pull_request: {}
push:
branches:
- main
jobs:
go-mod:
strategy:
matrix:
name:
- oldstable
- stable
- tip
include:
- name: oldstable
version: "1.21"
- name: stable
version: "1.22"
runs-on: ubuntu-latest
steps:
- name: Install Go v${{ matrix.name }}
uses: actions/setup-go@cdcb36043654635271a94b9a6d1392de5bb323a7
with:
go-version: ${{ matrix.version }}
- name: Checkout code
uses: actions/checkout@44c2b7a8a4ea60a981eaca3cf939b5f4305c123b
- name: Check module vendoring
run: |
go mod tidy
go mod vendor
git diff --exit-code
build:
strategy:
matrix:
name:
- oldstable
- stable
- tip
include:
- name: oldstable
version: "1.21"
- name: stable
version: "1.22"
runs-on: ubuntu-latest
steps:
- name: Install Go v${{ matrix.name }}
uses: actions/setup-go@cdcb36043654635271a94b9a6d1392de5bb323a7
with:
go-version: ${{ matrix.version }}
- name: Checkout code
uses: actions/checkout@44c2b7a8a4ea60a981eaca3cf939b5f4305c123b
- name: Go code prechecks
run: |
go build ./...
unit-test:
strategy:
matrix:
name:
- oldstable
- stable
- tip
include:
- name: oldstable
version: "1.21"
- name: stable
version: "1.22"
runs-on: ubuntu-latest
steps:
- name: Install Go v${{ matrix.name }}
uses: actions/setup-go@cdcb36043654635271a94b9a6d1392de5bb323a7
with:
go-version: ${{ matrix.version }}
- name: Checkout code
uses: actions/checkout@44c2b7a8a4ea60a981eaca3cf939b5f4305c123b
- name: Go code prechecks
run: |
go test ./...
lint:
runs-on: ubuntu-latest
needs: unit-test
steps:
- name: Checkout code
uses: actions/checkout@44c2b7a8a4ea60a981eaca3cf939b5f4305c123b
- name: Run golangci lint
uses: golangci/golangci-lint-action@a4f60bb28d35aeee14e6880718e0c85ff1882e64
with:
version: v1.58.1
# use our .golangci.yml and configure output to be logged in the GHA,
# in addition to annotating the commit. see
# https://github.com/golangci/golangci-lint-action/issues/119#issuecomment-981090648
# for output
args: --config=.golangci.yml --verbose --out-${NO_FUTURE}format colored-line-number
skip-cache: true