Repository navigation
364 lines (332 loc) · 15.6 KB
/
Copy patharstack-studio-qt.yml
File metadata and controls
364 lines (332 loc) · 15.6 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
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
name: ARStack Studio Qt
on:
push:
branches: [main]
paths:
- 'apps/arstack_studio/**'
- 'include/ariec61850/sampled_values/**'
- 'src/scl/**'
- 'include/ariec61850/scl/**'
- '.github/workflows/arstack-studio-qt.yml'
pull_request:
types: [opened, synchronize, reopened, ready_for_review]
paths:
- 'apps/arstack_studio/**'
- 'include/ariec61850/sampled_values/**'
- 'src/scl/**'
- 'include/ariec61850/scl/**'
- '.github/workflows/arstack-studio-qt.yml'
permissions:
contents: read
concurrency:
group: arstack-studio-qt-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: ${{ github.event_name == 'pull_request' }}
jobs:
windows-launcher-parse:
if: ${{ github.event_name != 'pull_request' || !github.event.pull_request.draft }}
runs-on: windows-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Parse Windows PowerShell entrypoints
shell: powershell
run: |
$paths = @(
'.\apps\arstack_studio\run-windows.ps1',
'.\apps\arstack_studio\packaging\verify-single-instance.ps1'
)
foreach ($candidate in $paths) {
$path = Resolve-Path $candidate
$tokens = $null
$errors = $null
[System.Management.Automation.Language.Parser]::ParseFile(
$path,
[ref]$tokens,
[ref]$errors) | Out-Null
if ($errors.Count -gt 0) {
$errors | Format-List *
throw "$candidate contains $($errors.Count) PowerShell parser error(s)."
}
}
Write-Host 'Windows PowerShell parse: PASS · launcher + S8B packaged ownership probe'
windows-ownership-integration:
if: ${{ github.event_name != 'pull_request' || !github.event.pull_request.draft }}
name: S8B Windows ownership integration
runs-on: windows-2022
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Install Qt
uses: jurplel/install-qt-action@v4
with:
version: '6.10.3'
arch: win64_msvc2022_64
modules: 'qtserialport'
cache: true
- name: Configure native Windows harnesses
shell: powershell
run: |
cmake -S apps/arstack_studio -B build-arstack-studio -G "Visual Studio 17 2022" -A x64 `
-DARIEC61850_WARNINGS_AS_ERRORS=ON
- name: Build native Windows harnesses
shell: powershell
run: |
cmake --build build-arstack-studio --config Release `
--target arstack_session_harness arstack_windows_ownership_harness --parallel
- name: S8A deterministic session harness on Windows
timeout-minutes: 1
shell: powershell
run: |
$exe = Join-Path $PWD 'build-arstack-studio\Release\arstack_session_harness.exe'
$out = Join-Path $env:RUNNER_TEMP 'arstack-session-windows.out.log'
$err = Join-Path $env:RUNNER_TEMP 'arstack-session-windows.err.log'
& $exe 1> $out 2> $err
$exitCode = $LASTEXITCODE
Get-Content $out -ErrorAction SilentlyContinue
Get-Content $err -ErrorAction SilentlyContinue
if ($exitCode -ne 0) {
throw "S8A Windows deterministic harness failed with exit code $exitCode."
}
- name: S8B cross-process ownership and serial-loss harness
timeout-minutes: 1
shell: powershell
run: |
$exe = Join-Path $PWD 'build-arstack-studio\Release\arstack_windows_ownership_harness.exe'
$out = Join-Path $env:RUNNER_TEMP 'arstack-windows-ownership.out.log'
$err = Join-Path $env:RUNNER_TEMP 'arstack-windows-ownership.err.log'
& $exe 1> $out 2> $err
$exitCode = $LASTEXITCODE
Get-Content $out -ErrorAction SilentlyContinue
Get-Content $err -ErrorAction SilentlyContinue
if ($exitCode -ne 0) {
throw "S8B Windows ownership harness failed with exit code $exitCode."
}
- name: Retain Windows ownership logs
if: always()
uses: actions/upload-artifact@v4
with:
name: arstack-studio-windows-ownership-logs
path: |
${{ runner.temp }}/arstack-session-windows.out.log
${{ runner.temp }}/arstack-session-windows.err.log
${{ runner.temp }}/arstack-windows-ownership.out.log
${{ runner.temp }}/arstack-windows-ownership.err.log
if-no-files-found: ignore
retention-days: 7
qt-build-smoke:
if: ${{ github.event_name != 'pull_request' || !github.event.pull_request.draft }}
runs-on: ubuntu-latest
container: ubuntu:26.04
steps:
- name: Install build and Qt dependencies
shell: bash
run: |
apt-get update
DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends \
ca-certificates git cmake ninja-build g++ \
qt6-base-dev qt6-declarative-dev qt6-serialport-dev \
qml6-module-qtquick qml6-module-qtquick-controls \
qml6-module-qtquick-layouts qml6-module-qtquick-dialogs \
qml6-module-qtquick-window
- name: Checkout
uses: actions/checkout@v4
- name: S7 QML presentation-only authority regression
shell: bash
run: |
set -euo pipefail
qml_root='apps/arstack_studio/qml'
device_pattern='([A-Za-z_][A-Za-z0-9_]*\.)*device\.(start|stop|autoDetectAndConnect|connectPort|disconnectPort|refreshPorts|deployProfile|setSignal|setFrequency|setEnabled|setQuality|setCtSaturation|zero|sendPtpShow|sendSmpSynchShow|setPtpRole|setSmpSynchPolicy|configurePtp|startPtp|stopPtp)[[:space:]]*\('
firmware_pattern='([A-Za-z_][A-Za-z0-9_]*\.)*(firmware|FirmwareService)\.(probeTarget|installFirmware)[[:space:]]*\('
device_meta_pattern='Q_INVOKABLE[[:space:]].*(start|stop|autoDetectAndConnect|connectPort|disconnectPort|refreshPorts|deployProfile|setSignal|setFrequency|setEnabled|setQuality|setCtSaturation|zero|sendPtpShow|sendSmpSynchShow|setPtpRole|setSmpSynchPolicy|configurePtp|startPtp|stopPtp)[[:space:]]*\('
if grep -R -nE "$device_pattern" "$qml_root" --include='*.qml'; then
echo 'S7 regression: QML bypasses SmartSessionController with direct DeviceController authority.'
exit 1
fi
if grep -R -nE "$firmware_pattern" "$qml_root" --include='*.qml'; then
echo 'S7 regression: QML bypasses SmartSessionController with direct firmware execution.'
exit 1
fi
if grep -nE "$device_meta_pattern" \
apps/arstack_studio/src/DeviceController.hpp \
apps/arstack_studio/src/StudioDeviceController.hpp; then
echo 'S7 regression: DeviceController mutation leaked back into the QML meta-object.'
exit 1
fi
echo 'S7 QML authority boundary: PASS · presentation submits intents through SmartSessionController and device mutators are not QML-invokable'
- name: Studio operator workspace layout and PTP authority contract
shell: bash
run: python3 apps/arstack_studio/tests/check_operator_workspace.py
- name: Native binary profile authority regression
shell: bash
run: |
set -euo pipefail
controller=apps/arstack_studio/src/DeviceController.cpp
profile_model=apps/arstack_studio/src/SclProfileModel.cpp
firmware=embedded/esp32p4_smv_injector/main/profile_control.cpp
grep -q 'deviceProfileBinary' "$profile_model"
grep -q 'compile_esp32p4_device_profile' "$profile_model"
grep -q 'PROFILE BINSTATUS' "$controller"
grep -q 'PROFILE BINBEGIN' "$controller"
grep -q 'PROFILE BINCHUNK' "$controller"
grep -q 'PROFILE BINCOMMIT' "$controller"
grep -q 'PROFILE SHOW' "$controller"
grep -q 'PROFILE BINSTATUS active=' "$firmware"
if grep -q 'QStringLiteral("PROFILE BEGIN")' "$controller"; then
echo 'Native Studio regressed to legacy textual profile deployment.'
exit 1
fi
if grep -q 'apps/smv_injector_gui' apps/arstack_studio/CMakeLists.txt; then
echo 'Native Studio must not depend on the deprecated browser control surface.'
exit 1
fi
echo 'Native binary profile authority: PASS · C++ compiler -> DeviceController -> firmware V1'
- name: Configure
shell: bash
run: |
set -o pipefail
cmake -S apps/arstack_studio -B build-arstack-studio -G Ninja \
-DCMAKE_BUILD_TYPE=Release \
-DARIEC61850_WARNINGS_AS_ERRORS=ON 2>&1 | tee /tmp/arstack-studio-configure.log
- name: Build
shell: bash
run: |
set -o pipefail
cmake --build build-arstack-studio \
--target arstack_studio arstack_session_harness --parallel 2 \
2>&1 | tee /tmp/arstack-studio-build.log
- name: 4I+4V reference template regression
shell: bash
run: |
set -o pipefail
./build-arstack-studio/arstack_studio --check-reference-template \
2>&1 | tee /tmp/arstack-studio-reference-template.log
- name: Native P0 controller policy regression
shell: bash
run: |
set -o pipefail
./build-arstack-studio/arstack_studio --check-p0-policy \
2>&1 | tee /tmp/arstack-studio-p0-policy.log
- name: S8 deterministic session regression
shell: bash
run: |
set -o pipefail
timeout 20s ./build-arstack-studio/arstack_session_harness \
2>&1 | tee /tmp/arstack-studio-session-harness.log
- name: Firmware bundle contract regression
shell: bash
run: |
set -euo pipefail
root=/tmp/arstack-firmware-contract
rm -rf "$root"
mkdir -p "$root/firmware" "$root/tools"
printf 'ARStack-P0-firmware-contract\n' > "$root/firmware/arstack-esp32p4-smv-0.1.1.bin"
sha="$(sha256sum "$root/firmware/arstack-esp32p4-smv-0.1.1.bin" | awk '{print $1}')"
cat > "$root/firmware/firmware-manifest.json" <<EOF
{
"schema": "arstack.studio.firmware.v1",
"product": "ARStack ESP32-P4 SMV Injector",
"chip": "esp32p4",
"chipRevisionPolicy": "pre-v3",
"version": "0.1.1",
"sourceCommit": "0123456789abcdef0123456789abcdef01234567",
"protocol": 1,
"capabilities": ["SMV-4I4V", "PROFILE", "PROFILE-BINARY-V1", "LIVE-SETPOINTS", "SESSION-LEASE", "PTP-P2", "SMPSYNCH-AUTO"],
"flashOffset": 0,
"image": "arstack-esp32p4-smv-0.1.1.bin",
"sha256": "$sha"
}
EOF
cat > "$root/tools/espflash" <<'EOF'
#!/bin/sh
echo 'espflash contract stub'
EOF
chmod +x "$root/tools/espflash"
ARSTACK_STUDIO_FIRMWARE_DIR="$root/firmware" \
ARSTACK_STUDIO_ESPFLASH="$root/tools/espflash" \
./build-arstack-studio/arstack_studio --check-firmware-contract \
2>&1 | tee /tmp/arstack-studio-firmware-contract.log
cp "$root/firmware/firmware-manifest.json" "$root/firmware/firmware-manifest.valid.json"
zeros=0000000000000000000000000000000000000000000000000000000000000000
sed -i "s/\"sha256\": \"$sha\"/\"sha256\": \"$zeros\"/" "$root/firmware/firmware-manifest.json"
if ARSTACK_STUDIO_FIRMWARE_DIR="$root/firmware" \
ARSTACK_STUDIO_ESPFLASH="$root/tools/espflash" \
./build-arstack-studio/arstack_studio --check-firmware-contract \
>> /tmp/arstack-studio-firmware-contract.log 2>&1; then
echo 'Corrupted firmware hash was incorrectly accepted.' | tee -a /tmp/arstack-studio-firmware-contract.log
exit 1
fi
echo 'Corrupted firmware hash: correctly blocked' | tee -a /tmp/arstack-studio-firmware-contract.log
cp "$root/firmware/firmware-manifest.valid.json" "$root/firmware/firmware-manifest.json"
sed -i 's/"chip": "esp32p4"/"chip": "esp32s3"/' "$root/firmware/firmware-manifest.json"
if ARSTACK_STUDIO_FIRMWARE_DIR="$root/firmware" \
ARSTACK_STUDIO_ESPFLASH="$root/tools/espflash" \
./build-arstack-studio/arstack_studio --check-firmware-contract \
>> /tmp/arstack-studio-firmware-contract.log 2>&1; then
echo 'Wrong-chip firmware manifest was incorrectly accepted.' | tee -a /tmp/arstack-studio-firmware-contract.log
exit 1
fi
echo 'Wrong-chip firmware manifest: correctly blocked' | tee -a /tmp/arstack-studio-firmware-contract.log
- name: Primary-window shutdown regression
shell: bash
run: |
set -o pipefail
timeout 5s env QT_QPA_PLATFORM=offscreen QT_QUICK_BACKEND=software \
./build-arstack-studio/arstack_studio --check-app-lifecycle \
2>&1 | tee /tmp/arstack-studio-lifecycle.log
- name: Headless QML launch smoke
shell: bash
run: |
set +e
timeout 6s env QT_QPA_PLATFORM=offscreen QT_QUICK_BACKEND=software \
./build-arstack-studio/arstack_studio > /tmp/arstack-studio-launch.log 2>&1
status=$?
set -e
cat /tmp/arstack-studio-launch.log
# A process that stays alive can still have broken QML bindings.
# Headless Linux lacks Qt SVG decode support (non-fatal presentation
# warnings), but JavaScript/QML binding failures are release blockers.
if grep -Eq 'TypeError:|ReferenceError:|Cannot assign to non-existent property|is not a type' /tmp/arstack-studio-launch.log; then
echo 'ARStack Studio has QML runtime binding/type failures.'
exit 1
fi
if [ "$status" -ne 124 ]; then
echo "ARStack Studio exited before smoke timeout (status=$status)."
exit "$status"
fi
- name: High-DPI QML launch smoke
shell: bash
run: |
set +e
timeout 6s env QT_QPA_PLATFORM=offscreen QT_QUICK_BACKEND=software QT_SCALE_FACTOR=1.75 \
./build-arstack-studio/arstack_studio > /tmp/arstack-studio-hidpi.log 2>&1
status=$?
set -e
cat /tmp/arstack-studio-hidpi.log
# A process that stays alive can still have broken QML bindings.
# Headless Linux lacks Qt SVG decode support (non-fatal presentation
# warnings), but JavaScript/QML binding failures are release blockers.
if grep -Eq 'TypeError:|ReferenceError:|Cannot assign to non-existent property|is not a type' /tmp/arstack-studio-hidpi.log; then
echo 'ARStack Studio has QML runtime binding/type failures.'
exit 1
fi
if [ "$status" -ne 124 ]; then
echo "ARStack Studio high-DPI launch exited early (status=$status)."
exit "$status"
fi
- name: Retain Qt smoke logs
if: always()
uses: actions/upload-artifact@v4
with:
name: arstack-studio-qt-logs
path: |
/tmp/arstack-studio-configure.log
/tmp/arstack-studio-build.log
/tmp/arstack-studio-reference-template.log
/tmp/arstack-studio-p0-policy.log
/tmp/arstack-studio-session-harness.log
/tmp/arstack-studio-firmware-contract.log
/tmp/arstack-studio-lifecycle.log
/tmp/arstack-studio-launch.log
/tmp/arstack-studio-hidpi.log
if-no-files-found: ignore
retention-days: 7