This repository has been archived by the owner on Aug 13, 2024. It is now read-only.
Bump golang.org/x/tools from 0.19.0 to 0.20.0 #274
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
on: push | |
name: Build and test | |
jobs: | |
go-version: | |
name: Lookup go versions | |
runs-on: ubuntu-latest | |
outputs: | |
latest: ${{ steps.go-version.outputs.latest }} | |
matrix: ${{ steps.go-version.outputs.matrix }} | |
module: ${{ steps.go-version.outputs.module }} | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: arnested/go-version-action@v1 | |
id: go-version | |
go_generate: | |
name: Check generated code is up to date | |
needs: go-version | |
runs-on: ubuntu-latest | |
env: | |
workdir: go/src/${{ needs.go-version.outputs.module }} | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
path: ${{env.workdir}} | |
- name: Install Go ${{ needs.go-version.outputs.latest }}.x | |
uses: WillAbides/[email protected] | |
with: | |
go-version: ${{ needs.go-version.outputs.latest }}.x | |
ignore-local: true | |
- name: Go version | |
run: go version | |
- name: go generate | |
env: | |
GO111MODULE: 'on' | |
GOPATH: ${{ github.workspace }}/go | |
working-directory: ${{env.workdir}} | |
run: go generate -x | |
- name: Diff after go generate | |
working-directory: ${{env.workdir}} | |
run: git diff --exit-code | |
- name: Determine next version | |
working-directory: ${{env.workdir}} | |
run: | | |
go install golang.org/x/exp/cmd/gorelease@latest | |
gorelease | |
build_and_test: | |
name: Build and test | |
needs: go-version | |
runs-on: ubuntu-latest | |
strategy: | |
matrix: | |
go-version: ${{ fromJSON(needs.go-version.outputs.matrix) }} | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Install Go ${{ matrix.go-version }}.x | |
uses: WillAbides/[email protected] | |
with: | |
go-version: ${{ matrix.go-version }}.x | |
ignore-local: true | |
- name: Go version | |
run: go version | |
- name: go test | |
env: | |
GO111MODULE: 'on' | |
run: go test -v -race -cover -covermode=atomic -coverprofile=coverage.txt ./... | |
- name: Upload coverage report to Codecov | |
uses: codecov/codecov-action@v4 | |
with: | |
flags: go${{ matrix.go-version }} |