From f0f4d8ed7a256fa97f546670959ddf9c6108cb7c Mon Sep 17 00:00:00 2001 From: Luca Comellini Date: Tue, 23 Apr 2024 15:16:45 -0700 Subject: [PATCH] Update Go versions in workflows Signed-off-by: Luca Comellini --- .github/workflows/test.yml | 50 ++++++++++++++++++++++++++------------ 1 file changed, 35 insertions(+), 15 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 86ac153d..a232b876 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -4,88 +4,108 @@ jobs: build: strategy: matrix: - go-version: [1.20.x, 1.21.x] + go-version: [1.21.x, 1.22.x, stable] platform: [windows-latest] runs-on: ${{ matrix.platform }} steps: - name: Install Go - uses: actions/setup-go@v3 + uses: actions/setup-go@v5 with: go-version: ${{ matrix.go-version }} + - name: Checkout code - uses: actions/checkout@v2 + uses: actions/checkout@v4 + - name: Build run: | go build ./... + - name: Run Windows Unit Tests run: | $env:GH_ACTION="TRUE" go test -v -race ./mount/... + test: strategy: matrix: - go-version: [1.20.x, 1.21.x] + go-version: [1.21.x, 1.22.x, stable] platform: [ubuntu-latest, macos-latest] runs-on: ${{ matrix.platform }} steps: - name: Install Go - uses: actions/setup-go@v3 + uses: actions/setup-go@v5 with: go-version: ${{ matrix.go-version }} + - name: Checkout code - uses: actions/checkout@v2 + uses: actions/checkout@v4 + - name: Test run: | make test + verify-go-directive: strategy: matrix: - go-version: [1.20.x, 1.21.x] + go-version: [1.21.x, 1.22.x, stable] platform: [ubuntu-latest, macos-latest] runs-on: ${{ matrix.platform }} steps: - name: Install Go - uses: actions/setup-go@v3 + uses: actions/setup-go@v5 with: go-version: ${{ matrix.go-version }} + - name: Checkout code - uses: actions/checkout@v2 + uses: actions/checkout@v4 + - name: Verify go directive run: | make verify-go-directive + lint: runs-on: ubuntu-latest steps: - name: Install Go - uses: actions/setup-go@v3 + uses: actions/setup-go@v5 + with: + go-version: stable + - name: Checkout code - uses: actions/checkout@v2 + uses: actions/checkout@v4 + - name: Lint run: | docker run --rm -v `pwd`:/go/src/k8s.io/klog -w /go/src/k8s.io/klog \ golangci/golangci-lint:v1.51.2 golangci-lint run --disable-all -v \ -E govet -E misspell -E gofmt -E ineffassign -E golint + apidiff: runs-on: ubuntu-latest if: github.base_ref steps: - name: Install Go - uses: actions/setup-go@v3 + uses: actions/setup-go@v5 with: - go-version: 1.21.x + go-version: stable + - 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 + uses: actions/checkout@v4 with: ref: ${{ github.base_ref }} path: "old" + - name: Checkout new code - uses: actions/checkout@v2 + uses: actions/checkout@v4 with: path: "new" + - name: APIDiff run: ./hack/verify-apidiff.sh -d ../old working-directory: "new"