Skip to content
This repository was archived by the owner on Apr 26, 2024. It is now read-only.

Commit d24cd17

Browse files
David RobertsonSean Quahcallahad
authored
Use poetry lockfile in twisted trunk CI job (#12425)
Fixes #12458 Co-authored-by: Sean Quah <[email protected]> Co-authored-by: Dan Callahan <[email protected]>
1 parent 36d8b83 commit d24cd17

File tree

3 files changed

+35
-20
lines changed

3 files changed

+35
-20
lines changed

.ci/patch_for_twisted_trunk.sh

Lines changed: 0 additions & 8 deletions
This file was deleted.

.github/workflows/twisted_trunk.yml

Lines changed: 34 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -6,31 +6,41 @@ on:
66

77
workflow_dispatch:
88

9+
concurrency:
10+
group: ${{ github.workflow }}-${{ github.ref }}
11+
cancel-in-progress: true
12+
913
jobs:
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,23 @@ jobs:
5565
steps:
5666
- uses: actions/checkout@v2
5767
- name: Patch dependencies
58-
run: .ci/patch_for_twisted_trunk.sh
68+
# Note: The poetry commands want to create a virtualenv in /src/.venv/,
69+
# but the sytest-synapse container expects it to be in /venv/.
70+
# We symlink it before running poetry so that poetry actually
71+
# ends up installing to `/venv`.
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"
5977
working-directory: /src
6078
- name: Run SyTest
6179
run: /bootstrap.sh synapse
6280
working-directory: /src
81+
env:
82+
# Use offline mode to avoid reinstalling the pinned version of
83+
# twisted.
84+
OFFLINE: 1
6385
- name: Summarise results.tap
6486
if: ${{ always() }}
6587
run: /sytest/scripts/tap_to_gha.pl /logs/results.tap

changelog.d/12425.misc

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Run twisted trunk CI job in the locked poetry environment.

0 commit comments

Comments
 (0)