-
Notifications
You must be signed in to change notification settings - Fork 0
298 lines (252 loc) · 10.4 KB
/
Copy pathci.yml
File metadata and controls
298 lines (252 loc) · 10.4 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
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
name: CI
on:
push:
branches: [main]
pull_request:
branches: [main]
env:
CARGO_TERM_COLOR: always
permissions:
contents: read
jobs:
matrix-rust:
name: Matrix Rust (${{ matrix.os }})
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, windows-latest]
steps:
- uses: actions/checkout@11d5960a326750d5838078e36cf38b85af677262 # v4
- name: Install Rust toolchain
uses: dtolnay/rust-toolchain@d0befba8b9ddf874327619e84c39b094edd58b66 # 1.93.0
with:
components: clippy, rustfmt
- name: Install system dependencies (Linux)
if: matrix.os == 'ubuntu-latest'
run: |
sudo apt-get update
sudo apt-get install -y \
libwebkit2gtk-4.1-dev \
libappindicator3-dev \
librsvg2-dev \
patchelf \
libssl-dev \
libsqlcipher-dev
- name: Cache cargo registry & build
uses: actions/cache@0057852bfaa89a56745cba8c7296529d2fc39830 # v4
with:
path: |
~/.cargo/registry
~/.cargo/git
mesh/src-tauri/target
key: ${{ runner.os }}-cargo-matrix-${{ hashFiles('mesh/src-tauri/Cargo.lock') }}
restore-keys: ${{ runner.os }}-cargo-matrix-
- name: Check Matrix backend
working-directory: mesh/src-tauri
run: cargo check --no-default-features --features matrix-backend --locked --jobs 1
- name: Lint Matrix backend and tests
working-directory: mesh/src-tauri
run: cargo clippy --no-default-features --features matrix-backend --all-targets --locked --jobs 1 -- -D warnings
- name: Check Rust formatting
working-directory: mesh/src-tauri
run: cargo fmt --check
- name: Check generated TypeScript IPC DTOs
working-directory: mesh
run: npm run check:ipc-types
- name: Check behavior-level security boundaries
working-directory: mesh
run: npm run check:security-invariants:matrix
- name: Test Matrix backend
working-directory: mesh/src-tauri
run: cargo test --no-default-features --features matrix-backend --locked --jobs 1
legacy-rust:
name: Legacy LAN Rust
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@11d5960a326750d5838078e36cf38b85af677262 # v4
- name: Install Rust toolchain
uses: dtolnay/rust-toolchain@d0befba8b9ddf874327619e84c39b094edd58b66 # 1.93.0
- name: Install system dependencies
run: |
sudo apt-get update
sudo apt-get install -y \
libwebkit2gtk-4.1-dev \
libappindicator3-dev \
librsvg2-dev \
patchelf \
libssl-dev \
libsqlcipher-dev
- name: Cache cargo registry & legacy build
uses: actions/cache@0057852bfaa89a56745cba8c7296529d2fc39830 # v4
with:
path: |
~/.cargo/registry
~/.cargo/git
mesh/src-tauri/target
key: ${{ runner.os }}-cargo-legacy-${{ hashFiles('mesh/src-tauri/Cargo.lock') }}
restore-keys: ${{ runner.os }}-cargo-legacy-
- name: Check legacy LAN backend
working-directory: mesh/src-tauri
run: cargo check --no-default-features --features legacy-p2p --locked --jobs 1
- name: Test legacy LAN backend
working-directory: mesh/src-tauri
run: cargo test --no-default-features --features legacy-p2p --locked --jobs 1
- name: Check legacy behavior-level security boundaries
working-directory: mesh
run: npm run check:security-invariants:legacy
check-frontend:
name: Frontend Build & Browser E2E
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@11d5960a326750d5838078e36cf38b85af677262 # v4
with:
# The readiness validator binds sourceTreeHash to an exact historical
# sourceCommit, so a synthetic depth-one PR merge is insufficient.
fetch-depth: 0
- name: Setup Node.js
uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # v4
with:
node-version: 22
cache: npm
cache-dependency-path: |
mesh/package-lock.json
mesh/feature-deps/matrix-voice/package-lock.json
mesh/feature-deps/legacy-lan/package-lock.json
- name: Install dependencies
working-directory: mesh
run: npm ci
- name: TypeScript check
working-directory: mesh
run: npx tsc --noEmit
- name: Lint React compiler and Zustand selector contracts
working-directory: mesh
run: npm run lint
- name: Check Tauri IPC command contract
working-directory: mesh
run: npm run check:ipc-contract
- name: Check design token source of truth
working-directory: mesh
run: npm run check:design-tokens
- name: Check icon source of truth
working-directory: mesh
run: npm run check:icons
- name: Check bundled interface sounds
working-directory: mesh
run: npm run check:interface-sounds
- name: Check reviewed public services
working-directory: mesh
run: npm run check:public-services
- name: Check production readiness ledger
working-directory: mesh
run: |
node --test scripts/check-readiness-ledger.test.mjs
npm run check:readiness-ledger
- name: Check fail-closed external acceptance contract
working-directory: mesh
run: |
node --test scripts/check-external-acceptance.test.mjs
node scripts/check-external-acceptance.mjs
- name: Check public site source
working-directory: mesh
run: npm run check:public-site
- name: Check approved owner decisions
working-directory: mesh
run: npm run check:owner-decisions
- name: Check beta product boundary
working-directory: mesh
run: npm run check:beta-contract
- name: Check production operations boundary
working-directory: mesh
run: npm run check:operations-contract
- name: Check third-party notices and licenses
working-directory: mesh
run: npm run check:third-party-notices
- name: Check homeserver recovery scripts
working-directory: mesh
run: |
shellcheck -x -e SC1007 infra/homeserver/*.sh infra/homeserver/tests/*.sh
for test_script in infra/homeserver/tests/*.test.sh; do
sh "$test_script"
done
python -m unittest discover -s infra/homeserver/tests -p 'test_*.py' -v
cp infra/homeserver/.env.example infra/homeserver/.env
trap 'rm -f infra/homeserver/.env' EXIT
docker compose \
-f infra/homeserver/docker-compose.yml config --quiet
- name: Run tests
working-directory: mesh
run: npm run test -- --maxWorkers=4
- name: Test isolated voice dependency graphs
working-directory: mesh
run: npm run test:voice-features
- name: Build isolated acceptance frontends
working-directory: mesh
run: |
npm run build:matrix-voice
npm run build:lan
- name: Build frontend
working-directory: mesh
run: npm run build
- name: Enforce frontend entry bundle budget
working-directory: mesh
run: npm run check:bundle-size -- --report release/bundle-report.json
- name: Install Playwright browser
working-directory: mesh
run: npm run e2e:install -- --with-deps
- name: Run browser E2E tests and WCAG scans
working-directory: mesh
run: npm run e2e
protected-evidence:
name: Protected CI evidence manifest
if: always()
needs: [matrix-rust, legacy-rust, check-frontend]
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@11d5960a326750d5838078e36cf38b85af677262 # v4
with:
fetch-depth: 0
- uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # v4
with:
node-version: 22
- name: Fail closed unless every protected job passed
env:
MATRIX_RUST: ${{ needs.matrix-rust.result }}
LEGACY_RUST: ${{ needs.legacy-rust.result }}
FRONTEND: ${{ needs.check-frontend.result }}
run: |
node -e "const fs=require('fs'); const results={matrixRust:process.env.MATRIX_RUST,legacyRust:process.env.LEGACY_RUST,frontend:process.env.FRONTEND}; fs.mkdirSync('mesh/release',{recursive:true}); fs.writeFileSync('mesh/release/ci-run-results.json',JSON.stringify({schemaVersion:1,sourceSha:process.env.GITHUB_SHA,results},null,2)+'\n'); if(Object.values(results).some(v=>v!=='success')) process.exit(1)"
- name: Upload protected CI payload
id: payload
uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4
with:
name: ci-r0-payload-${{ github.sha }}
path: mesh/release/ci-run-results.json
if-no-files-found: error
retention-days: 90
- name: Generate protected CI evidence manifest
working-directory: mesh
run: |
node scripts/protected-evidence-manifest.mjs \
--source-sha "${{ github.sha }}" \
--tree-hash "$(git rev-parse HEAD^{tree})" \
--workflow-name CI \
--run-id "${{ github.run_id }}" \
--run-attempt "${{ github.run_attempt }}" \
--workflow-uri "${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}" \
--payload-path release/ci-run-results.json \
--payload-name ci-r0-payload-${{ github.sha }} \
--payload-uri "${{ steps.payload.outputs.artifact-url }}" \
--payload-digest "${{ steps.payload.outputs.artifact-digest }}" \
--command "matrix-rust + legacy-rust + check-frontend protected jobs" \
--build-mode matrix-text \
--features matrix-backend,legacy-p2p \
--retention-days 90 \
--output release/ci-protected-evidence-manifest.json
- name: Upload protected CI evidence manifest
uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4
with:
name: ci-protected-evidence-${{ github.sha }}
path: mesh/release/ci-protected-evidence-manifest.json
if-no-files-found: error
retention-days: 90