-
Notifications
You must be signed in to change notification settings - Fork 3
49 lines (37 loc) · 965 Bytes
/
main.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
name: test-and-linter
on:
push:
branches: [ main, dev ]
pull_request:
branches: [ main, dev ]
jobs:
build-test:
name: "Test & Lint"
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
go: [ '1.22' ]
steps:
- uses: actions/checkout@v3
- name: setup Go ${{ matrix.go }}
uses: actions/setup-go@v3
with:
go-version: ${{ matrix.go }}
- name: download deps
run: |
go mod download
- name: check go.mod
run: |
go mod tidy -v
- name: test all
run: |
CI=true go test ./...
- name: test race
run: |
CI=true go test -race ./...
- name: linter
run: |
curl -sSfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | sh -s -- -b $(go env GOPATH)/bin v1.59.1
golangci-lint --version
golangci-lint run -v ./...