-
Notifications
You must be signed in to change notification settings - Fork 99
55 lines (47 loc) · 1.4 KB
/
test.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: NATS CLI Testing
on: [push, pull_request]
jobs:
test:
strategy:
matrix:
go: [ "1.19", "1.20" ]
env:
GOPATH: /home/runner/work/natscli
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v1
with:
path: src/github.com/nats-io/natscli
- name: Setup Go
uses: actions/setup-go@v1
with:
go-version: ${{matrix.go}}
- name: Install deps
shell: bash --noprofile --norc -x -eo pipefail {0}
run: |
go install honnef.co/go/tools/cmd/staticcheck@latest
go install github.com/client9/misspell/cmd/misspell@latest
- name: Build
shell: bash --noprofile --norc -x -eo pipefail {0}
run: |
cd nats
go build
- name: Lint
shell: bash --noprofile --norc -x -eo pipefail {0}
run: |
PATH=$PATH:$GOPATH/bin
GO_LIST=$(go list ./...)
$(exit $(go fmt $GO_LIST | wc -l))
go vet -composites=false $GO_LIST
find . -type f -name "*.go" | xargs misspell -error -locale US
staticcheck -f stylish $GO_LIST
- name: Run tests
shell: bash --noprofile --norc -x -eo pipefail {0}
run: |
set -e
cd nats
go test -v --failfast -p=1 ./...
cd ../cli
go test -v --failfast -p=1 ./...
set +e