week 2c: happy-path score-submission integration test #22
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 | |
| on: | |
| push: | |
| branches: | |
| - master | |
| paths: | |
| - "**.py" | |
| - "pytest.ini" | |
| - "requirements*.txt" | |
| - "docker-compose.test.yml" | |
| - ".github/workflows/test.yml" | |
| pull_request: | |
| jobs: | |
| unit: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v4 | |
| - name: Setup Python | |
| uses: actions/setup-python@v5 | |
| with: | |
| python-version: "3.11" | |
| cache: "pip" | |
| - name: Install dependencies | |
| run: pip install -rrequirements{,-dev}.txt | |
| - name: Run pytest | |
| run: pytest tests/unit | |
| integration: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v4 | |
| - name: Setup Python | |
| uses: actions/setup-python@v5 | |
| with: | |
| python-version: "3.11" | |
| cache: "pip" | |
| - name: Install dependencies | |
| run: pip install -rrequirements{,-dev}.txt | |
| - name: Start MySQL + Redis | |
| run: docker compose -f docker-compose.test.yml up -d --wait mysql redis | |
| - name: Run migrations | |
| run: docker compose -f docker-compose.test.yml run --rm migrations | |
| - name: Run integration tests | |
| run: pytest tests/integration | |
| - name: Dump compose logs on failure | |
| if: failure() | |
| run: docker compose -f docker-compose.test.yml logs |