Skip to content

Read me

Read me #25

Workflow file for this run

name: Run Tests
on:
push:
branches: ['*']
pull_request:
branches: ['*']
jobs:
test:
runs-on: ubuntu-latest
services:
postgres:
image: postgres:15
env:
POSTGRES_USER: postgres
POSTGRES_PASSWORD: test123
POSTGRES_DB: testdb
ports:
- 5432:5432
options: >-
--health-cmd pg_isready
--health-interval 10s
--health-timeout 5s
--health-retries 5
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: '3.13'
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install -r back/requirements.txt
pip install pytest pytest-cov
- name: Run unit tests with coverage
run: |
python -m pytest back/tests/ --ignore=back/tests/test_api.py -v --cov=back/app --cov-report=term-missing --cov-fail-under=80
env:
DATABASE_URL: postgresql://postgres:test123@localhost:5432/testdb
api-test:
runs-on: ubuntu-latest
needs: test
services:
postgres:
image: postgres:15
env:
POSTGRES_USER: postgres
POSTGRES_PASSWORD: test123
POSTGRES_DB: testdb
ports:
- 5432:5432
options: >-
--health-cmd pg_isready
--health-interval 10s
--health-timeout 5s
--health-retries 5
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: '3.13'
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install -r back/requirements.txt
pip install pytest pytest-cov
- name: Run API tests
run: |
python -m pytest back/tests/test_api.py -v --cov-fail-under=70
env:
DATABASE_URL: postgresql://postgres:test123@localhost:5432/testdb