66
77 workflow_dispatch :
88
9+ concurrency :
10+ group : ${{ github.workflow }}-${{ github.ref }}
11+ cancel-in-progress : true
12+
913jobs :
1014 mypy :
1115 runs-on : ubuntu-latest
1216
1317 steps :
1418 - uses : actions/checkout@v2
15- - uses : actions/setup-python@v2
16- - run : .ci/patch_for_twisted_trunk.sh
17- - run : pip install tox
18- - run : tox -e mypy
19+ - uses : matrix-org/setup-python-poetry@v1
20+ with :
21+ python-version : " 3.x"
22+ extras : " all"
23+ - run : |
24+ poetry remove twisted
25+ poetry add --extras tls git+https://github.com/twisted/twisted.git#trunk
26+ poetry install --no-interaction --extras "all test"
27+ - run : poetry run mypy
1928
2029 trial :
2130 runs-on : ubuntu-latest
2231
2332 steps :
2433 - uses : actions/checkout@v2
2534 - run : sudo apt-get -qq install xmlsec1
26- - uses : actions /setup-python@v2
35+ - uses : matrix-org /setup-python-poetry@v1
2736 with :
28- python-version : 3.7
29- - run : .ci/patch_for_twisted_trunk.sh
30- - run : pip install tox
31- - run : tox -e py
32- env :
33- TRIAL_FLAGS : " --jobs=2"
37+ python-version : " 3.x"
38+ extras : " all test"
39+ - run : |
40+ poetry remove twisted
41+ poetry add --extras tls git+https://github.com/twisted/twisted.git#trunk
42+ poetry install --no-interaction --extras "all test"
43+ - run : poetry run trial --jobs 2 tests
3444
3545 - name : Dump logs
3646 # Logs are most useful when the command fails, always include them.
@@ -55,11 +65,24 @@ jobs:
5565 steps :
5666 - uses : actions/checkout@v2
5767 - name : Patch dependencies
58- run : .ci/patch_for_twisted_trunk.sh
68+ # Note: The script below runs poetry against a virtualenv in /src/.venv/
69+ # ...but the sytest-synapse container expects it to be in /venv/
70+ # So we temporarily symlink it, run poetry, then remove the link.
71+ # Tidying up is important because `/src` is a mounted volume.
72+ run : |
73+ ln -s -T /venv /src/.venv
74+ poetry remove twisted
75+ poetry add --extras tls git+https://github.com/twisted/twisted.git#trunk
76+ poetry install --no-interaction --extras "all test"
77+ rm /src/.venv
5978 working-directory : /src
6079 - name : Run SyTest
6180 run : /bootstrap.sh synapse
6281 working-directory : /src
82+ env :
83+ # Use offline mode to avoid reinstalling the pinned version of
84+ # twisted.
85+ OFFLINE : 1
6386 - name : Summarise results.tap
6487 if : ${{ always() }}
6588 run : /sytest/scripts/tap_to_gha.pl /logs/results.tap
0 commit comments