summary refs log tree commit diff
diff options
context:
space:
mode:
authorDavid Robertson <davidr@element.io>2022-03-14 13:10:13 +0000
committerDavid Robertson <davidr@element.io>2022-03-14 18:42:02 +0000
commit6c02e36f7f45e2b2d4997c2f7d13b390942ee3f6 (patch)
treedd5a2c7e06270df9b83dfdb417fa3946472b0689
parentaaaaaaaaaaaaaaaaaaanother (diff)
downloadsynapse-6c02e36f7f45e2b2d4997c2f7d13b390942ee3f6.tar.xz
WIP: Try to fix twisted trunk job
-rwxr-xr-x.ci/patch_for_twisted_trunk.sh14
-rw-r--r--.github/workflows/twisted_trunk.yml59
2 files changed, 43 insertions, 30 deletions
diff --git a/.ci/patch_for_twisted_trunk.sh b/.ci/patch_for_twisted_trunk.sh
index f524581986..d1c50f69f7 100755
--- a/.ci/patch_for_twisted_trunk.sh
+++ b/.ci/patch_for_twisted_trunk.sh
@@ -1,8 +1,16 @@
 #!/bin/sh
 
-# replaces the dependency on Twisted in `python_dependencies` with trunk.
+# replaces the dependency on Twisted with Twisted's trunk.
+# We make full use of the poetry machinery (rather than just `pip install ...`)
+# so that we'll catch dependency resolver problems that could arise from twisted
+# bumping its dependencies.
 
-set -e
+set -xe
 cd "$(dirname "$0")"/..
 
-sed -i -e 's#"Twisted.*"#"Twisted @ git+https://github.com/twisted/twisted"#' synapse/python_dependencies.py
+sed -ibackup -e 's!^Twisted = .*!Twisted = { git = "https://github.com/twisted/twisted.git", rev = "trunk" }!' pyproject.toml
+
+poetry lock --no-update
+poetry install --no-interaction --extras "all test"
+# Confirm the version of twisted in use
+poetry run pip show twisted
diff --git a/.github/workflows/twisted_trunk.yml b/.github/workflows/twisted_trunk.yml
index fb9d46b7bf..b31b5dd0f1 100644
--- a/.github/workflows/twisted_trunk.yml
+++ b/.github/workflows/twisted_trunk.yml
@@ -5,6 +5,11 @@ on:
     - cron: 0 8 * * *
 
   workflow_dispatch:
+  pull_request:
+
+concurrency:
+  group: ${{ github.workflow }}-${{ github.ref }}
+  cancel-in-progress: true
 
 jobs:
   mypy:
@@ -12,10 +17,12 @@ jobs:
 
     steps:
       - uses: actions/checkout@v2
-      - uses: actions/setup-python@v2
+      - uses: matrix-org/setup-python-poetry@dmr/try-extras
+        with:
+          python-version: "3.x"
+          extras: "all"
       - run: .ci/patch_for_twisted_trunk.sh
-      - run: pip install tox
-      - run: tox -e mypy
+      - run: poetry run mypy
 
   trial:
     runs-on: ubuntu-latest
@@ -23,14 +30,12 @@ jobs:
     steps:
       - uses: actions/checkout@v2
       - run: sudo apt-get -qq install xmlsec1
-      - uses: actions/setup-python@v2
+      - uses: matrix-org/setup-python-poetry@dmr/try-extras
         with:
-          python-version: 3.7
+          python-version: "3.x"
+          extras: "all test"
       - run: .ci/patch_for_twisted_trunk.sh
-      - run: pip install tox
-      - run: tox -e py
-        env:
-          TRIAL_FLAGS: "--jobs=2"
+      - run: poetry run trial --jobs 2 tests
 
       - name: Dump logs
         # Logs are most useful when the command fails, always include them.
@@ -72,21 +77,21 @@ jobs:
             /logs/results.tap
             /logs/**/*.log*
 
-  # open an issue if the build fails, so we know about it.
-  open-issue:
-    if: failure()
-    needs:
-      - mypy
-      - trial
-      - sytest
-
-    runs-on: ubuntu-latest
-
-    steps:
-      - uses: actions/checkout@v2
-      - uses: JasonEtco/create-an-issue@5d9504915f79f9cc6d791934b8ef34f2353dd74d # v2.5.0, 2020-12-06
-        env:
-          GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
-        with:
-          update_existing: true
-          filename: .ci/twisted_trunk_build_failed_issue_template.md
+#  # open an issue if the build fails, so we know about it.
+#  open-issue:
+#    if: failure()
+#    needs:
+#      - mypy
+#      - trial
+#      - sytest
+#
+#    runs-on: ubuntu-latest
+#
+#    steps:
+#      - uses: actions/checkout@v2
+#      - uses: JasonEtco/create-an-issue@5d9504915f79f9cc6d791934b8ef34f2353dd74d # v2.5.0, 2020-12-06
+#        env:
+#          GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
+#        with:
+#          update_existing: true
+#          filename: .ci/twisted_trunk_build_failed_issue_template.md