From 889484a9c9b25c549c2a2bd83d5a2df97ffa6d05 Mon Sep 17 00:00:00 2001 From: Sorin Sbarnea Date: Fri, 9 Feb 2024 12:56:55 +0000 Subject: [PATCH] Check codecov.io status --- .github/workflows/tox.yml | 27 +++++++++++++++++++++++++++ tox.ini | 2 +- 2 files changed, 28 insertions(+), 1 deletion(-) diff --git a/.github/workflows/tox.yml b/.github/workflows/tox.yml index ee9a5ed6..8febe778 100644 --- a/.github/workflows/tox.yml +++ b/.github/workflows/tox.yml @@ -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 }}', diff --git a/tox.ini b/tox.ini index 0937eec6..703e6802 100644 --- a/tox.ini +++ b/tox.ini @@ -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 =