-
Notifications
You must be signed in to change notification settings - Fork 77
50 lines (40 loc) · 1.02 KB
/
go-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
name: Go test
on:
push:
branches: [ master ]
pull_request:
branches: [ master ]
jobs:
lint-and-test:
runs-on: ubuntu-latest
strategy:
matrix:
go-version:
- "1.21"
- "1.22"
container:
image: golang:${{ matrix.go-version }}
steps:
- uses: actions/checkout@v3
- name: Workaround Git Security Warning
run: |
# Workaround a bug in github actions:
# https://github.com/actions/runner-images/issues/6775.
git config --global --add safe.directory "$GITHUB_WORKSPACE"
- name: Install dependencies
run: |
go mod download
go install honnef.co/go/tools/cmd/staticcheck@latest
staticcheck --version
- name: Lint
run: |
sh ./scripts/linters.sh
- name: Test
run: |
go test ./... -race
- name: Go modules check
run: |
go mod tidy
git status
git diff
test -z "$(git status --porcelain)"