39 lines
908 B
YAML
39 lines
908 B
YAML
name: Backend Tests
|
|
|
|
on:
|
|
push:
|
|
branches: [main]
|
|
pull_request:
|
|
branches: [main]
|
|
|
|
jobs:
|
|
backend-tests:
|
|
runs-on: ubuntu-latest
|
|
timeout-minutes: 15
|
|
|
|
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 -r backend/requirements.txt
|
|
pip install -r backend/requirements-test.txt
|
|
|
|
- name: Run tests with coverage
|
|
env:
|
|
APP_DB_PATH: /tmp/rss_news_test.db
|
|
run: |
|
|
pytest backend/tests --cov=backend/app --cov-report=term-missing --cov-report=xml
|
|
|
|
- name: Upload coverage artifact
|
|
uses: actions/upload-artifact@v4
|
|
with:
|
|
name: coverage-xml
|
|
path: coverage.xml
|