fix: align handoff/review behavior with refreshed docs #630
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: Coverage Report | |
| on: | |
| pull_request: | |
| paths: | |
| - "src/**" | |
| jobs: | |
| coverage: | |
| runs-on: ubuntu-latest | |
| permissions: | |
| contents: read | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v4 | |
| with: | |
| fetch-depth: 0 | |
| - name: Install uv | |
| uses: astral-sh/setup-uv@v4 | |
| with: | |
| version: "latest" | |
| - name: Set up Python | |
| uses: actions/setup-python@v5 | |
| with: | |
| python-version: "3.14" | |
| - name: Create virtual environment and install dependencies | |
| run: | | |
| uv venv | |
| source .venv/bin/activate | |
| uv pip install -e ".[dev]" | |
| - name: Run coverage on PR branch | |
| run: | | |
| source .venv/bin/activate | |
| uv run pytest src/poly/tests/ --cov=poly --cov-report=json:coverage-pr.json -q | |
| - name: Run coverage on base branch | |
| env: | |
| BASE_REF: ${{ github.base_ref }} | |
| run: | | |
| source .venv/bin/activate | |
| PR_SHA=$(git rev-parse HEAD) | |
| if git rev-parse --verify -q HEAD:uv.lock >/dev/null; then | |
| git checkout -- uv.lock | |
| fi | |
| git checkout "origin/$BASE_REF" | |
| uv pip install -e ".[dev]" | |
| uv run pytest src/poly/tests/ --cov=poly --cov-report=json:coverage-base.json -q || true | |
| if git rev-parse --verify -q HEAD:uv.lock >/dev/null; then | |
| git checkout -- uv.lock | |
| fi | |
| git checkout "$PR_SHA" | |
| - name: Generate coverage comment | |
| env: | |
| BASE_REF: ${{ github.base_ref }} | |
| run: | | |
| source .venv/bin/activate | |
| python .github/scripts/coverage_comment.py \ | |
| coverage-base.json \ | |
| coverage-pr.json \ | |
| "$BASE_REF" > coverage_comment.md | |
| - name: Save PR number | |
| run: echo "${{ github.event.number }}" > pr_number.txt | |
| - name: Upload coverage artifacts | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: coverage-comment | |
| path: | | |
| coverage_comment.md | |
| pr_number.txt |