diff options
author | Anderson Bravalheri <andersonbravalheri@gmail.com> | 2022-11-11 10:51:58 +0000 |
---|---|---|
committer | Anderson Bravalheri <andersonbravalheri@gmail.com> | 2022-11-11 10:51:58 +0000 |
commit | 500840ddfaae59262f62b8ff96a6ff9a595c69eb (patch) | |
tree | 92fa0dfa8dd1087ef91dd1d7de7b91437b822107 | |
parent | 8233377eb40137c5198a9dbeda324429ba4c68e9 (diff) | |
parent | 16e49c950c93a29627828c82427fe0fd9731213c (diff) | |
download | python-setuptools-git-500840ddfaae59262f62b8ff96a6ff9a595c69eb.tar.gz |
Report coverage from Cygwin jobs (#3642)
-rw-r--r-- | .github/workflows/main.yml | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 4560939f..a877b765 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -142,11 +142,37 @@ jobs: python${{ matrix.python }}-tox, gcc-core, git, + - name: Record the currently selected Python version + id: python-install + # NOTE: This roughly emulates what `actions/setup-python@v4` provides + # NOTE: except the action gets the version from the installation path + # NOTE: on disk and we get it from runtime. + run: | + python -c 'import platform; print("python-version=" + platform.python_version())' >> ${GITHUB_OUTPUT} + shell: C:\cygwin\bin\env.exe CYGWIN_NOWINPATH=1 CHERE_INVOKING=1 C:\cygwin\bin\bash.exe -leo pipefail -o igncr {0} - name: Run tests shell: C:\cygwin\bin\env.exe CYGWIN_NOWINPATH=1 CHERE_INVOKING=1 C:\cygwin\bin\bash.exe -leo pipefail -o igncr {0} run: | git config --global --add safe.directory "$(cygpath -u "$GITHUB_WORKSPACE")" # workaround for #3408 tox + - name: Create coverage report + if: hashFiles('.coverage') != '' # Rudimentary `file.exists()` + run: | + python -m pip install coverage + python -m coverage xml --ignore-errors + shell: C:\cygwin\bin\env.exe CYGWIN_NOWINPATH=1 CHERE_INVOKING=1 C:\cygwin\bin\bash.exe -leo pipefail -o igncr {0} + - name: Publish coverage + if: hashFiles('coverage.xml') != '' # Rudimentary `file.exists()` + uses: codecov/codecov-action@v3 + with: + files: >- + ${{ github.workspace }}\coverage.xml + flags: >- # Mark which lines are covered by which envs + CI-GHA, + ${{ github.job }}, + OS-${{ runner.os }}, + VM-${{ matrix.platform }}, + Py-${{ steps.python-install.outputs.python-version }} integration-test: needs: test |