From 1e5d91b9e89d91d93b34ed6fbd34758010b5e634 Mon Sep 17 00:00:00 2001 From: Peter Downs Date: Wed, 25 Sep 2024 18:09:53 -0400 Subject: [PATCH] fix(ci): pin go@1.22, golangci-lint@v1.57.1 This matches what's pinned in the development shell with Nix. Previously, CI used go@1.19, and this caused failures when reading the go.mod file: https://github.com/peterldowns/pgtestdb/actions/runs/11041845287/job/30673000738 ``` Run go test github.com/peterldowns/pgtestdb/... go test github.com/peterldowns/pgtestdb/... shell: /usr/bin/bash -e {0} reading go.work: /home/runner/work/pgtestdb/pgtestdb/go.work:3: unknown directive: toolchain ``` I'm optimistic that the toolchain directive in go.work shouldn't matter for anyone trying to _depend_ on pgtestdb from go1.18/go1.19/go1.20; if I'm wrong, hopefully someone reports an issue and I can figure out how to fix it then. --- .github/workflows/golang.yaml | 27 +++++++++++++++++++-------- 1 file changed, 19 insertions(+), 8 deletions(-) diff --git a/.github/workflows/golang.yaml b/.github/workflows/golang.yaml index bfa298a..6d99419 100644 --- a/.github/workflows/golang.yaml +++ b/.github/workflows/golang.yaml @@ -28,11 +28,11 @@ jobs: --health-retries 5 runs-on: ubuntu-latest steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 - name: setup-go - uses: actions/setup-go@v3 + uses: actions/setup-go@v5 with: - go-version: 1.19 + go-version: 1.22 cache: true cache-dependency-path: go.sum - name: install atlas CLI @@ -42,19 +42,30 @@ jobs: - name: test all -race run: go test -race github.com/peterldowns/pgtestdb/... lint: + # https://github.com/golangci/golangci-lint-action?tab=readme-ov-file#annotations + permissions: + contents: read # read the repo + pull-requests: read # allows the 'only-new-issues' option to work + checks: write # annotate code in the PR runs-on: ubuntu-latest steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 - name: setup-go - uses: actions/setup-go@v3 + uses: actions/setup-go@v5 with: - go-version: 1.19 + go-version: 1.22 cache: true cache-dependency-path: go.sum - name: golangci-lint - uses: golangci/golangci-lint-action@v3 + uses: golangci/golangci-lint-action@v5 with: - version: v1.52.2 + install-mode: "binary" + version: "v1.57.1" + # https://github.com/golangci/golangci-lint-action/issues/244 + # https://github.com/Kong/mesh-perf/pull/168 + # https://github.com/golangci/golangci-lint-action/issues/552#issuecomment-1413509544 + args: --timeout 10m + skip-cache: true - name: go mod tidy run: go mod tidy - name: check for any changes