Skip to content

Commit

Permalink
generate pytest summary
Browse files Browse the repository at this point in the history
  • Loading branch information
xyluo25 committed Aug 20, 2024
1 parent a5127a3 commit ec65d0e
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 27 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/pylint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ jobs:
- uses: actions/checkout@v4

- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v4
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}

Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/pytest.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ jobs:
steps:
- uses: actions/checkout@v4
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v4
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
- name: Install dependencies
Expand Down
34 changes: 9 additions & 25 deletions .github/workflows/pytest_310.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ jobs:
- uses: actions/checkout@v4

- name: Set up Python 3.10
uses: actions/setup-python@v4
uses: actions/setup-python@v5
with:
python-version: "3.10"

Expand All @@ -43,32 +43,16 @@ jobs:
- name: Test with pytest
run: |
set -o pipefail
pytest --junitxml=pytest_310.xml
pytest
- name: Pytest Summary
uses: dariocurr/pytest-summary@main
with:
output: pytest_310_summary.md

- name: Upload Artifact
uses: actions/upload-artifact@v4
with:
name: pytest_310
path: pytest_310.xml

- name: Surface failing tests
name: pytest_310_summary
path: pytest_310_summary.md
if: always()
uses: pmeier/pytest-results-action@main
with:
# A list of JUnit XML files, directories containing the former, and wildcard
# patterns to process.
# See @actions/glob for supported patterns.
path: pytest_310.xml

# (Optional) Add a summary of the results at the top of the report
summary: true

# (Optional) Select which results should be included in the report.
# Follows the same syntax as `pytest -r`
display-options: fEX

# (Optional) Fail the workflow if no JUnit XML was found.
fail-on-empty: fail

# (Optional) Title of the test results section in the workflow summary
title: Pytest results

0 comments on commit ec65d0e

Please sign in to comment.