bulk-questionnaire-upload/.github/workflows/backend.yml

43 lines
987 B
YAML

name: Backend CI
on:
push:
branches: [ main ]
paths:
- 'backend/**'
- 'tests/backend/**'
- 'ruff.toml'
- 'pytest.ini'
- '.github/workflows/backend.yml'
pull_request:
branches: [ main ]
paths:
- 'backend/**'
- 'tests/backend/**'
- 'ruff.toml'
- 'pytest.ini'
- '.github/workflows/backend.yml'
jobs:
backend-tests:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: '3.11'
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install ruff pytest-cov
pip install -r backend/requirements.txt
- name: Lint with ruff
run: ruff check backend/ tests/backend/
- name: Run pytest
run: python -m pytest tests/backend -q --cov=backend --cov-report=term-missing