Skip to content

Commit 1a7b1bb

Browse files
committed
Update CI workflows to latest action versions and expand Go matrix
- Bump checkout, setup-go to v6; golangci-lint-action to v9 - Replace container-based test setup with setup-go for Go 1.19-1.25 - Fix Postgres service connectivity with port mapping and health checks - Remove obsolete .golangci.yml (incompatible with golangci-lint v2)
1 parent 8129a7b commit 1a7b1bb

File tree

3 files changed

+25
-46
lines changed

3 files changed

+25
-46
lines changed

.github/workflows/lint.yaml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -10,10 +10,10 @@ jobs:
1010
lint:
1111
runs-on: ubuntu-latest
1212
steps:
13-
- uses: actions/checkout@v3
14-
- uses: actions/setup-go@v3
13+
- uses: actions/checkout@v6
14+
- uses: actions/setup-go@v6
1515
with:
16-
go-version: 1.20.2
17-
- uses: golangci/golangci-lint-action@v3
16+
go-version: 1.25.7
17+
- uses: golangci/golangci-lint-action@v9
1818
with:
19-
version: v1.52.1
19+
version: v2.8.0

.github/workflows/test.yaml

Lines changed: 20 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -10,30 +10,37 @@ jobs:
1010
test:
1111
strategy:
1212
matrix:
13-
containers:
14-
- 1.19.7-bullseye
15-
- 1.20.2-bullseye
13+
go-version:
14+
- "1.19"
15+
- "1.20"
16+
- "1.21"
17+
- "1.22"
18+
- "1.23"
19+
- "1.24"
20+
- "1.25"
1621
runs-on: ubuntu-latest
17-
container: golang:${{ matrix.containers }}
1822
env:
1923
PGPASSWORD: pgpwd
20-
PGHOST: postgres
24+
PGHOST: localhost
2125
PGUSER: postgres
2226
steps:
2327
- name: Checkout code
24-
uses: actions/checkout@v3
25-
- uses: actions/cache@v3
28+
uses: actions/checkout@v6
29+
- name: Setup Go
30+
uses: actions/setup-go@v6
2631
with:
27-
path: |
28-
~/.cache/go-build
29-
/go/pkg/mod
30-
key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }}
31-
restore-keys: |
32-
${{ runner.os }}-go-
32+
go-version: ${{ matrix.go-version }}
3333
- name: Unit Tests
3434
run: go test -v -race -timeout=60s ./...
3535
services:
3636
postgres:
3737
image: postgres:14.2
3838
env:
3939
POSTGRES_PASSWORD: pgpwd
40+
ports:
41+
- 5432:5432
42+
options: >-
43+
--health-cmd pg_isready
44+
--health-interval 10s
45+
--health-timeout 5s
46+
--health-retries 5

.golangci.yml

Lines changed: 0 additions & 28 deletions
This file was deleted.

0 commit comments

Comments
 (0)