Merge pull request #85 from twmb/release-0.20 #93
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: [master] | |
| pull_request: | |
| permissions: | |
| contents: read | |
| concurrency: | |
| # Cancel superseded runs on the same ref; a push to a PR branch does not | |
| # need the previous commit's results. | |
| group: ${{ github.workflow }}-${{ github.ref }} | |
| cancel-in-progress: true | |
| jobs: | |
| build: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: actions/setup-go@v5 | |
| with: | |
| # Track the version in go.mod rather than pinning here twice. | |
| go-version-file: go.mod | |
| cache: true | |
| - name: gofmt | |
| run: | | |
| unformatted=$(gofmt -l .) | |
| if [ -n "$unformatted" ]; then | |
| echo "these files are not gofmt'd:" | |
| echo "$unformatted" | |
| exit 1 | |
| fi | |
| - name: build | |
| run: go build ./... | |
| - name: vet | |
| run: go vet ./... | |
| # Many tests stand up an in-process kfake cluster and consume from it, | |
| # so they are not instant; -race is worth it here because that is | |
| # exactly the code most likely to have a data race. | |
| - name: test | |
| run: go test -race -count=1 ./... | |
| # The release image is otherwise first built after a GitHub Release is | |
| # already public, so catch a broken Dockerfile here. | |
| - name: docker build | |
| run: docker build --build-arg VERSION=ci . |