Skip to content

Commit

Permalink
Provide historical summary of tests and PR comment on failed tests
Browse files Browse the repository at this point in the history
  • Loading branch information
DiamondJoseph committed Sep 11, 2024
1 parent 81a6dbb commit 529ea55
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 1 deletion.
19 changes: 18 additions & 1 deletion .github/workflows/_test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -49,8 +49,9 @@ jobs:
with:
python-version: ${{ inputs.python-version }}
pip-install: ".[dev]"

- name: Run tests
run: tox -e tests
run: tox -e tests -- --ctrf report.json

- name: Upload coverage to Codecov
uses: codecov/codecov-action@v4
Expand All @@ -59,3 +60,19 @@ jobs:
files: cov.xml
env:
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}

- name: Comment on failing PR tests
run: npx github-actions-ctrf summary report.json --pr-comment --on-fail-only
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

- name: Publish CTRF Historical results table
run: npx github-actions-ctrf historical report.json
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

- name: Upload test results
uses: actions/upload-artifact@v4
with:
name: ${{ inputs.python-version }}-${{ inputs.runs-on }}-ctrf-report
path: report.json
1 change: 1 addition & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,7 @@ dev = [
"pytest-faulthandler",
"pytest-rerunfailures",
"pytest-timeout",
"pytest-json-ctrf",
"ruff",
"sphinx<7.4.0", # https://github.com/bluesky/ophyd-async/issues/459
"sphinx-autobuild",
Expand Down

0 comments on commit 529ea55

Please sign in to comment.