-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmatrix-federation-acceptance.yml
More file actions
136 lines (122 loc) · 5.47 KB
/
Copy pathmatrix-federation-acceptance.yml
File metadata and controls
136 lines (122 loc) · 5.47 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
name: Matrix federation acceptance
# Development-only protocol acceptance against two disposable local Synapse
# homeservers. This exercises federation, encrypted history, and recovery, but
# it is not evidence that any community-operated production service is ready.
on:
schedule:
# 07:30 UTC daily, separated from the legacy nightly soak.
- cron: "30 7 * * *"
workflow_dispatch:
permissions:
contents: read
concurrency:
group: matrix-federation-acceptance
cancel-in-progress: false
jobs:
two-homeserver:
name: Disposable two-homeserver acceptance
runs-on: ubuntu-latest
timeout-minutes: 45
env:
CARGO_BUILD_JOBS: "1"
CARGO_TERM_COLOR: always
RUST_BACKTRACE: "1"
RUST_LOG: warn
steps:
- uses: actions/checkout@11d5960a326750d5838078e36cf38b85af677262 # v4
- name: Setup Node.js
uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # v4
with:
node-version: 22
cache: npm
cache-dependency-path: mesh/package-lock.json
- name: Install Rust 1.93
uses: dtolnay/rust-toolchain@d0befba8b9ddf874327619e84c39b094edd58b66 # 1.93.0
- name: Install Matrix test build dependencies
run: |
sudo apt-get update
sudo apt-get install -y \
libwebkit2gtk-4.1-dev \
libappindicator3-dev \
librsvg2-dev \
patchelf \
libssl-dev \
libsqlcipher-dev \
dbus-x11 \
gnome-keyring
- name: Cache Matrix test build
uses: actions/cache@0057852bfaa89a56745cba8c7296529d2fc39830 # v4
with:
path: |
~/.cargo/registry
~/.cargo/git
mesh/src-tauri/target
key: ${{ runner.os }}-cargo-matrix-acceptance-${{ hashFiles('mesh/src-tauri/Cargo.lock') }}
restore-keys: ${{ runner.os }}-cargo-matrix-acceptance-
- name: Run two independent federated encryption and recovery cycles
working-directory: mesh
shell: bash
run: |
set -o pipefail
mkdir -p matrix-spike-logs
# The app's Linux keyring backend requires a Secret Service. This
# disposable, empty-password keyring exists only for the isolated
# runner and is destroyed with it; no production credential is used.
for cycle in 1 2; do
npm run setup:matrix-spike:reset 2>&1 |
tee "matrix-spike-logs/setup-cycle-$cycle.log"
MESH_ACCEPTANCE_LOG="matrix-spike-logs/acceptance-cycle-$cycle.log" \
dbus-run-session -- bash -c '
set -o pipefail
printf "\n" | gnome-keyring-daemon \
--unlock --components=secrets >/dev/null
npm run test:matrix-spike 2>&1 | tee "$MESH_ACCEPTANCE_LOG"
'
docker compose -f infra/matrix-spike/docker-compose.yml \
down --volumes --remove-orphans 2>&1 |
tee "matrix-spike-logs/teardown-cycle-$cycle.log"
done
source_sha="$(git rev-parse HEAD)"
source_tree_hash="$(git rev-parse 'HEAD^{tree}')"
cycle_1_sha="$(sha256sum matrix-spike-logs/acceptance-cycle-1.log | awk '{ print $1 }')"
cycle_2_sha="$(sha256sum matrix-spike-logs/acceptance-cycle-2.log | awk '{ print $1 }')"
teardown_1_sha="$(sha256sum matrix-spike-logs/teardown-cycle-1.log | awk '{ print $1 }')"
teardown_2_sha="$(sha256sum matrix-spike-logs/teardown-cycle-2.log | awk '{ print $1 }')"
printf '%s\n' \
'{' \
' "schemaVersion": 1,' \
" \"sourceSha\": \"$source_sha\"," \
" \"sourceTreeHash\": \"$source_tree_hash\"," \
" \"workflowRunId\": \"${GITHUB_RUN_ID}\"," \
" \"workflowRunAttempt\": \"${GITHUB_RUN_ATTEMPT}\"," \
" \"workflowEvent\": \"${GITHUB_EVENT_NAME}\"," \
' "status": "passed",' \
' "independentResetTestCycles": 2,' \
' "cycles": [' \
" { \"iteration\": 1, \"log\": \"acceptance-cycle-1.log\", \"sha256\": \"$cycle_1_sha\", \"teardownLog\": \"teardown-cycle-1.log\", \"teardownSha256\": \"$teardown_1_sha\" }," \
" { \"iteration\": 2, \"log\": \"acceptance-cycle-2.log\", \"sha256\": \"$cycle_2_sha\", \"teardownLog\": \"teardown-cycle-2.log\", \"teardownSha256\": \"$teardown_2_sha\" }" \
' ]' \
'}' > matrix-spike-logs/acceptance-report.json
- name: Capture service diagnostics
if: ${{ always() }}
working-directory: mesh
shell: bash
run: |
mkdir -p matrix-spike-logs
docker compose -f infra/matrix-spike/docker-compose.yml ps --all \
> matrix-spike-logs/compose-ps.log 2>&1 || true
docker compose -f infra/matrix-spike/docker-compose.yml logs \
--no-color --timestamps \
> matrix-spike-logs/compose.log 2>&1 || true
- name: Upload acceptance logs
if: ${{ always() }}
uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1
with:
name: matrix-federation-acceptance-${{ github.sha }}-${{ github.run_number }}
path: mesh/matrix-spike-logs/
if-no-files-found: error
retention-days: 30
- name: Tear down disposable homeservers
if: ${{ always() }}
working-directory: mesh
run: docker compose -f infra/matrix-spike/docker-compose.yml down --volumes --remove-orphans