Merge pull request #1556 from ktarplee/update-crypto #3727
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 | |
| permissions: | |
| contents: read | |
| defaults: | |
| run: | |
| shell: bash | |
| on: [push, pull_request] | |
| jobs: | |
| lint: | |
| name: Running linting (ubuntu-latest/1.24) | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v5 | |
| - name: Setup Go | |
| uses: actions/setup-go@v6 | |
| with: | |
| go-version: "1.25" | |
| - name: Install linting tools | |
| 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: 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 | |
| test: | |
| name: Running tests (${{ matrix.os }}/${{matrix.go}}) | |
| needs: lint | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| go: [ "1.24", "1.25" ] | |
| os: | |
| - ubuntu-latest | |
| - windows-latest | |
| runs-on: ${{ matrix.os }} | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v5 | |
| - name: Setup Go | |
| uses: actions/setup-go@v6 | |
| with: | |
| go-version: ${{matrix.go}} | |
| - name: Build | |
| run: | | |
| cd nats | |
| go build | |
| - name: Run Linux tests | |
| if: startsWith(runner.os, 'Linux') | |
| 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 | |
| - name: Run Windows tests | |
| if: startsWith(runner.os, 'Windows') | |
| shell: pwsh | |
| run: | | |
| $ErrorActionPreference = "Stop" | |
| function Invoke-LoggedCommand { | |
| param([string]$command) | |
| Invoke-Expression $command | |
| if ($LASTEXITCODE -ne 0) { | |
| Write-Error "x Command failed: $command" | |
| exit $LASTEXITCODE | |
| } | |
| } | |
| go list ./... | ForEach-Object{ | |
| if ($_ -notmatch 'asciigraph') { | |
| Invoke-LoggedCommand "go test -v --failfast -p=1 $_" | |
| } | |
| } |