From 4d9d23762d7753fd13e8d7ef73f60d36f766ef03 Mon Sep 17 00:00:00 2001 From: Manuel Martinez Date: Sun, 17 Aug 2025 16:27:38 -0700 Subject: [PATCH] ci: add go vet to lint step - Adds `go vet` call to the lint step in GA workflow. - Enforces a compatible `go-version` with the minimum in the matrix for the `test` step. Fixes #281 --- .github/workflows/test.yml | 66 ++++++++++++++++++++------------------ 1 file changed, 35 insertions(+), 31 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 54b36331..5eb2dacd 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -3,7 +3,7 @@ on: # Manual trigger workflow_dispatch: push: - branches: main + branches: [main] pull_request: permissions: @@ -13,43 +13,47 @@ jobs: lint: runs-on: ubuntu-latest steps: - - name: Check out code - uses: actions/checkout@v4 - - name: Set up Go - uses: actions/setup-go@v5 - - name: Check formatting - run: | - unformatted=$(gofmt -l .) - if [ -n "$unformatted" ]; then - echo "The following files are not properly formatted:" - echo "$unformatted" - exit 1 - fi - echo "All Go files are properly formatted" + - name: Check out code + uses: actions/checkout@v4 + - name: Set up Go + uses: actions/setup-go@v5 + with: + go-version: "^1.23" + - name: Check formatting + run: | + unformatted=$(gofmt -l .) + if [ -n "$unformatted" ]; then + echo "The following files are not properly formatted:" + echo "$unformatted" + exit 1 + fi + echo "All Go files are properly formatted" + - name: Run Go vet + run: go vet ./... test: runs-on: ubuntu-latest strategy: matrix: - go: [ '1.23', '1.24', '1.25.0-rc.3' ] + go: ["1.23", "1.24", "1.25.0-rc.3"] steps: - - name: Check out code - uses: actions/checkout@v4 - - name: Set up Go - uses: actions/setup-go@v5 - with: - go-version: ${{ matrix.go }} - - name: Test - run: go test -v ./... + - name: Check out code + uses: actions/checkout@v4 + - name: Set up Go + uses: actions/setup-go@v5 + with: + go-version: ${{ matrix.go }} + - name: Test + run: go test -v ./... race-test: runs-on: ubuntu-latest steps: - - name: Check out code - uses: actions/checkout@v4 - - name: Set up Go - uses: actions/setup-go@v5 - with: - go-version: '1.24' - - name: Test with -race - run: go test -v -race ./... + - name: Check out code + uses: actions/checkout@v4 + - name: Set up Go + uses: actions/setup-go@v5 + with: + go-version: "1.24" + - name: Test with -race + run: go test -v -race ./...