[AI: Windsurf] add: パフォーマンステストのレポート生成機能を追加 #1
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: Backend CI | |
| on: | |
| push: | |
| branches: [ main, develop ] | |
| paths: | |
| - 'backend/**' | |
| - 'src/backend/**' | |
| - '.github/workflows/backend-ci.yml' | |
| pull_request: | |
| branches: [ main, develop ] | |
| paths: | |
| - 'backend/**' | |
| - 'src/backend/**' | |
| - '.github/workflows/backend-ci.yml' | |
| jobs: | |
| test: | |
| runs-on: ${{ matrix.os }} | |
| strategy: | |
| matrix: | |
| os: [ubuntu-latest, windows-latest] | |
| python-version: [3.11] | |
| steps: | |
| - uses: actions/checkout@v3 | |
| with: | |
| fetch-depth: 0 | |
| - name: Set up Python ${{ matrix.python-version }} | |
| uses: actions/setup-python@v4 | |
| with: | |
| python-version: ${{ matrix.python-version }} | |
| - name: Install dependencies | |
| run: | | |
| cd backend | |
| python -m pip install --upgrade pip | |
| pip install -r requirements.txt | |
| pip install pytest pytest-cov pytest-asyncio | |
| - name: Run tests and generate coverage report | |
| run: | | |
| cd backend | |
| export TESTING=True | |
| export DATABASE_URL=sqlite+aiosqlite:///:memory: | |
| python -m pytest tests/ -v --cov=src/backend --cov-report=xml:coverage.xml --cov-report=term-missing --cov-report=html | |
| - name: Upload coverage to Codecov | |
| uses: codecov/codecov-action@v3 | |
| with: | |
| file: backend/coverage.xml | |
| name: backend | |
| flags: backend | |
| fail_ci_if_error: true | |
| - name: Run type checking | |
| run: | | |
| cd backend | |
| pip install mypy | |
| mypy src/backend --strict | |
| - name: Run linting | |
| run: | | |
| cd backend | |
| pip install flake8 black isort | |
| flake8 src/backend --max-line-length=88 --extend-ignore=E203,W503 --exclude=*.pyc,__pycache__ | |
| black --check src/backend | |
| isort --check src/backend |