Skip to content

Commit 9618484

Browse files
Add Unit Test Results action to CI
Pytest will now output JUnit-format XML results, which the action should read and display on the PR in a nice format.
1 parent 954668b commit 9618484

File tree

3 files changed

+26
-1
lines changed

3 files changed

+26
-1
lines changed

.github/workflows/code.yml

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -100,6 +100,30 @@ jobs:
100100
name: ${{ matrix.os }}/${{ matrix.python }}
101101
directory: dist
102102

103+
- name: Upload Unit Test Results
104+
if: always()
105+
uses: actions/upload-artifact@v2
106+
with:
107+
name: Unit Test Results (${{ matrix.os }}/${{ matrix.python }})
108+
path: pytest-results.xml
109+
110+
publish-test-results:
111+
name: "Publish Unit Tests Results"
112+
needs: build
113+
runs-on: ubuntu-latest
114+
if: always()
115+
116+
steps:
117+
- name: Download Artifacts
118+
uses: actions/download-artifact@v2
119+
with:
120+
path: artifacts
121+
122+
- name: Publish Unit Test Results
123+
uses: EnricoMi/publish-unit-test-result-action@v1
124+
with:
125+
files: artifacts/**/*.xml
126+
103127
release:
104128
needs: [build]
105129
runs-on: ubuntu-latest

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,7 @@ coverage.xml
4545
*.mypy_cache
4646
*.pytest_cache
4747
cov.xml
48+
pytest-results.xml
4849

4950
# DLS build dir and virtual environment
5051
/prefix/

setup.cfg

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ extend-ignore =
5959
# Don't do flake8 here as we need to separate it out for CI
6060
addopts =
6161
--tb=native -vv --doctest-modules --ignore=iocStats --ignore=epicscorelibs --ignore=docs
62-
--cov=softioc --cov-report term --cov-report xml:cov.xml
62+
--cov=softioc --cov-report term --cov-report xml:cov.xml --junit-xml=pytest-results.xml
6363

6464
[coverage:run]
6565
# This is covered in the versiongit test suite so exclude it here

0 commit comments

Comments
 (0)