Skip to content

Commit 570db4d

Browse files
committed
ci: Use postgres-plus:17 image and follow constructive pattern
- Switch to ghcr.io/constructive-io/docker/postgres-plus:17 image - Add concurrency settings to cancel in-progress runs - Add workflow_dispatch for manual triggers - Add develop branch to triggers - Update password to match constructive pattern - Move env vars to job level
1 parent 4478ba5 commit 570db4d

1 file changed

Lines changed: 25 additions & 15 deletions

File tree

.github/workflows/test.yml

Lines changed: 25 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,32 +1,47 @@
1-
name: Tests
1+
name: pysql-test CI
22

33
on:
44
push:
5-
branches: [main]
5+
branches:
6+
- main
7+
- develop
68
pull_request:
7-
branches: [main]
9+
branches:
10+
- main
11+
- develop
12+
workflow_dispatch:
13+
14+
concurrency:
15+
group: ${{ github.workflow }}-${{ github.ref }}-run-tests
16+
cancel-in-progress: true
817

918
jobs:
1019
test:
1120
runs-on: ubuntu-latest
1221

22+
env:
23+
PGHOST: localhost
24+
PGPORT: 5432
25+
PGUSER: postgres
26+
PGPASSWORD: password
27+
1328
services:
14-
postgres:
15-
image: postgres:17
29+
pg_db:
30+
image: ghcr.io/constructive-io/docker/postgres-plus:17
1631
env:
1732
POSTGRES_USER: postgres
18-
POSTGRES_PASSWORD: postgres
19-
POSTGRES_DB: postgres
20-
ports:
21-
- 5432:5432
33+
POSTGRES_PASSWORD: password
2234
options: >-
2335
--health-cmd pg_isready
2436
--health-interval 10s
2537
--health-timeout 5s
2638
--health-retries 5
39+
ports:
40+
- 5432:5432
2741

2842
steps:
29-
- uses: actions/checkout@v4
43+
- name: Checkout
44+
uses: actions/checkout@v4
3045

3146
- name: Set up Python
3247
uses: actions/setup-python@v5
@@ -50,9 +65,4 @@ jobs:
5065
run: poetry run mypy src --ignore-missing-imports
5166

5267
- name: Run tests
53-
env:
54-
PGHOST: localhost
55-
PGPORT: 5432
56-
PGUSER: postgres
57-
PGPASSWORD: postgres
5868
run: poetry run pytest -v

0 commit comments

Comments
 (0)