Repository navigation
refactor: move the insert and paragraph-split methods into a Revision… #387
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: Main | |
| on: | |
| push: | |
| branches: | |
| - main | |
| pull_request: | |
| types: [opened, synchronize, reopened, ready_for_review] | |
| jobs: | |
| quality: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Check out | |
| uses: actions/checkout@v4 | |
| - uses: actions/cache@v4 | |
| with: | |
| path: ~/.cache/pre-commit | |
| key: pre-commit-${{ hashFiles('.pre-commit-config.yaml') }} | |
| - name: Set up the environment | |
| uses: ./.github/actions/setup-python-env | |
| - name: Run checks | |
| run: make check | |
| tests-and-type-check: | |
| runs-on: ubuntu-latest | |
| name: tests-and-type-check (${{ matrix.python-version }}, shard ${{ matrix.shard }}) | |
| strategy: | |
| matrix: | |
| python-version: ["3.10", "3.11", "3.12", "3.13", "3.14"] | |
| # Two runners per version: the hosted runner has 2 vCPUs, so more | |
| # xdist workers cannot help; a second machine halves the wall time. | |
| # Shards are balanced by .test_durations (pytest-split); refresh it | |
| # with `pytest --store-durations` when the split drifts, then run | |
| # `make check` (pytest-split writes the file without a final newline). | |
| shard: [1, 2] | |
| fail-fast: false | |
| defaults: | |
| run: | |
| shell: bash | |
| steps: | |
| - name: Check out | |
| uses: actions/checkout@v4 | |
| - name: Set up the environment | |
| uses: ./.github/actions/setup-python-env | |
| with: | |
| python-version: ${{ matrix.python-version }} | |
| # Coverage tracing only where the report is uploaded (3.11); the other | |
| # versions run the plain suite. | |
| - name: Run tests | |
| run: >- | |
| uv run python -m pytest tests -n auto | |
| --splits 2 --group ${{ matrix.shard }} | |
| ${{ matrix.python-version == '3.11' && '--cov --cov-config=pyproject.toml --cov-report=xml' || '' }} | |
| - name: Check typing | |
| if: ${{ matrix.shard == 1 }} | |
| run: uv run ty check | |
| # Both 3.11 shards upload; codecov merges them per commit | |
| # (codecov.yaml: notify.after_n_builds = 2). | |
| - name: Upload coverage reports to Codecov with GitHub Action on Python 3.11 | |
| uses: codecov/codecov-action@v4 | |
| if: ${{ matrix.python-version == '3.11' }} | |
| env: | |
| CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }} | |
| check-docs: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Check out | |
| uses: actions/checkout@v4 | |
| - name: Set up the environment | |
| uses: ./.github/actions/setup-python-env | |
| - name: Check if documentation can be built | |
| run: uv run mkdocs build -s |