-
Notifications
You must be signed in to change notification settings - Fork 8
56 lines (50 loc) · 1.41 KB
/
Copy pathintegration-tests-postgres.yml
File metadata and controls
56 lines (50 loc) · 1.41 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
name: PostgreSQL integration tests
on:
push:
branches: [ "main" ]
pull_request:
branches: [ "main" ]
workflow_dispatch:
jobs:
integration-tests:
runs-on: ubuntu-24.04
strategy:
matrix:
include:
- driver: psycopg2
package: psycopg2
db_string: postgresql+psycopg2://postgres:postgres@localhost:5432/postgres
- driver: psycopg
package: "psycopg[binary]"
db_string: postgresql+psycopg://postgres:postgres@localhost:5432/postgres
services:
postgres:
image: postgres
env:
POSTGRES_PASSWORD: postgres
TZ: 'Europe/Paris'
PGTZ: 'Europe/Paris'
ports:
- 5432:5432
# Set health checks to wait until postgres has started
options: >-
--health-cmd pg_isready
--health-interval 10s
--health-timeout 5s
--health-retries 5
steps:
- name: Check out repository code
uses: actions/checkout@v4
- name: Set up Python 3.12
uses: actions/setup-python@v5
with:
python-version: 3.12
- name: Install dependencies
run: |
python -m pip install --upgrade pip
python -m pip install flake8 .[tests] "${{ matrix.package }}"
- name: Test with pytest
run: |
pytest tests -x
env:
DB_STRING: ${{ matrix.db_string }}