Skip to content

Commit

Permalink
fix(ci): pin go@1.22, golangci-lint@v1.57.1
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
peterldowns committed Sep 25, 2024
1 parent 25043e5 commit 1e5d91b
Showing 1 changed file with 19 additions and 8 deletions.
27 changes: 19 additions & 8 deletions .github/workflows/golang.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand Down

0 comments on commit 1e5d91b

Please sign in to comment.