ci: add workflow to v1 maintenance branch #5
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, v2, v1] | |
| pull_request: | |
| jobs: | |
| test: | |
| runs-on: ubuntu-latest | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| # '1.18' pins the minimum version claimed in go.mod; a build failure | |
| # here means the claim is wrong. | |
| go: ['1.18', 'oldstable', 'stable'] | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: actions/setup-go@v5 | |
| with: | |
| go-version: ${{ matrix.go }} | |
| - name: gofmt | |
| # gofmt's output changed across Go releases (notably 1.19 doc | |
| # comments), so only the current release's formatting is enforced. | |
| if: matrix.go == 'stable' | |
| run: test -z "$(gofmt -l .)" | |
| - name: vet | |
| run: go vet ./... | |
| - name: build | |
| run: go build ./... | |
| - name: test | |
| run: go test -race -cover ./... |