Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
25 changes: 15 additions & 10 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,12 @@ name: CI

permissions:
contents: read
pull-requests: write

on:
push:
branches: [ "main" ]
branches: ["main"]
pull_request:
branches: [ "main" ]
branches: ["main"]

env:
UV_FROZEN: true
Expand All @@ -33,7 +32,7 @@ jobs:
needs: format
strategy:
matrix:
python-version: [ "3.11", "3.12", "3.13", "3.14" ]
python-version: ["3.11", "3.12", "3.13", "3.14"]
steps:
- uses: actions/checkout@v6
with:
Expand Down Expand Up @@ -68,10 +67,16 @@ jobs:
pytest-cloud.xml \
pytest.xml

- name: Pytest coverage comment
if: github.event_name == 'pull_request' && matrix.python-version ==
env.COVERAGE_PYTHON
uses: MishaKav/pytest-coverage-comment@v1
- name: Record PR number
if: github.event_name == 'pull_request' && matrix.python-version == env.COVERAGE_PYTHON
run: echo "${{ github.event.number }}" > pr-number.txt

- uses: actions/upload-artifact@v7
if: github.event_name == 'pull_request' && matrix.python-version == env.COVERAGE_PYTHON
with:
pytest-xml-coverage-path: ./coverage.xml
junitxml-path: ./pytest.xml
name: coverage
retention-days: 1
path: |
coverage.xml
pytest.xml
pr-number.txt
33 changes: 33 additions & 0 deletions .github/workflows/coverage.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
name: Coverage report

on:
workflow_run:
workflows: ["CI"]
types: [completed]

permissions:
pull-requests: write
actions: read

jobs:
coverage:
if: >-
github.event.workflow_run.event == 'pull_request' &&
github.event.workflow_run.conclusion == 'success'
runs-on: ubuntu-latest
steps:
- uses: actions/download-artifact@v8
with:
name: coverage
run-id: ${{ github.event.workflow_run.id }}
github-token: ${{ secrets.GITHUB_TOKEN }}

- id: pr
run: echo "number=$(cat pr-number.txt)" >> "$GITHUB_OUTPUT"

- name: Pytest coverage comment
uses: MishaKav/pytest-coverage-comment@v1
with:
issue-number: ${{ steps.pr.outputs.number }}
pytest-xml-coverage-path: ./coverage.xml
junitxml-path: ./pytest.xml