Repository navigation
180 lines (154 loc) · 6.29 KB
/
Copy pathdeploy.yml
File metadata and controls
180 lines (154 loc) · 6.29 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
name: Deploy NexDrop to GitHub Pages
on:
push:
branches: ['main']
workflow_dispatch:
inputs:
bench_sizes:
description: 'NEXDROP_BENCH_SIZES bytes (comma-separated) for the transfer-benchmark job — e.g. 341480000 for the 341.48 MB validation file. Empty = default matrix (100 MiB, 250 MiB).'
default: ''
bench_only:
description: 'Skip two-device e2e and deploy (run only the benchmark job) — true/false'
default: 'false'
bench_ack_bytes:
description: 'ACK coalescing sweep override (bytes per cumulative ACK) — e.g. 1048576 / 4194304. Empty = production default (2 MiB).'
default: ''
bench_hash_mode:
description: 'v2.4 hash pipeline A/B — auto / inline / merkle / worker. Empty = auto (production selection).'
default: ''
bench_chunk_kb:
description: 'Chunk-size pin in KiB (64/128/256). Empty = adaptive ladder (64-256 KiB).'
default: ''
bench_readahead:
description: 'Read-ahead depth 1-4 (double/triple buffering sweep). Empty = 1 (v2.3 single-slot).'
default: ''
bench_writer:
description: 'Force receiver writer: opfs-sync | opfs-async | (empty=auto)'
required: false
default: ''
bench_channels:
description: 'Force the striping pool size 1-4 (multi-channel gate sweep). Empty = measured auto gate (max 4).'
default: ''
bench_write_bytes:
description: 'v2.5.1 write-coalescing sweep: storage-write batch target in bytes (e.g. 524288 / 1048576 / 2097152). Empty = production default (1 MiB).'
default: ''
bench_write_hold:
description: 'v2.5.1 write-coalescing sweep: partial-batch hold ms before flush (e.g. 5 / 10 / 20). Empty = 0 (greedy, production default).'
default: ''
permissions:
contents: read
pages: write
id-token: write
concurrency:
group: 'pages'
cancel-in-progress: true
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Setup Node
uses: actions/setup-node@v4
with:
node-version: '20'
cache: 'npm'
- name: Install dependencies
run: npm ci
- name: Lint
run: npm run lint
- name: Type check
run: npm run typecheck
- name: Unit tests (crypto, pairing, protocol, storage)
run: npm test
- name: Build static export
run: npm run build
- name: Verify export output
run: |
test -f out/index.html || (echo "out/index.html missing — static export failed" && exit 1)
test -f out/sw.js || (echo "out/sw.js missing" && exit 1)
test -f out/manifest.webmanifest || (echo "out/manifest.webmanifest missing" && exit 1)
test -f out/icons/icon-192.png || (echo "icon-192 missing" && exit 1)
- name: Add .nojekyll (bypass Jekyll processing)
run: touch out/.nojekyll
- name: Upload artifact
uses: actions/upload-pages-artifact@v3
with:
path: out
two-device-e2e:
# REAL two-device regression suite: two isolated Chromium sessions pair
# over actual WebRTC (QR payload exchange -> DataChannels -> file
# transfer with SHA-256 verification). Runners have a real ICE path,
# unlike sandboxes. Failures here are real regressions, never skipped.
runs-on: ubuntu-latest
needs: build
if: inputs.bench_only != 'true'
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Setup Node
uses: actions/setup-node@v4
with:
node-version: '20'
cache: 'npm'
- name: Install dependencies
run: npm ci
- name: Install Chromium for Playwright
run: npx playwright install --with-deps chromium
- name: Build static export
run: npm run build
- name: Run two-device end-to-end test
run: NEXDROP_E2E_VERBOSE=1 npx tsx tests/e2e/two-device.test.ts
transfer-benchmark:
# Benchmark tier C — REAL two-device browser benchmark: pairs two
# isolated Chromium sessions over real WebRTC (loopback host candidates
# on the runner — a genuine DataChannel path, though not a physical
# network) and transfers 100 MiB / 500 MiB / 1 GiB while sampling live
# engine telemetry. Prints one [BENCH] JSON line per size — measured
# values only (bytes/time/RTT/bufferedAmount/heap), never synthesized,
# and no hard-coded pass speed: the job fails only on real transfer
# failures (no completion, no SHA-256 verify), not on slow numbers.
#
# Tier A (deterministic protocol/unit suite: crypto, pairing codecs,
# session state machines) runs inside the build job via `npm test`.
# Tier B (browser integration) is covered by the two-device-e2e job,
# which exercises the real browser pairing + transfer UI end to end.
runs-on: ubuntu-latest
timeout-minutes: 45
needs: build
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Setup Node
uses: actions/setup-node@v4
with:
node-version: '20'
cache: 'npm'
- name: Install dependencies
run: npm ci
- name: Install Chromium for Playwright
run: npx playwright install --with-deps chromium
- name: Build static export
run: npm run build
- name: Run two-device transfer benchmark
run: npx tsx tests/e2e/benchmark.test.ts
env:
NEXDROP_BENCH_SIZES: ${{ inputs.bench_sizes || '' }}
NEXDROP_ACK_TUNE_BYTES: ${{ inputs.bench_ack_bytes || '' }}
NEXDROP_BENCH_HASH_MODE: ${{ inputs.bench_hash_mode || '' }}
NEXDROP_BENCH_CHUNK_KB: ${{ inputs.bench_chunk_kb || '' }}
NEXDROP_BENCH_WRITER: ${{ inputs.bench_writer || '' }}
NEXDROP_BENCH_READAHEAD: ${{ inputs.bench_readahead || '' }}
NEXDROP_BENCH_CHANNELS: ${{ inputs.bench_channels || '' }}
NEXDROP_BENCH_WRITE_BYTES: ${{ inputs.bench_write_bytes || '' }}
NEXDROP_BENCH_WRITE_HOLD: ${{ inputs.bench_write_hold || '' }}
deploy:
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
runs-on: ubuntu-latest
needs: [build, two-device-e2e]
steps:
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v4