Skip to content

Commit

Permalink
feat (github): Report test results in PRs (#9)
Browse files Browse the repository at this point in the history
* Report test results in PRs

* Fix artifact download

* Debug missing artifacts

* Look for artifacts in correct path
  • Loading branch information
Emrys-Merlin committed Sep 23, 2024
1 parent 7f9d575 commit 1e63883
Show file tree
Hide file tree
Showing 2 changed files with 41 additions and 3 deletions.
42 changes: 40 additions & 2 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,13 @@ name: Python package

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

jobs:
test:
Expand Down Expand Up @@ -37,3 +41,37 @@ jobs:
gist-id: ${{ vars.GIST_ID_BADGES }}
token: ${{ secrets.GIST_TOKEN }}
prefix: ${{ github.event.repository.name }}_${{ matrix.python-version }}

- name: Upload Test Results
if: always()
uses: actions/upload-artifact@v4
with:
name: Test Results (Python ${{ matrix.python-version }})
path: report.xml

report:
name: Comment test results
runs-on: ubuntu-latest
needs: test
permissions:
checks: write

# only needed unless run with comment_mode: off
pull-requests: write

# only needed for private repository
contents: read

# only needed for private repository
issues: read

if: always()

steps:
- name: Download Test Results
uses: actions/download-artifact@v4

- name: Publish Test Results
uses: EnricoMi/publish-unit-test-result-action@v2
with:
files: "**/*.xml"
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ setup:
test:
pytest --cov=web_watchr --cov-report term-missing

.PHONY: setup-ci
.PHONY: run-ci
run-ci:
pip install --upgrade pip
pip install uv
Expand Down

0 comments on commit 1e63883

Please sign in to comment.