Repository navigation
84 lines (78 loc) · 2.36 KB
/
Copy pathpostgres-tests.yml
File metadata and controls
84 lines (78 loc) · 2.36 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
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
name: Postgres tests
# The full Python suite on Postgres (`make test-py-pg`), including the
# `@pytest.mark.postgres` tests that SQLite cannot run. Parallel under xdist,
# one database per worker (every test resets its schema), but still slower than
# SQLite, so it is not part of the PR aggregate: it runs nightly, on demand, and
# on PRs that touch database/tenancy or concurrency-sensitive modules (#508, #599).
on:
schedule:
- cron: "0 3 * * *"
workflow_dispatch:
pull_request:
branches: [main]
paths:
- "framework/db/**"
- "framework/testing/**"
- "modules/tenants/**"
- "modules/users/**"
- "modules/background_tasks/**"
- "modules/file_storage/**"
- "host/migrations/**"
- ".github/workflows/postgres-tests.yml"
concurrency:
group: pg-tests-${{ github.event_name }}-${{ github.ref }}
cancel-in-progress: true
permissions:
contents: read
env:
NODE_VERSION: "24"
UV_SYNC_FLAGS: --locked
UV_CACHE_GLOB: |
uv.lock
pyproject.toml
framework/*/pyproject.toml
modules/*/pyproject.toml
host/pyproject.toml
jobs:
python-tests-pg:
name: Python tests (Postgres)
runs-on: ubuntu-latest
timeout-minutes: 30
services:
postgres:
image: postgres:16-alpine
env:
POSTGRES_USER: postgres
POSTGRES_PASSWORD: postgres
POSTGRES_DB: sm_test
ports: ["5432:5432"]
options: >-
--health-cmd "pg_isready -U postgres"
--health-interval 5s
--health-timeout 3s
--health-retries 10
# Same broker the python-tests job uses for the invalidation suite.
redis:
image: redis:7-alpine
ports: ["6379:6379"]
options: >-
--health-cmd "redis-cli ping"
--health-interval 5s
--health-timeout 3s
--health-retries 10
env:
SM_TEST_PG_URL: postgresql+asyncpg://postgres:postgres@localhost:5432/sm_test
SM_TEST_REDIS_URL: redis://127.0.0.1:6379/0
steps:
- uses: actions/checkout@v7
- uses: astral-sh/setup-uv@v10.3.1
with:
enable-cache: true
cache-dependency-glob: ${{ env.UV_CACHE_GLOB }}
- run: make install-py
- uses: actions/setup-node@v7
with:
node-version: ${{ env.NODE_VERSION }}
cache: "npm"
- run: npm ci
- run: make test-py-pg