Merge pull request #543 from ripienaar/monitor #1211
This file contains 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: Testing | |
on: [push, pull_request] | |
jobs: | |
lint_and_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@v4 | |
with: | |
go-version: ${{ matrix.go }} | |
- name: Install deps | |
shell: bash --noprofile --norc -x -eo pipefail {0} | |
run: | | |
export GOPATH="$RUNNER_WORKSPACE" | |
go version | |
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: | | |
export GOPATH="$RUNNER_WORKSPACE" | |
PATH=$PATH:$GOPATH/bin | |
$(exit $(go fmt $(go list ./...) | wc -l)) | |
find . -type f -name "*.go" | xargs misspell -error -locale US | |
staticcheck -f stylish $(go list ./... | grep -v governor) | |
go vet ./... | |
- name: Run tests | |
shell: bash --noprofile --norc -x -eo pipefail {0} | |
run: | | |
export GOPATH="$RUNNER_WORKSPACE" | |
go test -v -race -p 1 ./... |