-
Notifications
You must be signed in to change notification settings - Fork 1
65 lines (53 loc) · 1.44 KB
/
backend.yml
File metadata and controls
65 lines (53 loc) · 1.44 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
name: Backend CI
on:
pull_request:
paths:
- "backend/**"
- ".github/workflows/backend.yml"
push:
branches: [main]
jobs:
backend-ci:
name: Run backend tests and linters
runs-on: ubuntu-latest
services:
postgres:
image: postgres:15
ports: [5432:5432]
env:
POSTGRES_USER: test_user
POSTGRES_PASSWORD: test_pass
POSTGRES_DB: test_db
options: >-
--health-cmd pg_isready
--health-interval 10s
--health-timeout 5s
--health-retries 5
env:
DATABASE_URL: postgresql+psycopg2://test_user:test_pass@localhost:5432/test_db
ENVIRONMENT: test
steps:
- uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: "3.13"
- name: Install Poetry
run: |
pip install poetry
poetry config virtualenvs.create false
- name: Install dependencies
working-directory: ./backend
run: poetry install
- name: Run isort
working-directory: ./backend
run: poetry run isort . --check-only
- name: Run black
working-directory: ./backend
run: poetry run black . --check
- name: Run flake8
working-directory: ./backend
run: poetry run flake8 .
- name: Run tests
working-directory: ./backend
run: poetry run pytest