Skip to content

Commit

Permalink
Check codecov.io status
Browse files Browse the repository at this point in the history
  • Loading branch information
ssbarnea committed Feb 9, 2024
1 parent 66ee464 commit 889484a
Show file tree
Hide file tree
Showing 2 changed files with 28 additions and 1 deletion.
27 changes: 27 additions & 0 deletions .github/workflows/tox.yml
Original file line number Diff line number Diff line change
Expand Up @@ -63,10 +63,37 @@ jobs:
continue-on-error: ${{ matrix.devel || false }}
run: python3 -m tox -e ${{ matrix.passed_name }}

- name: Upload coverage data
if: ${{ startsWith(matrix.passed_name, 'py') }}
uses: codecov/codecov-action@v3
with:
name: ${{ matrix.passed_name }}
token: ${{ secrets.CODECOV_TOKEN }}
verbose: true # optional (default = false)

- name: Archive logs
uses: actions/upload-artifact@v4
with:
name: logs-${{ matrix.name }}.zip
path: .tox/**/log/

- name: Report failure if git reports dirty status
run: |
if [[ -n $(git status -s) ]]; then
# shellcheck disable=SC2016
echo -n '::error file=git-status::'
printf '### Failed as git reported modified and/or untracked files\n```\n%s\n```\n' "$(git status -s)" | tee -a "$GITHUB_STEP_SUMMARY"
exit 99
fi
# https://github.com/actions/toolkit/issues/193
tox_passed:
needs: tox
runs-on: ubuntu-latest
steps:

- name: Check codecov.io status
uses: coactions/codecov-status@main

- run: >-
python -c "assert set([
'${{ needs.tox.result }}',
Expand Down
2 changes: 1 addition & 1 deletion tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ set_env =
PRE_COMMIT_COLOR = always
TERM = xterm-256color
commands =
coverage run --debug=trace -m pytest {posargs}
coverage run -m pytest {posargs}
sh -c "coverage combine -q .tox/.coverage.* && coverage xml || true && coverage report"
git diff --exit-code
allowlist_externals =
Expand Down

0 comments on commit 889484a

Please sign in to comment.