api / .github /workflows /ci.yml
Mate11
Pirmer commit
5f12c93
Raw History Blame
1.24 kB
name: CI
on:
push:
branches: [main, develop]
pull_request:
branches: [main, develop]
jobs:
lint:
name: Lint (ruff)
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: "3.12"
- name: Install ruff
run: pip install ruff==0.6.9
- name: Check code style
run: ruff check app/ tests/
test:
name: Tests (pytest)
runs-on: ubuntu-latest
env:
DATABASE_URL: sqlite:///./test.db
JWT_SECRET: ci-test-secret-key-not-used-in-production-32chars
ENVIRONMENT: development
MOCK_EXTERNAL_SERVICES: "true"
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: "3.12"
cache: pip
- name: Install dependencies
run: pip install -r requirements-dev.txt
- name: Run tests with coverage
run: pytest tests/ -v --cov=app --cov-report=term-missing --cov-report=xml
- name: Upload coverage report
uses: actions/upload-artifact@v4
if: always()
with:
name: coverage-report
path: coverage.xml
retention-days: 7