Skip to content
Snippets Groups Projects
Unverified Commit d24cd178 authored by David Robertson's avatar David Robertson Committed by GitHub
Browse files

Use poetry lockfile in twisted trunk CI job (#12425)


Fixes #12458

Co-authored-by: default avatarSean Quah <seanq@element.io>
Co-authored-by: default avatarDan Callahan <danc@element.io>
parent 36d8b838
No related branches found
No related tags found
No related merge requests found
#!/bin/sh
# replaces the dependency on Twisted in `python_dependencies` with trunk.
set -e
cd "$(dirname "$0")"/..
sed -i -e 's#"Twisted.*"#"Twisted @ git+https://github.com/twisted/twisted"#' synapse/python_dependencies.py
...@@ -6,16 +6,25 @@ on: ...@@ -6,16 +6,25 @@ on:
workflow_dispatch: workflow_dispatch:
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs: jobs:
mypy: mypy:
runs-on: ubuntu-latest runs-on: ubuntu-latest
steps: steps:
- uses: actions/checkout@v2 - uses: actions/checkout@v2
- uses: actions/setup-python@v2 - uses: matrix-org/setup-python-poetry@v1
- run: .ci/patch_for_twisted_trunk.sh with:
- run: pip install tox python-version: "3.x"
- run: tox -e mypy extras: "all"
- run: |
poetry remove twisted
poetry add --extras tls git+https://github.com/twisted/twisted.git#trunk
poetry install --no-interaction --extras "all test"
- run: poetry run mypy
trial: trial:
runs-on: ubuntu-latest runs-on: ubuntu-latest
...@@ -23,14 +32,15 @@ jobs: ...@@ -23,14 +32,15 @@ jobs:
steps: steps:
- uses: actions/checkout@v2 - uses: actions/checkout@v2
- run: sudo apt-get -qq install xmlsec1 - run: sudo apt-get -qq install xmlsec1
- uses: actions/setup-python@v2 - uses: matrix-org/setup-python-poetry@v1
with: with:
python-version: 3.7 python-version: "3.x"
- run: .ci/patch_for_twisted_trunk.sh extras: "all test"
- run: pip install tox - run: |
- run: tox -e py poetry remove twisted
env: poetry add --extras tls git+https://github.com/twisted/twisted.git#trunk
TRIAL_FLAGS: "--jobs=2" poetry install --no-interaction --extras "all test"
- run: poetry run trial --jobs 2 tests
- name: Dump logs - name: Dump logs
# Logs are most useful when the command fails, always include them. # Logs are most useful when the command fails, always include them.
...@@ -55,11 +65,23 @@ jobs: ...@@ -55,11 +65,23 @@ jobs:
steps: steps:
- uses: actions/checkout@v2 - uses: actions/checkout@v2
- name: Patch dependencies - name: Patch dependencies
run: .ci/patch_for_twisted_trunk.sh # Note: The poetry commands want to create a virtualenv in /src/.venv/,
# but the sytest-synapse container expects it to be in /venv/.
# We symlink it before running poetry so that poetry actually
# ends up installing to `/venv`.
run: |
ln -s -T /venv /src/.venv
poetry remove twisted
poetry add --extras tls git+https://github.com/twisted/twisted.git#trunk
poetry install --no-interaction --extras "all test"
working-directory: /src working-directory: /src
- name: Run SyTest - name: Run SyTest
run: /bootstrap.sh synapse run: /bootstrap.sh synapse
working-directory: /src working-directory: /src
env:
# Use offline mode to avoid reinstalling the pinned version of
# twisted.
OFFLINE: 1
- name: Summarise results.tap - name: Summarise results.tap
if: ${{ always() }} if: ${{ always() }}
run: /sytest/scripts/tap_to_gha.pl /logs/results.tap run: /sytest/scripts/tap_to_gha.pl /logs/results.tap
......
Run twisted trunk CI job in the locked poetry environment.
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment