Skip to content

Commit

Permalink
Annotate test failures in github-actions
Browse files Browse the repository at this point in the history
  • Loading branch information
Jan Beitner committed Aug 15, 2020
1 parent ad15a30 commit 7567bc0
Show file tree
Hide file tree
Showing 3 changed files with 33 additions and 18 deletions.
12 changes: 2 additions & 10 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -57,16 +57,8 @@ jobs:

- name: Install dependencies
shell: bash
run: poetry install
run: poetry install -E "github-actions"

- name: Run pytest
shell: bash
run: poetry run pytest tests --junitxml=junit/test-results-${{ matrix.python-version }}.xml

- name: Upload test results
uses: actions/upload-artifact@v2
with:
name: pytest-results-${{ matrix.python-version }}
path: junit/test-results-${{ matrix.python-version }}.xml
# Use always() to always run this step to publish test results when there are test failures
if: ${{ always() }}
run: poetry run pytest tests
34 changes: 26 additions & 8 deletions poetry.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 5 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,8 @@ pytorch-ranger = "*"
matplotlib = "*"
cloudpickle = "*"

pytest-github-actions-annotate-failures = {version = "*", optional = true}

[tool.poetry.dev-dependencies]
# checks and make tools
invoke = "*"
Expand All @@ -72,6 +74,9 @@ black = { version = "*", allow-prereleases = true }
sphinx = "*"
m2r = "*"

[tool.poetry.extras] # extras
github-actions = ["pytest-github-actions-annotate-failures"]

[tool.poetry-dynamic-versioning]
enable = true
vcs = "git"
Expand Down

0 comments on commit 7567bc0

Please sign in to comment.