|
25 | 25 | include: |
26 | 26 | - homeserver: Synapse |
27 | 27 | tags: synapse_blacklist,msc2403,msc2946,msc3083 |
| 28 | + default_branch: develop |
28 | 29 |
|
29 | 30 | - homeserver: Dendrite |
30 | 31 | tags: msc2836 dendrite_blacklist |
| 32 | + default_branch: master |
31 | 33 |
|
32 | 34 | container: |
33 | 35 | image: matrixdotorg/complement # dockerfiles/ComplementCIBuildkite.Dockerfile |
|
41 | 43 |
|
42 | 44 | steps: |
43 | 45 | - uses: actions/checkout@v2 |
| 46 | + |
| 47 | + - name: "Checkout corresponding ${{ matrix.homeserver }} branch" |
| 48 | + # This is only done for Synapse since Dendrite's docker file pulls in |
| 49 | + # the Dendrite sources directly. |
| 50 | + if: ${{ matrix.homeserver == 'Synapse' }} |
| 51 | + shell: bash |
| 52 | + run: | |
| 53 | + mkdir -p homeserver |
| 54 | + # Attempt to use the version of the homeserver which best matches the |
| 55 | + # current build. Depending on whether this is a PR or release, etc. we |
| 56 | + # need to use different fallbacks. |
| 57 | + # |
| 58 | + # 1. First check if there's a similarly named branch (GITHUB_HEAD_REF |
| 59 | + # for pull requests, otherwise GITHUB_REF). |
| 60 | + # 2. Use the default homeserver branch. |
| 61 | + for BRANCH_NAME in "$GITHUB_HEAD_REF" "${GITHUB_REF#refs/heads/}" "${{ matrix.default_branch }}"; do |
| 62 | + # Skip empty branch names and merge commits. |
| 63 | + if [[ -z "$BRANCH_NAME" || $BRANCH_NAME =~ ^refs/pull/.* ]]; then |
| 64 | + continue |
| 65 | + fi |
| 66 | +
|
| 67 | + (wget -O - "https://github.com/matrix-org/${{ matrix.homeserver }}/archive/$BRANCH_NAME.tar.gz" | tar -xz --strip-components=1 -C homeserver) && break |
| 68 | + done |
| 69 | +
|
| 70 | + # Build initial homeserver image |
| 71 | + - run: docker build -t matrixdotorg/synapse:latest -f docker/Dockerfile . |
| 72 | + # We only do this for Synapse since Dendrite's docker file pulls in |
| 73 | + # the Dendrite sources directly (instead of being based on a previously |
| 74 | + # built docker image). |
| 75 | + if: ${{ matrix.homeserver == 'Synapse' }} |
| 76 | + working-directory: homeserver |
| 77 | + |
44 | 78 | - run: docker build -t homeserver -f dockerfiles/${{ matrix.homeserver }}.Dockerfile dockerfiles/ |
45 | 79 | - run: go test -p 2 -v -tags "${{ matrix.tags }}" ./tests/... |
46 | 80 | env: |
|
0 commit comments