Skip to content

Commit 03e3e7d

Browse files
committed
matrix for test. Use postgres service instead of embedded pg for test
1 parent 8caa0b2 commit 03e3e7d

File tree

1 file changed

+24
-2
lines changed

1 file changed

+24
-2
lines changed

.github/workflows/test.yaml

Lines changed: 24 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,11 +8,31 @@ name: Test
88
jobs:
99
test:
1010
runs-on: ubuntu-latest
11+
strategy:
12+
matrix:
13+
postgres-version:
14+
- { tag: "14", sha: "sha256:bbcaba1d74865ee6d6318b5e297d0df73d1f6b6d995cd892b60a2cf1440b716a" }
15+
- { tag: "15", sha: "sha256:f57a3bdbf044f0b213fdc99f35a0d21c401608bf41f063176ec00c51df9655f7" }
16+
- { tag: "16", sha: "sha256:47053cd4ee3f096afc744e53e3280de7b29b3670d2f2196c2acc0c6470923c99" }
17+
services:
18+
postgres:
19+
image: postgres:${{ matrix.postgres-version.tag }}@${{ matrix.postgres-version.sha }}
20+
ports:
21+
- 5432:5432
22+
env:
23+
POSTGRES_PASSWORD: postgres
24+
POSTGRES_DB: mission-control
25+
# Set health checks to wait until postgres has started
26+
options: >-
27+
--health-cmd pg_isready
28+
--health-interval 10s
29+
--health-timeout 5s
30+
--health-retries 5
1131
steps:
1232
- name: Install Go
1333
uses: buildjet/setup-go@v5
1434
with:
15-
go-version: 1.22.x
35+
go-version: 1.24.x
1636
- name: Checkout code
1737
uses: actions/checkout@1d96c772d19495a3b5c517cd2bc0cb401ea0529f # v4.1.3
1838
- uses: buildjet/cache@v4
@@ -26,6 +46,8 @@ jobs:
2646
cache-
2747
- name: Test
2848
run: make test
49+
env:
50+
DUTY_DB_URL: postgres://postgres:postgres@localhost:5432/mission-control?sslmode=disable
2951

3052
migrate:
3153
runs-on: ubuntu-latest
@@ -41,7 +63,7 @@ jobs:
4163
- name: Install Go
4264
uses: buildjet/setup-go@v5
4365
with:
44-
go-version: 1.22.x
66+
go-version: 1.24.x
4567
- name: Check out main branch
4668
uses: actions/checkout@1d96c772d19495a3b5c517cd2bc0cb401ea0529f # v4.1.3
4769
with:

0 commit comments

Comments
 (0)