-
Notifications
You must be signed in to change notification settings - Fork 27
43 lines (36 loc) · 1.18 KB
/
go.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
name: Testing
on: [push, pull_request]
jobs:
lint_and_test:
runs-on: ubuntu-latest
strategy:
matrix:
go: [ "1.22", "1.23" ]
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Setup Go
uses: actions/setup-go@v4
with:
go-version: ${{ matrix.go }}
- name: Install deps
shell: bash --noprofile --norc -x -eo pipefail {0}
run: |
export GOPATH="$RUNNER_WORKSPACE"
go version
go install honnef.co/go/tools/cmd/staticcheck@latest
go install github.com/client9/misspell/cmd/misspell@latest
- name: Lint
shell: bash --noprofile --norc -x -eo pipefail {0}
run: |
export GOPATH="$RUNNER_WORKSPACE"
PATH=$PATH:$GOPATH/bin
$(exit $(go fmt $(go list ./...) | wc -l))
find . -type f -name "*.go" | xargs misspell -error -locale US
staticcheck -f stylish $(go list ./... | grep -v governor)
go vet ./...
- name: Run tests
shell: bash --noprofile --norc -x -eo pipefail {0}
run: |
export GOPATH="$RUNNER_WORKSPACE"
go test -v -race -p 1 ./...