feat: backend unit test part II #92
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: Test Workflow with Coverage - Code-Gen | |
| on: | |
| workflow_dispatch: | |
| push: | |
| branches: | |
| - main | |
| - dev | |
| - demo | |
| - hotfix | |
| pull_request: | |
| types: | |
| - opened | |
| - ready_for_review | |
| - reopened | |
| - synchronize | |
| branches: | |
| - main | |
| - dev | |
| - demo | |
| - hotfix | |
| jobs: | |
| backend_tests: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v3 | |
| - name: Set up Python | |
| uses: actions/setup-python@v4 | |
| with: | |
| python-version: '3.11' | |
| - name: Install Dependencies | |
| run: | | |
| python -m pip install --upgrade pip | |
| pip install -r src/backend/requirements.txt | |
| pip install -r src/frontend/requirements.txt | |
| pip install pytest-cov pytest-asyncio | |
| - name: Set PYTHONPATH | |
| run: echo "PYTHONPATH=$PWD/src/backend" >> $GITHUB_ENV | |
| - name: Run Backend Tests with Coverage | |
| run: | | |
| cd src | |
| # only measure coverage for src/backend, omit tests via .coveragerc | |
| pytest \ | |
| --cov=backend \ | |
| --cov-report=term-missing \ | |
| --cov-report=xml \ | |
| --cov-config=../.coveragerc |