-
Notifications
You must be signed in to change notification settings - Fork 698
60 lines (52 loc) · 2.13 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
56
57
58
59
60
name: Testing
on: [push, pull_request]
jobs:
lint:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Setup Go
uses: actions/setup-go@v5
with:
go-version: 1.22
- name: Install deps
shell: bash --noprofile --norc -x -eo pipefail {0}
run: |
go get -t ./...
go install honnef.co/go/tools/cmd/staticcheck@latest
go install github.com/client9/misspell/cmd/misspell@latest
go install github.com/golangci/golangci-lint/cmd/golangci-lint@latest
- name: Run linters
shell: bash --noprofile --norc -x -eo pipefail {0}
run: |
$(exit $(go fmt -modfile=go_test.mod ./... | wc -l))
go vet -modfile=go_test.mod ./...
GOFLAGS="-mod=mod -modfile=go_test.mod" staticcheck ./...
find . -type f -name "*.go" | xargs misspell -error -locale US
golangci-lint run --timeout 5m0s ./jetstream/...
test:
runs-on: ubuntu-latest
strategy:
matrix:
go: [ "1.21", "1.22" ]
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Setup Go
uses: actions/setup-go@v5
with:
go-version: ${{ matrix.go }}
- name: Install deps
shell: bash --noprofile --norc -x -eo pipefail {0}
run: |
go install github.com/mattn/goveralls@latest
go install github.com/wadey/gocovmerge@latest
- name: Test and coverage
run: |
go test -modfile=go_test.mod -v -run=TestNoRace -p=1 ./... --failfast -vet=off
if [ "${{ matrix.go }}" = "1.21" ]; then
./scripts/cov.sh CI
elif [ "${{ matrix.go }}" = "1.22" ]; then
go test -modfile=go_test.mod -race -v -p=1 ./... --failfast -vet=off -tags=internal_testing
fi