Repository navigation
97 lines (85 loc) · 2.55 KB
/
Copy pathci.yml
File metadata and controls
97 lines (85 loc) · 2.55 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
89
90
91
92
93
94
95
96
97
name: CI
on:
push:
branches: [development, master]
pull_request:
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
backend:
runs-on: ubuntu-latest
services:
postgres:
image: postgres:17-alpine
env:
POSTGRES_USER: papyrus
POSTGRES_PASSWORD: papyrus
POSTGRES_DB: papyrus
ports:
- 5432:5432
options: >-
--health-cmd "pg_isready -U papyrus"
--health-interval 5s
--health-timeout 5s
--health-retries 10
env:
DEBUG: false
HOST: 127.0.0.1
PORT: 8080
API_PREFIX: /v1
CORS_ORIGINS: '["http://localhost:3000"]'
SECRET_KEY: test-secret-key
ALGORITHM: HS256
ACCESS_TOKEN_EXPIRE_MINUTES: 60
REFRESH_TOKEN_EXPIRE_DAYS: 30
RATE_LIMIT_AUTH: 5
RATE_LIMIT_GENERAL: 100
RATE_LIMIT_UPLOAD: 10
RATE_LIMIT_BATCH: 20
POSTGRES_USER: papyrus
POSTGRES_PASSWORD: papyrus
POSTGRES_HOST: 127.0.0.1
POSTGRES_PORT: 5432
POSTGRES_DB: papyrus
TEST_POSTGRES_USER: papyrus
TEST_POSTGRES_PASSWORD: papyrus
TEST_POSTGRES_HOST: 127.0.0.1
TEST_POSTGRES_PORT: 5432
TEST_POSTGRES_DB: papyrus_test
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: "3.12"
- uses: astral-sh/setup-uv@v5
- name: Install dependencies
run: uv sync --extra dev
- name: Ruff
run: uv run ruff check .
- name: Mypy
run: uv run mypy .
- name: Export public API snapshot
run: |
mkdir -p build/api
uv run --locked python scripts/export_openapi.py build/api/openapi.json
uv run --locked python scripts/export_openapi.py build/api/openapi.json --check
- name: Upload public API snapshot
uses: actions/upload-artifact@v4
with:
name: server-openapi-${{ github.sha }}
path: build/api/openapi.json
if-no-files-found: error
retention-days: 14
- name: Pytest
env:
PAPYRUS_TEST_TIMING: build/test-results/timing.json
run: uv run pytest --durations=20
- name: Save test timing report
if: ${{ !cancelled() && hashFiles('build/test-results/timing.json') != '' }}
uses: actions/upload-artifact@v4
with:
name: server-test-timing-${{ github.run_attempt }}
path: build/test-results/timing.*
if-no-files-found: error
retention-days: 14