-
Notifications
You must be signed in to change notification settings - Fork 0
55 lines (51 loc) · 1.43 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
name: CI
on:
push:
branches:
- main
pull_request:
branches:
- main
env:
GOLANGCI_LINT_VERSION: v1.58
jobs:
test:
name: Test
strategy:
matrix:
version: ["1.20", "1.21", "1.22"]
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
with:
persist-credentials: false
- uses: actions/setup-go@0a12ed9d6a96ab950c8f026ed9f722fe0da7ef32 # v5.0.2
with:
go-version: ${{ matrix.version }}
cache: true
- run: make test
lint:
name: Lint
runs-on: ubuntu-latest
timeout-minutes: 5
steps:
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
with:
persist-credentials: false
- uses: actions/setup-go@0a12ed9d6a96ab950c8f026ed9f722fe0da7ef32 # v5.0.2
with:
go-version-file: go.mod
cache: false
- name: golangci-lint
uses: golangci/golangci-lint-action@971e284b6050e8a5849b72094c50ab08da042db8
with:
version: ${{ env.GOLANGCI_LINT_VERSION }}
- name: tidy
run: |
make download
git diff-index HEAD
git diff --minimal --color=always --compact-summary --exit-code HEAD || FAILED=true ;
if [[ $FAILED ]];
then echo "❗️please run \"go mod tidy\" locally and commit the changes"
exit 1
fi