ci: add parallel slow test job for full regression coverage #249
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: CI | |
| on: | |
| push: | |
| branches: [ "main" ] | |
| pull_request: | |
| types: [opened, synchronize, reopened] | |
| concurrency: | |
| group: ci-${{ github.workflow }}-${{ github.ref }} | |
| cancel-in-progress: true | |
| jobs: | |
| test: | |
| # Apply skip tokens only on push events. PR events do not provide | |
| # a reliable head_commit message payload. | |
| if: | | |
| github.event_name != 'push' || | |
| ( | |
| !contains(github.event.head_commit.message, '[skip ci]') && | |
| !contains(github.event.head_commit.message, '[skip-release]') | |
| ) | |
| runs-on: ubuntu-latest | |
| timeout-minutes: 20 | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Set up Python | |
| uses: actions/setup-python@v5 | |
| with: | |
| python-version: "3.10" | |
| cache: 'pip' | |
| cache-dependency-path: 'requirements.txt' | |
| - name: Cache pip packages | |
| uses: actions/cache@v4 | |
| with: | |
| path: ~/.cache/pip | |
| key: ${{ runner.os }}-pip-${{ hashFiles('requirements.txt') }} | |
| restore-keys: | | |
| ${{ runner.os }}-pip- | |
| - name: Install dependencies | |
| run: | | |
| python -m pip install --upgrade pip | |
| if [ -f requirements.txt ]; then pip install -r requirements.txt; fi | |
| pip install pytest pytest-timeout ruff | |
| - name: Lint with Ruff | |
| run: | | |
| ruff check . --ignore C901,D417 | |
| continue-on-error: false | |
| - name: Run fast tests | |
| run: | | |
| pytest -v --tb=short -m "not slow" | |
| continue-on-error: false | |
| test-slow: | |
| # Slow tests: HTTPClient, downloader, rate limiter, export, and | |
| # other networking/IO-heavy regression tests. Runs in parallel | |
| # with the fast lane so PR feedback stays quick. | |
| if: | | |
| github.event_name != 'push' || | |
| ( | |
| !contains(github.event.head_commit.message, '[skip ci]') && | |
| !contains(github.event.head_commit.message, '[skip-release]') | |
| ) | |
| runs-on: ubuntu-latest | |
| timeout-minutes: 10 | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Set up Python | |
| uses: actions/setup-python@v5 | |
| with: | |
| python-version: "3.10" | |
| cache: 'pip' | |
| cache-dependency-path: 'requirements.txt' | |
| - name: Cache pip packages | |
| uses: actions/cache@v4 | |
| with: | |
| path: ~/.cache/pip | |
| key: ${{ runner.os }}-pip-${{ hashFiles('requirements.txt') }} | |
| restore-keys: | | |
| ${{ runner.os }}-pip- | |
| - name: Install dependencies | |
| run: | | |
| python -m pip install --upgrade pip | |
| if [ -f requirements.txt ]; then pip install -r requirements.txt; fi | |
| pip install pytest pytest-timeout | |
| - name: Run slow tests | |
| run: | | |
| pytest -v --tb=short -m "slow" | |
| continue-on-error: false |