Optimize database queries for friends balance summary and enrich member data #427
Workflow file for this run
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: Run Backend Tests & Analytics | |
| on: | |
| pull_request: | |
| branches: [ main, master, feature/*] | |
| push: | |
| branches: [ main, master ] | |
| jobs: | |
| test-backend: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v5 | |
| with: | |
| fetch-depth: 0 # Full history for better diff analysis | |
| - name: Set up Python | |
| uses: actions/setup-python@v5 | |
| with: | |
| python-version: '3.12' | |
| - name: Install dependencies | |
| run: | | |
| python -m pip install --upgrade pip | |
| cd backend | |
| pip install -r requirements.txt | |
| - name: Run Backend Tests with Coverage | |
| run: | | |
| cd backend | |
| export PYTHONPATH=$GITHUB_WORKSPACE/backend:$GITHUB_WORKSPACE | |
| # Generate coverage with proper paths | |
| pytest \ | |
| --cov=app \ | |
| --cov-report=xml:coverage.xml \ | |
| --cov-report=term-missing \ | |
| --junit-xml=test-results.xml \ | |
| --tb=short \ | |
| -v \ | |
| tests/ | |
| - name: List coverage files for debugging | |
| run: | | |
| echo "Coverage files generated:" | |
| find . -name "coverage.*" -type f | head -10 | |
| ls -la backend/ | grep -E "(coverage|test-results)" | |
| - name: Run Test Analytics Upload | |
| uses: codecov/test-results-action@v1 | |
| if: github.actor != 'dependabot[bot]' | |
| with: | |
| token: ${{ secrets.CODECOV_TOKEN }} | |
| files: backend/test-results.xml | |
| flags: backend,test-analytics | |
| name: "Backend Test Results" | |
| - name: Upload Coverage to Codecov with Flags | |
| uses: codecov/codecov-action@v5 | |
| if: github.actor != 'dependabot[bot]' | |
| with: | |
| token: ${{ secrets.CODECOV_TOKEN }} | |
| file: backend/coverage.xml | |
| flags: backend,python,api | |
| name: backend-coverage | |
| fail_ci_if_error: false | |
| verbose: true | |
| working-directory: ./ | |
| override_branch: ${{ github.head_ref }} | |
| override_commit: ${{ github.event.pull_request.head.sha }} | |
| - name: Codecov upload skipped for Dependabot | |
| if: github.actor == 'dependabot[bot]' | |
| run: echo "📊 Codecov upload skipped for Dependabot PR - tests still run and pass!" |