mirror of
https://github.com/gogrlx/nats-server.git
synced 2026-04-02 03:38:42 -07:00
We're currently using Go 1.19; we'll switch to 1.20 when the NATS Maintainers make the call to switch. Prepare by making sure that 1.20 won't turn into 1.2 instead, by quoting the string to be updated and adding a warning.
54 lines
1.6 KiB
YAML
54 lines
1.6 KiB
YAML
name: NATS Server Testing
|
|
on: [push, pull_request]
|
|
|
|
jobs:
|
|
test:
|
|
strategy:
|
|
matrix:
|
|
# This should be quoted or use .x, but should not be unquoted.
|
|
# Remember that a YAML bare float drops trailing zeroes.
|
|
go: ['1.16']
|
|
|
|
env:
|
|
GOPATH: /home/runner/work/nats-server
|
|
GO111MODULE: "on"
|
|
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- name: Checkout code
|
|
uses: actions/checkout@v1
|
|
with:
|
|
path: src/github.com/nats-io/nats-server
|
|
|
|
- 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 get -u honnef.co/go/tools/cmd/staticcheck
|
|
go get -u github.com/client9/misspell/cmd/misspell
|
|
|
|
- name: Lint
|
|
shell: bash --noprofile --norc -x -eo pipefail {0}
|
|
run: |
|
|
GO_LIST=$(go list ./...)
|
|
go build
|
|
$(exit $(go fmt $GO_LIST | wc -l))
|
|
go vet $GO_LIST
|
|
find . -type f -name "*.go" | xargs $GOPATH/bin/misspell -error -locale US
|
|
$GOPATH/bin/staticcheck $GO_LIST
|
|
|
|
- name: Run tests
|
|
shell: bash --noprofile --norc -x -eo pipefail {0}
|
|
run: |
|
|
set -e
|
|
go test -vet=off -i ./...
|
|
# go test -vet=off -v -run=TestNoRace --failfast -p=1 ./...
|
|
# coverage via cov.sh disabled while just testing the waters
|
|
# Also disable race since we are overwhelming the GHA runners.
|
|
go test -vet=off -v -p=1 --failfast ./...
|
|
set +e
|