-
Notifications
You must be signed in to change notification settings - Fork 0
74 lines (62 loc) · 1.85 KB
/
python_server.yml
File metadata and controls
74 lines (62 loc) · 1.85 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
name: python_server
on:
workflow_dispatch:
pull_request:
branches:
- develop
jobs:
ci:
runs-on: self-hosted
services:
postgres:
image: postgres
env:
POSTGRES_DB: postgres
POSTGRES_USER: postgres
POSTGRES_PASSWORD: postgres
options: >-
--health-cmd pg_isready
--health-interval 10s
--health-timeout 5s
--health-retries 5
ports:
- 5432:5432
steps:
- uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: '3.12'
- name: Install poetry
uses: abatilo/actions-poetry@v2
- uses: actions/cache@v3
name: Define a cache for the virtual environment based on the dependencies lock file
with:
path: ./.venv
key: venv-${{ hashFiles('poetry.lock') }}
- name: Install the project dependencies
run: cd backend && poetry install
- name: Code analyze
run: |
cd backend &&
poetry run black src --check &&
poetry run black tests --check
- name: Create certs
run: |
cd backend &&
cd src &&
mkdir certs &&
cd certs &&
ssh-keygen -t rsa -b 4096 -m PEM -f jwt-private.pem -N "" &&
ssh-keygen -f jwt-private.pem -e -m PKCS8 > jwt-public.pem
- name: Tests
env:
APP_CONFIG__DB__URL: postgresql+asyncpg://postgres:postgres@localhost:5432/postgres
APP_CONFIG__DB__USER: postgres2
APP_CONFIG__DB__PORT: 5432
APP_CONFIG__DB__PASSWORD: postgres2
APP_CONFIG__DB__NAME: postgres
APP_CONFIG__DB__HOST: localhost
run: |
cd backend &&
poetry run pytest --cov=src/core --cov-report=term-missing