summary refs log tree commit diff
path: root/.github/workflows
diff options
context:
space:
mode:
authorPatrick Cloke <clokep@users.noreply.github.com>2023-01-31 08:00:07 -0500
committerGitHub <noreply@github.com>2023-01-31 08:00:07 -0500
commit585180594b19920f0c4bc53599053c42c40d6511 (patch)
tree7593c289b41e1f93891b4c2519a503b3b8cc350e /.github/workflows
parentTag /send_join responses to detect faster joins (#14950) (diff)
downloadsynapse-585180594b19920f0c4bc53599053c42c40d6511.tar.xz
Fix running cargo bench & test in CI. (#14943)
Diffstat (limited to '.github/workflows')
-rw-r--r--.github/workflows/tests.yml25
1 files changed, 25 insertions, 0 deletions
diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml
index 28fc6d45e6..f184727ced 100644
--- a/.github/workflows/tests.yml
+++ b/.github/workflows/tests.yml
@@ -566,6 +566,29 @@ jobs:
 
       - run: cargo test
 
+  # We want to ensure that the cargo benchmarks still compile, which requires a
+  # nightly compiler.
+  cargo-bench:
+    if: ${{ needs.changes.outputs.rust == 'true' }}
+    runs-on: ubuntu-latest
+    needs:
+      - linting-done
+      - changes
+
+    steps:
+      - uses: actions/checkout@v3
+
+      - name: Install Rust
+        # There don't seem to be versioned releases of this action per se: for each rust
+        # version there is a branch which gets constantly rebased on top of master.
+        # We pin to a specific commit for paranoia's sake.
+        uses: dtolnay/rust-toolchain@e645b0cf01249a964ec099494d38d2da0f0b349f
+        with:
+            toolchain: nightly-2022-12-01
+      - uses: Swatinem/rust-cache@v2
+
+      - run: cargo bench --no-run
+
   # a job which marks all the other jobs as complete, thus allowing PRs to be merged.
   tests-done:
     if: ${{ always() }}
@@ -577,6 +600,7 @@ jobs:
       - portdb
       - complement
       - cargo-test
+      - cargo-bench
     runs-on: ubuntu-latest
     steps:
       - uses: matrix-org/done-action@v2
@@ -588,3 +612,4 @@ jobs:
           skippable: |
             lint-newsfile
             cargo-test
+            cargo-bench