Repository navigation
82 lines (62 loc) · 2.01 KB
/
Copy pathci.yml
File metadata and controls
82 lines (62 loc) · 2.01 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
name: CI
on:
push:
branches: [ main ]
pull_request:
branches: [ main ]
jobs:
lint-and-test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v7
- name: Install uv
uses: astral-sh/setup-uv@v7
with:
version: "latest"
- name: Set up Python
uses: actions/setup-python@v7
with:
python-version: "3.13"
- name: Install dependencies
run: make install
- name: Run linting
run: make lint
- name: Run tests with coverage
run: make coverage
- name: Wheel smoke test
run: |
uv build --wheel --out-dir dist
WHEEL="$(ls "$GITHUB_WORKSPACE"/dist/*.whl)"
cd "$RUNNER_TEMP"
uv run --no-project --isolated --python 3.13 --with "$WHEEL" python - <<'PYTHON'
import asyncio
import tempfile
from pathlib import Path
from servicekit import SqliteDatabaseBuilder, get_alembic_dir
async def main() -> None:
assert get_alembic_dir().is_dir()
with tempfile.TemporaryDirectory() as tmp_dir:
database = SqliteDatabaseBuilder.from_file(Path(tmp_dir) / "smoke.db").build()
await database.init()
await database.dispose()
print("OK")
asyncio.run(main())
PYTHON
- name: Upload coverage reports to Codecov
uses: codecov/codecov-action@v7
env:
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
docker-examples:
name: Build example image (${{ matrix.example }})
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
example: [app_hosting, auth, core_api, job_scheduler, monitoring, registration]
steps:
- uses: actions/checkout@v7
- name: Build example image
run: docker build -f examples/${{ matrix.example }}/Dockerfile .
- name: Build registration runtime target
if: matrix.example == 'registration'
run: docker build -f examples/registration/Dockerfile --target runtime .