From a66495b4f1063625fbb421d35990058892c393c3 Mon Sep 17 00:00:00 2001 From: EXPLOSION Date: Mon, 29 May 2023 09:33:01 +0900 Subject: [PATCH 1/4] Try a simple replacement --- .github/workflows/ci.yml | 9 +++++++++ ci.sh | 10 +--------- 2 files changed, 10 insertions(+), 9 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 00fe9f55d2..76d968d28d 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -75,6 +75,9 @@ jobs: 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 Ubuntu: name: 'Ubuntu (${{ matrix.python }}${{ matrix.extra_name }})' @@ -121,6 +124,9 @@ jobs: 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 macOS: name: 'macOS (${{ matrix.python }})' @@ -153,6 +159,9 @@ jobs: env: # Should match 'name:' up above JOB_NAME: 'macOS (${{ matrix.python }})' + - uses: codecov/codecov-action@v3 + with: + directory: empty # 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..05cdaedc39 100755 --- a/ci.sh +++ b/ci.sh @@ -107,7 +107,7 @@ else # '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 +119,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 From ca40b5eeb23923a58f3a31937ffa0317c30dc321 Mon Sep 17 00:00:00 2001 From: EXPLOSION Date: Mon, 29 May 2023 09:53:54 +0900 Subject: [PATCH 2/4] Remove some unnecessary stuff --- .github/workflows/ci.yml | 7 ------- ci.sh | 10 +--------- 2 files changed, 1 insertion(+), 16 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 76d968d28d..cf0465c1d8 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -73,8 +73,6 @@ 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 @@ -122,8 +120,6 @@ 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 @@ -156,9 +152,6 @@ 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 diff --git a/ci.sh b/ci.sh index 05cdaedc39..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,11 +98,7 @@ 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" --cov-report=xml --verbose; then PASSED=true else From e8e63cc64d50a9ecfcf3bce752a329cc326174d0 Mon Sep 17 00:00:00 2001 From: EXPLOSION Date: Mon, 29 May 2023 16:22:13 +0900 Subject: [PATCH 3/4] Add back names to codecov uploads --- .github/workflows/ci.yml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index cf0465c1d8..f6d7c6cd5a 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -76,6 +76,7 @@ jobs: - uses: codecov/codecov-action@v3 with: directory: empty + name: 'Windows (${{ matrix.python }}, ${{ matrix.arch }}${{ matrix.extra_name }})' Ubuntu: name: 'Ubuntu (${{ matrix.python }}${{ matrix.extra_name }})' @@ -123,6 +124,7 @@ jobs: - uses: codecov/codecov-action@v3 with: directory: empty + name: 'Ubuntu (${{ matrix.python }}${{ matrix.extra_name }})' macOS: name: 'macOS (${{ matrix.python }})' @@ -155,6 +157,7 @@ jobs: - uses: codecov/codecov-action@v3 with: directory: empty + name: 'macOS (${{ matrix.python }})' # https://github.com/marketplace/actions/alls-green#why check: # This job does nothing and is only used for the branch protection From 5aabe954849492703736270d58ba9aa955a50e8e Mon Sep 17 00:00:00 2001 From: EXPLOSION Date: Mon, 29 May 2023 16:33:20 +0900 Subject: [PATCH 4/4] Add some codecov "flags" --- .github/workflows/ci.yml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index f6d7c6cd5a..a01edb179a 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -77,6 +77,7 @@ jobs: with: directory: empty name: 'Windows (${{ matrix.python }}, ${{ matrix.arch }}${{ matrix.extra_name }})' + flags: Windows,${{ matrix.python }} Ubuntu: name: 'Ubuntu (${{ matrix.python }}${{ matrix.extra_name }})' @@ -125,6 +126,7 @@ jobs: with: directory: empty name: 'Ubuntu (${{ matrix.python }}${{ matrix.extra_name }})' + flags: Ubuntu,${{ matrix.python }} macOS: name: 'macOS (${{ matrix.python }})' @@ -158,6 +160,7 @@ jobs: 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