Files
synapse/.github/workflows/complement_tests.yml
T
dependabot[bot] a61ce0cfd4 Bump the all-github-actions group across 1 directory with 3 updates (#20269)
Bumps the all-github-actions group with 3 updates in the / directory:
[dtolnay/rust-toolchain](https://github.com/dtolnay/rust-toolchain),
[tailscale/github-action](https://github.com/tailscale/github-action)
and
[marocchino/sticky-pull-request-comment](https://github.com/marocchino/sticky-pull-request-comment).

Updates `dtolnay/rust-toolchain` from
6c977a6ca4077a0ceb28ffbe03f59d46e9ac8772 to
02cb101ec7c40f2c49e1d9714d64511d8e1b74de
<details>
<summary>Commits</summary>
<ul>
<li><a
href="https://github.com/dtolnay/rust-toolchain/commit/02cb101ec7c40f2c49e1d9714d64511d8e1b74de"><code>02cb101</code></a>
Merge pull request 185 from fufesou/feat/force-non-host</li>
<li><a
href="https://github.com/dtolnay/rust-toolchain/commit/b38a663c5df0fd5ac7bb65ded7b02a3f7af3b636"><code>b38a663</code></a>
Pass --force-non-host unconditionally</li>
<li><a
href="https://github.com/dtolnay/rust-toolchain/commit/a4f61a09a512763ecbf6a72db0464f906f59f011"><code>a4f61a0</code></a>
Document rustup non-host opt-in requirement</li>
<li><a
href="https://github.com/dtolnay/rust-toolchain/commit/06b350f08c8596edaf3d95d38686ba934fc4a6a7"><code>06b350f</code></a>
Support force-non-host toolchains</li>
<li><a
href="https://github.com/dtolnay/rust-toolchain/commit/d1031067263f94b142dd6c0ce24c5eb9d02d52a0"><code>d103106</code></a>
Predefine branches up to 1.120</li>
<li><a
href="https://github.com/dtolnay/rust-toolchain/commit/3ea7b2dde9987cecfa88322de1f09983972fc8e9"><code>3ea7b2d</code></a>
Add 1.98.1 patch release</li>
<li>See full diff in <a
href="https://github.com/dtolnay/rust-toolchain/compare/6c977a6ca4077a0ceb28ffbe03f59d46e9ac8772...02cb101ec7c40f2c49e1d9714d64511d8e1b74de">compare
view</a></li>
</ul>
</details>
<br />

Updates `tailscale/github-action` from 4.1.3 to 4.2.0
<details>
<summary>Release notes</summary>
<p><em>Sourced from <a
href="https://github.com/tailscale/github-action/releases">tailscale/github-action's
releases</a>.</em></p>
<blockquote>
<h2>v4.2.0</h2>
<h2>What's Changed</h2>
<ul>
<li>feat: implement log grouping for better output by <a
href="https://github.com/jaxxstorm"><code>@​jaxxstorm</code></a> in <a
href="https://redirect.github.com/tailscale/github-action/pull/304">tailscale/github-action#304</a></li>
<li>fix: reuse stale tailscale.tgz on self-hosted runners by <a
href="https://github.com/TowyTowy"><code>@​TowyTowy</code></a> in <a
href="https://redirect.github.com/tailscale/github-action/pull/305">tailscale/github-action#305</a></li>
<li>Bump typescript from 5.9.3 to 6.0.3 by <a
href="https://github.com/dependabot"><code>@​dependabot</code></a>[bot]
in <a
href="https://redirect.github.com/tailscale/github-action/pull/298">tailscale/github-action#298</a></li>
<li>Bump actions/setup-node from 6.4.0 to 7.0.0 by <a
href="https://github.com/dependabot"><code>@​dependabot</code></a>[bot]
in <a
href="https://redirect.github.com/tailscale/github-action/pull/312">tailscale/github-action#312</a></li>
<li>Bump actions/checkout from 7.0.0 to 7.0.1 by <a
href="https://github.com/dependabot"><code>@​dependabot</code></a>[bot]
in <a
href="https://redirect.github.com/tailscale/github-action/pull/314">tailscale/github-action#314</a></li>
</ul>
<h2>New Contributors</h2>
<ul>
<li><a href="https://github.com/TowyTowy"><code>@​TowyTowy</code></a>
made their first contribution in <a
href="https://redirect.github.com/tailscale/github-action/pull/305">tailscale/github-action#305</a></li>
</ul>
<p><strong>Full Changelog</strong>: <a
href="https://github.com/tailscale/github-action/compare/v4.1.3...v4.2.0">https://github.com/tailscale/github-action/compare/v4.1.3...v4.2.0</a></p>
</blockquote>
</details>
<details>
<summary>Commits</summary>
<ul>
<li><a
href="https://github.com/tailscale/github-action/commit/d1b6cd204f8dceda5b3eaad7f1f767be390056cd"><code>d1b6cd2</code></a>
Merge pull request <a
href="https://redirect.github.com/tailscale/github-action/issues/314">#314</a>
from tailscale/dependabot/github_actions/actions/chec...</li>
<li><a
href="https://github.com/tailscale/github-action/commit/f2a4d7820e0a2fa1d2809136f7b5ec81a830d240"><code>f2a4d78</code></a>
Bump actions/checkout from 7.0.0 to 7.0.1</li>
<li><a
href="https://github.com/tailscale/github-action/commit/a122c3446c6d6e2762acc44da35fe65bc3deac1e"><code>a122c34</code></a>
Merge pull request <a
href="https://redirect.github.com/tailscale/github-action/issues/312">#312</a>
from tailscale/dependabot/github_actions/actions/setu...</li>
<li><a
href="https://github.com/tailscale/github-action/commit/55d86933927ed94902b2dd7d32fdfab60c629390"><code>55d8693</code></a>
Bump actions/setup-node from 6.4.0 to 7.0.0</li>
<li><a
href="https://github.com/tailscale/github-action/commit/546937c0d1ff12317e57f889368e81a01fcacb7f"><code>546937c</code></a>
Bump typescript from 5.9.3 to 6.0.3</li>
<li><a
href="https://github.com/tailscale/github-action/commit/0e42fa1ff301a540c9bb9a654695f05e783f05ee"><code>0e42fa1</code></a>
fix: reuse stale tailscale.tgz on self-hosted runners</li>
<li><a
href="https://github.com/tailscale/github-action/commit/508737e1960abaf049b2ca9e6519b8b4291dbf2d"><code>508737e</code></a>
Merge pull request <a
href="https://redirect.github.com/tailscale/github-action/issues/304">#304</a>
from tailscale/log_groups</li>
<li><a
href="https://github.com/tailscale/github-action/commit/5a0d794b306ae171006afad4c14e0ce74d4a8dfe"><code>5a0d794</code></a>
extract logging function into its own class</li>
<li><a
href="https://github.com/tailscale/github-action/commit/ba16990ca09b5f745b03ed05e83b66a722996df7"><code>ba16990</code></a>
catch errors</li>
<li><a
href="https://github.com/tailscale/github-action/commit/191eb01caf1fad37292ad6ffc39136ca24700f9f"><code>191eb01</code></a>
build</li>
<li>Additional commits viewable in <a
href="https://github.com/tailscale/github-action/compare/780049a30b6ff5c378a9e7b389d15ece7a204888...d1b6cd204f8dceda5b3eaad7f1f767be390056cd">compare
view</a></li>
</ul>
</details>
<br />

Updates `marocchino/sticky-pull-request-comment` from
3d7b8546315c63df45a03981d50a43ec19237f80 to
28ad303d6acb4ccfc50f20c0044188e7e294b8c4
<details>
<summary>Commits</summary>
<ul>
<li><a
href="https://github.com/marocchino/sticky-pull-request-comment/commit/28ad303d6acb4ccfc50f20c0044188e7e294b8c4"><code>28ad303</code></a>
build(deps-dev): Bump <code>@​types/node</code> from 26.1.1 to 26.3.0
(<a
href="https://redirect.github.com/marocchino/sticky-pull-request-comment/issues/1757">#1757</a>)</li>
<li><a
href="https://github.com/marocchino/sticky-pull-request-comment/commit/e17452d56eb060f9ebca915e13b64f051a2fc6aa"><code>e17452d</code></a>
build(deps-dev): Bump vitest from 4.1.10 to 4.1.11 (<a
href="https://redirect.github.com/marocchino/sticky-pull-request-comment/issues/1753">#1753</a>)</li>
<li>See full diff in <a
href="https://github.com/marocchino/sticky-pull-request-comment/compare/3d7b8546315c63df45a03981d50a43ec19237f80...28ad303d6acb4ccfc50f20c0044188e7e294b8c4">compare
view</a></li>
</ul>
</details>
<br />

<details>
<summary>Most Recent Ignore Conditions Applied to This Pull
Request</summary>

| Dependency Name | Ignore Conditions |
| --- | --- |
| dtolnay/rust-toolchain | [> 1.66.0] |
</details>

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2026-09-25 13:08:42 +01:00

213 lines
11 KiB
YAML

# Re-usable workflow (https://docs.github.com/en/actions/how-tos/reuse-automations/reuse-workflows)
name: Reusable Complement testing
on:
workflow_call:
inputs:
use_latest_deps:
type: boolean
default: false
use_twisted_trunk:
type: boolean
default: false
# Control the permissions granted to `GITHUB_TOKEN`.
permissions:
# `actions/checkout` reads the repository (also see
# https://github.com/actions/checkout/tree/de0fac2e4500dabe0009e67214ff5f5447ce83dd/#recommended-permissions)
contents: read
env:
RUST_VERSION: 1.87.0
jobs:
complement:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
include:
- arrangement: monolith
database: SQLite
- arrangement: monolith
database: Postgres
- arrangement: workers
database: Postgres
steps:
- name: Checkout synapse codebase
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
path: synapse
# Log Docker system info for debugging (compare with your local environment) and
# tracking GitHub runner changes over time (can easily compare a run from last
# week with the current one in question).
- run: docker system info
shell: bash
- name: Install Rust
uses: dtolnay/rust-toolchain@02cb101ec7c40f2c49e1d9714d64511d8e1b74de # master
with:
toolchain: ${{ env.RUST_VERSION }}
- uses: Swatinem/rust-cache@6323deb102c322ba6fcbdcafc7e3dddab59af2b6 # v2.9.2
# We use `poetry` in `complement.sh`
- uses: matrix-org/setup-python-poetry@5bbf6603c5c930615ec8a29f1b5d7d258d905aa4 # v2.0.0
with:
poetry-version: "2.4.1"
# Matches the `path` where we checkout Synapse above
working-directory: "synapse"
- name: Prepare Complement's Prerequisites
run: synapse/.ci/scripts/setup_complement_prerequisites.sh
- uses: actions/setup-go@b7ad1dad31e06c5925ef5d2fc7ad053ef454303e # v7.0.0
with:
cache-dependency-path: complement/go.sum
go-version-file: complement/go.mod
# This step is specific to the 'Twisted trunk' test run:
- name: Patch dependencies
if: ${{ inputs.use_twisted_trunk }}
run: |
set -x
DEBIAN_FRONTEND=noninteractive sudo apt-get install -yqq python3 pipx
pipx install poetry==2.4.1
poetry remove -n twisted
poetry add -n --extras tls git+https://github.com/twisted/twisted.git#trunk
poetry lock
working-directory: synapse
# Run the image sanity check test first as this is the first thing we want to know
# about (are we actually testing what we expect?) and we don't want to debug
# downstream failures (wild goose chase).
- name: Sanity check Complement image
id: run_sanity_check_complement_image_test
# -p=1: We're using `-p 1` to force the test packages to run serially as GHA boxes
# are underpowered and don't like running tons of Synapse instances at once.
# -json: Output JSON format so that gotestfmt can parse it.
#
# tee /tmp/gotest-sanity-check-complement.log: We tee the raw JSON to a
# file so we can re-process it later for better formatting with gotestfmt
# (and upload it as an artifact).
#
# We deliberately do not dump the raw JSON to the terminal as it is huge
# and unreadable. Instead we pipe it through `jq` to print a compact,
# real-time progress view: for each `go test -json` event we print only
# completed tests (`pass`/`skip`/`fail`, including subtests), dropping the
# noisy `run`/`output` events and package-level lines. The full detail
# lives in the raw log we tee to the file above. Non-JSON lines (e.g. the
# image build output and `set -x` traces that `go test -json` does not
# wrap) are passed through unchanged rather than parsed, so we still see
# them and the filter never aborts the pipeline.
run: |
set -o pipefail
COMPLEMENT_DIR=`pwd`/complement synapse/scripts-dev/complement.sh --in-repo -p 1 -json -run 'TestSynapseVersion/Synapse_version_matches_current_git_checkout' 2>&1 \
| tee /tmp/gotest-sanity-check-complement.log \
| jq -rR --unbuffered '. as $raw | (try fromjson catch $raw) | if type == "object" then (select(.Action=="pass" or .Action=="fail" or .Action=="skip") | select(.Test) | "\(.Action|ascii_upcase) \(.Test) \(.Elapsed)s") else $raw end'
shell: bash
env:
POSTGRES: ${{ (matrix.database == 'Postgres') && 1 || '' }}
WORKERS: ${{ (matrix.arrangement == 'workers') && 1 || '' }}
- name: Formatted sanity check Complement test logs
# Always run this step if we attempted to run the Complement tests.
if: always() && steps.run_sanity_check_complement_image_test.outcome != 'skipped'
# We do not hide successful tests in `gotestfmt` here as the list of sanity
# check tests is so short. Feel free to change this when we get more tests.
#
# Note that the `-hide` argument is interpreted by `gotestfmt`. From it,
# it derives several values under `$settings` and passes them to our
# custom `.ci/complement_package.gotpl` template to render the output.
run: cat /tmp/gotest-sanity-check-complement.log | gotestfmt -hide "successful-downloads,empty-packages"
- name: Run Complement Tests
id: run_complement_tests
# -p=1: We're using `-p 1` to force the test packages to run serially as GHA boxes
# are underpowered and don't like running tons of Synapse instances at once.
# -json: Output JSON format so that gotestfmt can parse it.
#
# tee /tmp/gotest-complement.log: We tee the raw JSON to a file so we can
# re-process it later for better formatting with gotestfmt (and upload it
# as an artifact), and pipe it through `jq` for a compact, real-time
# progress view. See the sanity check step above for details on the jq
# filter.
run: |
set -o pipefail
COMPLEMENT_DIR=`pwd`/complement synapse/scripts-dev/complement.sh -p 1 -json 2>&1 \
| tee /tmp/gotest-complement.log \
| jq -rR --unbuffered '. as $raw | (try fromjson catch $raw) | if type == "object" then (select(.Action=="pass" or .Action=="fail" or .Action=="skip") | select(.Test) | "\(.Action|ascii_upcase) \(.Test) \(.Elapsed)s") else $raw end'
shell: bash
env:
POSTGRES: ${{ (matrix.database == 'Postgres') && 1 || '' }}
WORKERS: ${{ (matrix.arrangement == 'workers') && 1 || '' }}
TEST_ONLY_IGNORE_POETRY_LOCKFILE: ${{ inputs.use_latest_deps && 1 || '' }}
TEST_ONLY_SKIP_DEP_HASH_VERIFICATION: ${{ inputs.use_twisted_trunk && 1 || '' }}
- name: Formatted Complement test logs (only failing are shown)
# Always run this step if we attempted to run the Complement tests.
if: always() && steps.run_complement_tests.outcome != 'skipped'
# Hide successful tests in order to reduce the verbosity of the otherwise very large output.
#
# Note that the `-hide` argument is interpreted by `gotestfmt`. From it,
# it derives several values under `$settings` and passes them to our
# custom `.ci/complement_package.gotpl` template to render the output.
run: cat /tmp/gotest-complement.log | gotestfmt -hide "successful-downloads,successful-tests,empty-packages"
- name: Run in-repo Complement Tests
# Always run as long as we attempted to run the original Complement tests.
# This lets us get a status report on the in-repo tests, even if the
# standard Complement test suite fails.
if: always() && steps.run_complement_tests.outcome != 'skipped'
id: run_in_repo_complement_tests
# -p=1: We're using `-p 1` to force the test packages to run serially as GHA boxes
# are underpowered and don't like running tons of Synapse instances at once.
# -json: Output JSON format so that gotestfmt can parse it.
#
# tee /tmp/gotest-in-repo-complement.log: We tee the raw JSON to a file so
# we can re-process it later for better formatting with gotestfmt (and
# upload it as an artifact), and pipe it through `jq` for a compact,
# real-time progress view. See the sanity check step above for details on
# the jq filter.
run: |
set -o pipefail
COMPLEMENT_DIR=`pwd`/complement synapse/scripts-dev/complement.sh --in-repo -p 1 -json 2>&1 \
| tee /tmp/gotest-in-repo-complement.log \
| jq -rR --unbuffered '. as $raw | (try fromjson catch $raw) | if type == "object" then (select(.Action=="pass" or .Action=="fail" or .Action=="skip") | select(.Test) | "\(.Action|ascii_upcase) \(.Test) \(.Elapsed)s") else $raw end'
shell: bash
env:
POSTGRES: ${{ (matrix.database == 'Postgres') && 1 || '' }}
WORKERS: ${{ (matrix.arrangement == 'workers') && 1 || '' }}
TEST_ONLY_IGNORE_POETRY_LOCKFILE: ${{ inputs.use_latest_deps && 1 || '' }}
TEST_ONLY_SKIP_DEP_HASH_VERIFICATION: ${{ inputs.use_twisted_trunk && 1 || '' }}
- name: Formatted in-repo Complement test logs (only failing are shown)
# Always run this step if we attempted to run the Complement tests.
if: always() && steps.run_in_repo_complement_tests.outcome != 'skipped'
# Hide successful tests in order to reduce the verbosity of the otherwise very large output.
#
# Note that the `-hide` argument is interpreted by `gotestfmt`. From it,
# it derives several values under `$settings` and passes them to our
# custom `.ci/complement_package.gotpl` template to render the output.
run: cat /tmp/gotest-in-repo-complement.log | gotestfmt -hide "successful-downloads,successful-tests,empty-packages"
- name: Upload Complement logs
# Always upload the logs (as artifacts) if we attempted to run the
# Complement tests, so we can debug failures without scrolling through
# the (very large) raw output in the build log.
uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1
if: ${{ always() }}
with:
# The matrix values keep the name unique across the three matrix
# combinations (upload-artifact rejects duplicate names within a run).
name: Complement Logs - ${{ job.status }} - (${{ matrix.arrangement }}, ${{ matrix.database }})
path: |
/tmp/gotest-sanity-check-complement.log
/tmp/gotest-complement.log
/tmp/gotest-in-repo-complement.log