ci: standardize workflow with goimports, vet, deadcode #44
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: ci | |
| on: | |
| push: | |
| branches: [main] | |
| pull_request: | |
| branches: [main] | |
| jobs: | |
| check: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: actions/setup-go@v5 | |
| with: | |
| go-version-file: go.mod | |
| - name: Install tools | |
| run: | | |
| go install golang.org/x/tools/cmd/goimports@latest | |
| go install golang.org/x/tools/cmd/deadcode@latest | |
| - name: Format Go | |
| run: test -z "$(goimports -local "$(go list -m)" -l .)" | |
| - name: Static checks | |
| run: go vet ./... | |
| - name: Run tests | |
| run: go test -v ./... | |
| - name: Find unreachable functions | |
| run: deadcode -test ./... |