Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 15 additions & 7 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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 }})'
Expand Down Expand Up @@ -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 }})'
Expand Down Expand Up @@ -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
Expand Down
20 changes: 2 additions & 18 deletions ci.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand All @@ -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