Skip to content

Commit

Permalink
Merge 37f9a03 into a360a8a
Browse files Browse the repository at this point in the history
  • Loading branch information
adiroiban committed Mar 30, 2021
2 parents a360a8a + 37f9a03 commit 44ee760
Show file tree
Hide file tree
Showing 2 changed files with 49 additions and 26 deletions.
75 changes: 49 additions & 26 deletions .github/workflows/test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,13 @@ jobs:
testing:
runs-on: ubuntu-20.04
env:
TOXENV: "${{ matrix.tox-env }}"
CODECOV_OPTIONS: "-n 'lnx-${{ matrix.python-version }}-${{ matrix.tox-env }}${{ matrix.noipv6 }}'"
TRIAL_ARGS: "${{ matrix.trial-args }}"
name: ${{ matrix.python-version }}${{ matrix.noipv6 }}-${{ matrix.tox-env }}
TWISTED_REACTOR: default
CODECOV_OPTIONS: "-n 'lnx-${{ matrix.python-version }}-${{ matrix.deps_extras }}${{ matrix.noipv6 }}'"
# As of 9 March 2021 GHA VM have 2 CPUs - Azure Standard_DS2_v2
# Trial distributed jobs enabled to speed up the CI jobs.
TRIAL_ARGS: "-j 4"
DEPS_EXTRAS: "${{ matrix.deps_extras }}"
name: ${{ matrix.python-version }}${{ matrix.noipv6 }}-${{ matrix.deps_extras }}
strategy:
fail-fast: false
matrix:
Expand All @@ -32,11 +35,9 @@ jobs:
# `python_requires` from `setup.cfg`.
# Run on latest minor release of each major python version.
python-version: [3.6, 3.7, 3.8, 3.9, 3.10.0-alpha.5]
tox-env: ['alldeps-withcov-posix']
noipv6: ['']
# As of 9 March 2021 GHA VM have 2 CPUs - Azure Standard_DS2_v2
# Trial distributed jobs enabled to speed up the CI jobs.
trial-args: ['-j 4']
deps_extras: ['all_non_platform,dev_release']
skip_coverage: [false]

include:

Expand All @@ -47,22 +48,23 @@ jobs:
# Distributed test run is disabled here so that we also have
# end to end functional test usage for non-distributed trial runs.
- python-version: 3.6.7
tox-env: nodeps-withcov-posix
trial-args: ''
deps_extras: 'test'
# `noipv6` is created to make sure all is OK on an OS which doesn't
# have IPv6 available.
# Any supported Python version is OK for this job.
- python-version: 3.6
tox-env: alldeps-withcov-posix
deps_extras: 'all_non_platform,dev_release'
noipv6: -noipv6
# On PYPY concurrent test jobs result in random failures so for now
# run non-distributed tests.

# On PYPY there is no coverage extension, so coverage tests are
# super slow.
- python-version: pypy-3.6
tox-env: alldeps-withcov-posix
trial-args:
deps_extras: 'all_non_platform,dev_release'
skip_coverage: true

- python-version: pypy-3.7
tox-env: alldeps-withcov-posix
trial-args:
deps_extras: 'all_non_platform,dev_release'
skip_coverage: true


steps:
Expand Down Expand Up @@ -96,22 +98,43 @@ jobs:
sudo sysctl -w net.ipv6.conf.lo.disable_ipv6=1
ip a
- uses: twisted/python-info-action@v1
- name: Install dependencies
run: |
python -m pip install --upgrade pip tox
tox --notest
python -m pip install --upgrade pip codecov~=2.1 coveralls
python -m pip install .[$DEPS_EXTRAS]
- name: Test
- uses: twisted/python-info-action@v1

- name: Test without coverage
if: matrix.skip_coverage
run: |
python --version
tox -q
python -m twisted.trial \
--reactor=$TWISTED_REACTOR \
--reporter=verbose $TRIAL_ARGS \
twisted
- name: Publish coverage
- name: Test with coverage
if: ${{ !matrix.skip_coverage }}
run: |
coverage erase
coverage run -p --rcfile=.coveragerc \
-m twisted.trial \
--reactor=$TWISTED_REACTOR \
--reporter=verbose $TRIAL_ARGS \
twisted
- name: Prepare coverage
# We want to publish coverage even on failure.
if: contains(matrix['tox-env'], 'withcov') || failure()
run: tox -e coverage-prepare,codecov-push,coveralls-push
if: ${{ !matrix.skip_coverage && (success() || failure()) }}
run: |
coverage combine
coverage xml -o coverage.xml -i
- name: Publish coverage
# We want to publish coverage even on failure.
if: ${{ !matrix.skip_coverage && (success() || failure()) }}
run: |
codecov $CODECOV_OPTIONS -f coverage.xml
pypi-publish:
# https://github.community/t/is-it-possible-to-require-all-github-actions-tasks-to-pass-without-enumerating-them/117957/4?u=graingert
Expand Down
Empty file.

0 comments on commit 44ee760

Please sign in to comment.