Repository navigation
61 lines (61 loc) · 1.99 KB
/
Copy pathpostgres.yml
File metadata and controls
61 lines (61 loc) · 1.99 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
57
58
59
60
61
name: Postgres Versions Tests
on:
schedule:
- cron: '0 18 * * 1'
permissions:
contents: read
env:
# Skips setuptools_scm's `git archive` file listing; see Makefile.
SETUPTOOLS_SCM_IGNORE_VCS_ROOTS: ${{ github.workspace }}
jobs:
postgres:
name: Python postgres unit tests
runs-on: ubuntu-latest
timeout-minutes: 60
strategy:
max-parallel: 5
matrix:
postgres-version: [13, 14, 15, 16, 17]
services:
# Label used to access the service container
postgres:
# Docker Hub image
image: postgres:${{ matrix.postgres-version }}
# Provide the password for postgres
env:
POSTGRES_USER: postgres
POSTGRES_PASSWORD: postgres
POSTGRES_DB: test
# Set health checks to wait until postgres has started
options: >-
--health-cmd pg_isready --health-interval 10s --health-timeout 5s --health-retries 5
ports:
# Maps tcp port 5432 on service container to the host
- 5432:5432
# Discarded at job end, so durability buys nothing and every COMMIT
# would otherwise cost an fsync.
command: >-
-c fsync=off -c synchronous_commit=off -c full_page_writes=off
steps:
- uses: actions/checkout@v7.0.1
with:
fetch-depth: 0
- name: Set up uv
uses: astral-sh/setup-uv@v10.2.0
with:
enable-cache: false
- name: Install Python 3.9
run: uv python install 3.9
- name: Install dependencies
run: uv sync --group test --extra postgres --python 3.9
- name: Run tests
run: |
uv run python -O -m pytest kolibri --color=no
uv run python -O -m pytest --color=no -p no:django test
env:
KOLIBRI_DATABASE_ENGINE: postgres
KOLIBRI_DATABASE_USER: postgres
KOLIBRI_DATABASE_NAME: test
KOLIBRI_DATABASE_HOST: localhost
KOLIBRI_DATABASE_PASSWORD: postgres
KOLIBRI_DATABASE_PORT: "5432"