summaryrefslogtreecommitdiff
path: root/.github/workflows/tests.yml
diff options
context:
space:
mode:
Diffstat (limited to '.github/workflows/tests.yml')
-rw-r--r--.github/workflows/tests.yml30
1 files changed, 24 insertions, 6 deletions
diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml
index 955beb4a..bf36ee1c 100644
--- a/.github/workflows/tests.yml
+++ b/.github/workflows/tests.yml
@@ -305,11 +305,29 @@ jobs:
with:
path: synapse
- - name: Run actions/checkout@v2 for complement
- uses: actions/checkout@v2
- with:
- repository: "matrix-org/complement"
- path: complement
+ # Attempt to check out the same branch of Complement as the PR. If it
+ # doesn't exist, fallback to master.
+ - name: Checkout complement
+ shell: bash
+ run: |
+ mkdir -p complement
+ # Attempt to use the version of complement which best matches the current
+ # build. Depending on whether this is a PR or release, etc. we need to
+ # use different fallbacks.
+ #
+ # 1. First check if there's a similarly named branch (GITHUB_HEAD_REF
+ # for pull requests, otherwise GITHUB_REF).
+ # 2. Attempt to use the base branch, e.g. when merging into release-vX.Y
+ # (GITHUB_BASE_REF for pull requests).
+ # 3. Use the default complement branch ("master").
+ for BRANCH_NAME in "$GITHUB_HEAD_REF" "$GITHUB_BASE_REF" "${GITHUB_REF#refs/heads/}" "master"; do
+ # Skip empty branch names and merge commits.
+ if [[ -z "$BRANCH_NAME" || $BRANCH_NAME =~ ^refs/pull/.* ]]; then
+ continue
+ fi
+
+ (wget -O - "https://github.com/matrix-org/complement/archive/$BRANCH_NAME.tar.gz" | tar -xz --strip-components=1 -C complement) && break
+ done
# Build initial Synapse image
- run: docker build -t matrixdotorg/synapse:latest -f docker/Dockerfile .
@@ -322,7 +340,7 @@ jobs:
working-directory: complement/dockerfiles
# Run Complement
- - run: go test -v -tags synapse_blacklist ./tests
+ - run: go test -v -tags synapse_blacklist,msc2403,msc2946,msc3083 ./tests
env:
COMPLEMENT_BASE_IMAGE: complement-synapse:latest
working-directory: complement