Running test suite by hamidizf on VnVReport/Final #406
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 Tests | |
| run-name: Running test suite by ${{ github.actor }} on ${{ github.head_ref }} | |
| on: | |
| pull_request: | |
| jobs: | |
| backend-test: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v4 | |
| - name: Set up Python | |
| uses: actions/setup-python@v5 | |
| with: | |
| python-version: "3.11" | |
| - uses: actions/cache@v4 | |
| with: | |
| path: ~/.cache/pip | |
| key: ${{ runner.os }}-pip-${{ hashFiles('requirements.txt') }} | |
| - name: Install dependencies | |
| run: | | |
| python -m pip install --upgrade pip | |
| if [ -f src/backend/requirements.txt ]; then pip install -r src/backend/requirements.txt; fi | |
| pip install pytest pytest-cov | |
| - name: Run tests with coverage | |
| env: | |
| DJANGO_SECRET_KEY: test-secret-key | |
| DJANGO_LOCAL: "true" | |
| DJANGO_DEBUG: "true" | |
| CELERY_BROKER_URL: "memory://" | |
| run: | | |
| pytest test/ \ | |
| --cov=src/backend \ | |
| --cov-report=term-missing \ | |
| --cov-report=html \ | |
| - name: Upload coverage report | |
| if: always() | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: coverage-html | |
| path: htmlcov/ | |
| frontend-test: | |
| timeout-minutes: 60 | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: actions/setup-node@v4 | |
| with: | |
| node-version: lts/* | |
| - name: Install dependencies and Run Playwright Tests | |
| run: | | |
| cd src/frontend/ | |
| npm install | |
| cd ../../test/frontend/ | |
| npm install | |
| npx playwright install --with-deps | |
| - name: Run Playwright Tests | |
| run: | | |
| cd test/frontend | |
| npx playwright test | |
| - uses: actions/upload-artifact@v4 | |
| if: ${{ !cancelled() }} | |
| with: | |
| name: playwright-report | |
| path: playwright-report/ | |
| retention-days: 30 |