Matrix test go versions, require go1.23+ #50
Workflow file for this run
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: ci-pipeline | |
on: | |
push: | |
branches: [ "*" ] | |
pull_request: | |
branches: [ "*" ] | |
jobs: | |
ci: | |
runs-on: ubuntu-latest | |
strategy: | |
matrix: | |
go: [ '', '1.x' ] # '' uses go.mod, 1.x uses latest go | |
steps: | |
- uses: actions/checkout@v2 | |
with: | |
path: src/sigs.k8s.io/json/ | |
- name: Set up Go | |
uses: actions/setup-go@v3 | |
with: | |
go-version-file: './src/sigs.k8s.io/json/go.mod' | |
go-version: ${{ matrix.go }} | |
check-latest: true | |
- name: Test | |
run: | | |
cd ${GITHUB_WORKSPACE}/src/sigs.k8s.io/json/ | |
make test | |
- name: Benchmark | |
run: | | |
cd ${GITHUB_WORKSPACE}/src/sigs.k8s.io/json/ | |
make benchmark | |
- name: Vet | |
run: | | |
cd ${GITHUB_WORKSPACE}/src/sigs.k8s.io/json/ | |
make vet | |
- name: fmt | |
run: | | |
cd ${GITHUB_WORKSPACE}/src/sigs.k8s.io/json/ | |
make fmt | |
git diff --exit-code | |
apidiff: | |
runs-on: ubuntu-latest | |
if: github.base_ref | |
steps: | |
- name: Install Go | |
uses: actions/setup-go@v3 | |
with: | |
go-version: '1.x' | |
- name: Add GOBIN to PATH | |
run: echo "$(go env GOPATH)/bin" >> $GITHUB_PATH | |
- name: Install dependencies | |
run: go install golang.org/x/exp/cmd/apidiff@latest | |
- name: Checkout old code | |
uses: actions/checkout@v2 | |
with: | |
ref: ${{ github.base_ref }} | |
path: "old" | |
- name: Checkout new code | |
uses: actions/checkout@v2 | |
with: | |
path: "new" | |
- name: APIDiff | |
run: ./hack/verify-apidiff.sh -d ../old | |
working-directory: "new" | |