diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 00fe9f55d2..a01edb179a 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -73,8 +73,11 @@ jobs: env: LSP: '${{ matrix.lsp }}' LSP_EXTRACT_FILE: '${{ matrix.lsp_extract_file }}' - # Should match 'name:' up above - JOB_NAME: 'Windows (${{ matrix.python }}, ${{ matrix.arch }}${{ matrix.extra_name }})' + - uses: codecov/codecov-action@v3 + with: + directory: empty + name: 'Windows (${{ matrix.python }}, ${{ matrix.arch }}${{ matrix.extra_name }})' + flags: Windows,${{ matrix.python }} Ubuntu: name: 'Ubuntu (${{ matrix.python }}${{ matrix.extra_name }})' @@ -119,8 +122,11 @@ jobs: run: ./ci.sh env: CHECK_FORMATTING: '${{ matrix.check_formatting }}' - # Should match 'name:' up above - JOB_NAME: 'Ubuntu (${{ matrix.python }}${{ matrix.extra_name }})' + - uses: codecov/codecov-action@v3 + with: + directory: empty + name: 'Ubuntu (${{ matrix.python }}${{ matrix.extra_name }})' + flags: Ubuntu,${{ matrix.python }} macOS: name: 'macOS (${{ matrix.python }})' @@ -150,9 +156,11 @@ jobs: cache-dependency-path: test-requirements.txt - name: Run tests run: ./ci.sh - env: - # Should match 'name:' up above - JOB_NAME: 'macOS (${{ matrix.python }})' + - uses: codecov/codecov-action@v3 + with: + directory: empty + name: 'macOS (${{ matrix.python }})' + flags: macOS,${{ matrix.python }} # https://github.com/marketplace/actions/alls-green#why check: # This job does nothing and is only used for the branch protection diff --git a/ci.sh b/ci.sh index 3cd78cfb18..875d778487 100755 --- a/ci.sh +++ b/ci.sh @@ -6,10 +6,6 @@ set -ex -o pipefail uname -a env | sort -if [ "$JOB_NAME" = "" ]; then - JOB_NAME="${TRAVIS_OS_NAME}-${TRAVIS_PYTHON_VERSION:-unknown}" -fi - # Curl's built-in retry system is not very robust; it gives up on lots of # network errors that we want to retry on. Wget might work better, but it's # not installed on azure pipelines's windows boxes. So... let's try some good @@ -102,12 +98,8 @@ else INSTALLDIR=$(python -c "import os, trio; print(os.path.dirname(trio.__file__))") cp ../pyproject.toml $INSTALLDIR - # We have to copy .coveragerc into this directory, rather than passing - # --cov-config=../.coveragerc to pytest, because codecov.sh will run - # 'coverage xml' to generate the report that it uses, and that will only - # apply the ignore patterns in the current directory's .coveragerc. - cp ../.coveragerc . - if pytest -r a -p trio._tests.pytest_plugin --junitxml=../test-results.xml --run-slow ${INSTALLDIR} --cov="$INSTALLDIR" --verbose; then + + if pytest -r a -p trio._tests.pytest_plugin --junitxml=../test-results.xml --run-slow ${INSTALLDIR} --cov="$INSTALLDIR" --cov-report=xml --verbose; then PASSED=true else PASSED=false @@ -119,13 +111,5 @@ else netsh winsock reset fi - # The codecov docs recommend something like 'bash <(curl ...)' to pipe the - # script directly into bash as its being downloaded. But, the codecov - # server is flaky, so we instead save to a temp file with retries, and - # wait until we've successfully fetched the whole script before trying to - # run it. - curl-harder -o codecov.sh https://codecov.io/bash - bash codecov.sh -n "${JOB_NAME}" - $PASSED fi