Merge pull request #1208 from ripienaar/asset_leader_placement #2934
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: NATS CLI Testing | |
| on: [push, pull_request] | |
| jobs: | |
| test: | |
| strategy: | |
| matrix: | |
| go: [ "1.22", "1.23" ] | |
| env: | |
| GOPATH: /home/runner/work/natscli | |
| runs-on: ubuntu-latest | |
| 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 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 ./... | grep -F -e asciigraph -v) | |
| $(exit $(go fmt $GO_LIST | wc -l)) | |
| go vet -composites=false $GO_LIST | |
| find . -type f -name "*.go" | grep -F -e asciigraph -v | xargs misspell -error -locale US | |
| staticcheck -f stylish $GO_LIST | |
| - name: Run tests | |
| shell: bash --noprofile --norc -x -eo pipefail {0} | |
| run: | | |
| set -e | |
| go list ./... | grep -F -e asciigraph -v | xargs go test -v --failfast -p=1 | |
| set +e |