-
Notifications
You must be signed in to change notification settings - Fork 3
93 lines (84 loc) · 2.83 KB
/
Copy pathtest-backend.yml
File metadata and controls
93 lines (84 loc) · 2.83 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
name: Test backend
on:
push:
paths: &paths
- "backend/**"
- ".github/workflows/test-backend.yml"
# Also on PRs, so the suite runs against the MERGE RESULT rather than only
# the branch tip.
pull_request:
paths: *paths
jobs:
container-job:
runs-on: ubuntu-latest
container: python:3.12.6
services:
postgres:
image: postgis/postgis:16-3.5-alpine
env:
POSTGRES_SCHEME: postgresql+psycopg
POSTGRES_USER: postgres
POSTGRES_PASSWORD: postgres
POSTGRES_DB: postgres
POSTGRES_SERVER: postgres
POSTGRES_PORT: 5432
ports:
- 5432:5432
options: >-
--health-cmd pg_isready
--health-interval 10s
--health-timeout 5s
--health-retries 5
steps:
- name: Checkout repo code
uses: actions/checkout@v4
- name: Install GDAL
run: |
apt-get update
apt-get install -y openssh-client libpq-dev postgresql libpq-dev gdal-bin libgdal-dev
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install -r requirements.txt --no-cache-dir
working-directory: backend
- name: Run migrations
run: |
alembic upgrade head
working-directory: backend
env:
DOMAIN: postgres
ENVIRONMENT: test
PROJECT_NAME: Districtr v2 backend
BACKEND_CORS_ORIGINS: "http://localhost,http://localhost:5173"
SECRET_KEY: mysupersecretkey
DATABASE_URL: postgresql+psycopg://postgres:postgres@postgres:5432/postgres
POSTGRES_SCHEME: postgresql+psycopg
POSTGRES_USER: postgres
POSTGRES_PASSWORD: postgres
POSTGRES_DB: postgres
POSTGRES_SERVER: postgres
POSTGRES_PORT: 5432
AUTH_JWKS_URL: http://localhost:8001/.well-known/jwks.json
AUTH_AUDIENCE: http://localhost:8000/
AUTH_ISSUER: http://localhost:8001
AUTH_ALGORITHMS: RS256
- name: Run tests
run: pytest -v --cov=.
working-directory: backend
env:
DOMAIN: postgres
ENVIRONMENT: test
PROJECT_NAME: Districtr v2 backend
BACKEND_CORS_ORIGINS: "http://localhost,http://localhost:5173"
SECRET_KEY: mysupersecretkey
DATABASE_URL: postgresql+psycopg://postgres:postgres@postgres:5432/postgres
POSTGRES_SCHEME: postgresql+psycopg
POSTGRES_USER: postgres
POSTGRES_PASSWORD: postgres
POSTGRES_DB: postgres
POSTGRES_SERVER: postgres
POSTGRES_PORT: 5432
AUTH_JWKS_URL: http://localhost:8001/.well-known/jwks.json
AUTH_AUDIENCE: http://localhost:8000/
AUTH_ISSUER: http://localhost:8001
AUTH_ALGORITHMS: RS256