-
-
Notifications
You must be signed in to change notification settings - Fork 1
88 lines (82 loc) · 2.52 KB
/
Copy pathci.yml
File metadata and controls
88 lines (82 loc) · 2.52 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
85
86
87
88
name: CI
on:
push:
branches: [main]
pull_request:
permissions:
contents: read
concurrency:
group: ci-${{ github.ref }}
cancel-in-progress: true
jobs:
lint-and-types:
name: Lint, format and types
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: "3.13"
cache: pip
- run: pip install -e ".[dev]"
- name: Ruff lint
run: ruff check .
- name: Ruff format check
run: ruff format --check .
- name: mypy
run: mypy
fast-tests:
name: Fast tests (SQLite, Python ${{ matrix.python-version }})
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
python-version: ["3.11", "3.12", "3.13"]
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
cache: pip
- run: pip install -e ".[dev]"
# The PostgreSQL suite skips itself here: no HYMICAL_TEST_POSTGRES_URL is
# set, which is the same thing that happens on a developer's machine.
- name: pytest
run: pytest
postgres-integration:
name: PostgreSQL integration tests
runs-on: ubuntu-latest
# Only on the primary supported version. What these tests cover is
# PostgreSQL's behaviour, not the interpreter's, so running them across the
# whole matrix would multiply the runtime and prove nothing extra.
services:
postgres:
image: postgres:17
env:
# Disposable credentials for a container that exists for one job and is
# reachable only from it. Nothing here is a secret.
POSTGRES_USER: forms
POSTGRES_PASSWORD: forms
POSTGRES_DB: forms
ports:
- 5432:5432
options: >-
--health-cmd "pg_isready -U forms -d forms"
--health-interval 5s
--health-timeout 5s
--health-retries 10
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: "3.13"
cache: pip
- run: pip install -e ".[dev]"
- name: Migrate an empty database to head
run: alembic upgrade head
env:
FORMS_DATABASE_URL: postgresql+psycopg://forms:forms@localhost:5432/forms
- name: pytest (PostgreSQL)
run: pytest tests/integration -m postgres
env:
HYMICAL_TEST_POSTGRES_URL: postgresql+psycopg://forms:forms@localhost:5432/forms