mirror of
https://github.com/rzmk/learnhouse.git
synced 2025-12-18 20:09:25 +00:00
54 lines
1.1 KiB
YAML
54 lines
1.1 KiB
YAML
name: API Tests
|
|
permissions:
|
|
contents: read
|
|
on:
|
|
push:
|
|
branches:
|
|
- dev
|
|
paths:
|
|
- "apps/api/**"
|
|
pull_request:
|
|
paths:
|
|
- "apps/api/**"
|
|
jobs:
|
|
test:
|
|
runs-on: ubuntu-latest
|
|
|
|
steps:
|
|
- uses: actions/checkout@v4
|
|
|
|
- name: Set up Python
|
|
uses: actions/setup-python@v4
|
|
with:
|
|
python-version: "3.12"
|
|
|
|
- name: Install uv
|
|
uses: astral-sh/setup-uv@v2
|
|
with:
|
|
version: latest
|
|
|
|
- name: Install dependencies
|
|
run: |
|
|
cd apps/api
|
|
uv sync
|
|
|
|
- name: Run tests
|
|
run: |
|
|
cd apps/api
|
|
uv run pytest src/tests/ -v --tb=short
|
|
env:
|
|
TESTING: "true"
|
|
|
|
- name: Run security tests with coverage
|
|
run: |
|
|
cd apps/api
|
|
uv run pytest src/tests/security/ --cov=src.security --cov-report=html --cov-report=term-missing
|
|
env:
|
|
TESTING: "true"
|
|
|
|
- name: Upload coverage report to GitHub
|
|
uses: actions/upload-artifact@v4
|
|
with:
|
|
name: coverage-report
|
|
path: apps/api/htmlcov/
|
|
retention-days: 30
|