11name : Tests
22
3+ permissions : {}
4+
35on :
46 push :
5- branches : [ ' main' ]
7+ branches : [" main" ]
68 pull_request :
79 workflow_dispatch :
810
911jobs :
1012 check-signoff :
1113 if : " github.event_name == 'pull_request'"
12- uses : " matrix-org/backend-meta/.github/workflows/sign-off.yml@v2 "
14+ uses : matrix-org/backend-meta/.github/workflows/sign-off.yml@18beaf3c8e536108bd04d18e6c3dc40ba3931e28 # v2
1315
1416 js-latest-main :
1517 name : Tests (JS only, latest)
1618 uses : ./.github/workflows/single_sdk_tests.yml
1719 with :
18- use_js_sdk : ' MATCHING_BRANCH'
19- use_complement_crypto : ' . '
20+ use_js_sdk : " MATCHING_BRANCH"
21+ use_complement_crypto : " . "
2022
2123 rust-latest-main :
2224 name : Tests (Rust only, latest)
2325 uses : ./.github/workflows/single_sdk_tests.yml
2426 with :
25- use_rust_sdk : ' MATCHING_BRANCH'
26- use_complement_crypto : ' . '
27+ use_rust_sdk : " MATCHING_BRANCH"
28+ use_complement_crypto : " . "
2729
2830 complement :
2931 name : Tests
3032 runs-on : ubuntu-22.04
3133 steps :
32- - uses : actions/checkout@v3 # Checkout crypto tests
34+ - uses : actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
35+ with :
36+ persist-credentials : false
3337
3438 # Install Node, Go and Rust, along with gotestfmt
3539 - name : Setup | Node.js LTS
36- uses : actions/setup-node@v3
40+ uses : actions/setup-node@53b83947a5a98c8d113130e565377fae1a50d02f # v6.3.0
3741 with :
3842 node-version : " lts/*"
39- cache : ' yarn'
43+ cache : " yarn"
4044 cache-dependency-path : " internal/api/js/js-sdk/yarn.lock"
4145 - name : Setup | Go
42- uses : actions/setup-go@v4
46+ uses : actions/setup-go@4b73464bb391d4059bd26b0524d20df3927bd417 # v6.3.0
4347 with :
44- go-version : ' 1.21 '
48+ go-version : " 1.25 "
4549 - name : Setup | Rust
46- uses : dtolnay/rust-toolchain@stable
47- with :
48- toolchain : stable
50+ run : |
51+ rustup toolchain install stable
52+ rustup default stable
4953 - name : Checkout matrix-rust-sdk
5054 run : |
5155 BRANCH=$(./.github/workflows/resolve_branch.sh matrix-org/matrix-rust-sdk)
5256 mkdir rust-sdk
5357 wget -O archive.tar.gz "https://github.com/matrix-org/matrix-rust-sdk/archive/$BRANCH.tar.gz"
5458 zcat < archive.tar.gz | git get-tar-commit-id # useful for debugging
5559 tar -xz --strip-components=1 -C rust-sdk < archive.tar.gz
56- - uses : Swatinem/rust-cache@v2
60+ - uses : Swatinem/rust-cache@779680da715d629ac1d338a641029a2f4372abb5 # v2.8.2
5761 with :
5862 workspaces : " rust-sdk"
5963 - name : " Install Complement Dependencies"
6064 run : |
61- go install -v github.com/gotesttools/gotestfmt/v2/cmd/gotestfmt@latest
65+ go install -v github.com/gotesttools/gotestfmt/v2/cmd/gotestfmt@4c97682ab858d6bbd26fc020e255cb339c9c8119 # v2.5.0
6266
6367 # Install whatever version of the JS SDK is in package.json
6468 - name : Build JS SDK
@@ -81,38 +85,38 @@ jobs:
8185 docker tag ghcr.io/matrix-org/synapse-service:v1.117.0 homeserver:latest
8286
8387 # Build homeserver image, honouring branch names
84- # - name: "Checkout corresponding Synapse branch"
85- # shell: bash
86- # run: |
87- # mkdir -p homeserver
88- #
89- # # Attempt to use the version of the homeserver which best matches the
90- # # current build.
91- # #
92- # # 1. If we are not on complement's default branch, check if there's a
93- # # similarly named branch (GITHUB_HEAD_REF for pull requests,
94- # # otherwise GITHUB_REF).
95- # # 2. otherwise, use the default homeserver branch ("HEAD")
96- #
97- # for BRANCH_NAME in "$GITHUB_HEAD_REF" "${GITHUB_REF#refs/heads/}" "HEAD"; do
98- # # Skip empty branch names, merge commits, and our default branch.
99- # # (If we are on complement's default branch, we want to fall through to the HS's default branch
100- # # rather than using the HS's 'master'/'main').
101- # case "$BRANCH_NAME" in
102- # "" | refs/pull/* | main | master)
103- # continue
104- # ;;
105- # esac
106- # (wget -O - "https://github.com/matrix-org/synapse/archive/$BRANCH_NAME.tar.gz" | tar -xz --strip-components=1 -C homeserver) && break
107- # done
108- # # Build the base Synapse dockerfile and then build a Complement-specific image from that base.
109- # - run: |
110- # docker build -t matrixdotorg/synapse:latest -f docker/Dockerfile .
111- # docker build -t matrixdotorg/synapse-workers:latest -f docker/Dockerfile-workers .
112- # docker build -t homeserver -f docker/complement/Dockerfile docker/complement
113- # working-directory: homeserver
114- # env:
115- # DOCKER_BUILDKIT: 1
88+ # - name: "Checkout corresponding Synapse branch"
89+ # shell: bash
90+ # run: |
91+ # mkdir -p homeserver
92+ #
93+ # # Attempt to use the version of the homeserver which best matches the
94+ # # current build.
95+ # #
96+ # # 1. If we are not on complement's default branch, check if there's a
97+ # # similarly named branch (GITHUB_HEAD_REF for pull requests,
98+ # # otherwise GITHUB_REF).
99+ # # 2. otherwise, use the default homeserver branch ("HEAD")
100+ #
101+ # for BRANCH_NAME in "$GITHUB_HEAD_REF" "${GITHUB_REF#refs/heads/}" "HEAD"; do
102+ # # Skip empty branch names, merge commits, and our default branch.
103+ # # (If we are on complement's default branch, we want to fall through to the HS's default branch
104+ # # rather than using the HS's 'master'/'main').
105+ # case "$BRANCH_NAME" in
106+ # "" | refs/pull/* | main | master)
107+ # continue
108+ # ;;
109+ # esac
110+ # (wget -O - "https://github.com/matrix-org/synapse/archive/$BRANCH_NAME.tar.gz" | tar -xz --strip-components=1 -C homeserver) && break
111+ # done
112+ # # Build the base Synapse dockerfile and then build a Complement-specific image from that base.
113+ # - run: |
114+ # docker build -t matrixdotorg/synapse:latest -f docker/Dockerfile .
115+ # docker build -t matrixdotorg/synapse-workers:latest -f docker/Dockerfile-workers .
116+ # docker build -t homeserver -f docker/complement/Dockerfile docker/complement
117+ # working-directory: homeserver
118+ # env:
119+ # DOCKER_BUILDKIT: 1
116120 - name : " Run Complement-Crypto unit tests"
117121 env :
118122 COMPLEMENT_BASE_IMAGE : homeserver
@@ -161,10 +165,10 @@ jobs:
161165 DOCKER_BUILDKIT: 1
162166
163167 - name : Upload logs
164- uses : actions/upload-artifact@v4
168+ uses : actions/upload-artifact@bbbca2ddaa5d8feaa63e36b76fdaad77386f024f # v7.0.0
165169 if : ${{ always() }} # do this even if the tests fail
166170 with :
167171 name : Logs - ${{ job.status }}
168172 path : |
169- ./**/logs/*
170- ./**/mitm.dump
173+ ./**/logs/*
174+ ./**/mitm.dump
0 commit comments