installer-ui-smoke #22
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # 一键安装器 UI 冒烟(dev-board#339):在 Windows runner 上渲染位图、编译 | |
| # awd-oneclick-ui.nsh 的测试壳与插件安装器,真跑一遍「大卡片 → 角落进度卡 → | |
| # 完成卡」并逐阶段截图上传。开发期在专用分支上按推自动跑;平时手动触发。 | |
| # 不依赖桌面完整打包(那是 desktop-build.yml 的事),几分钟出结果, | |
| # 是没有 Windows 真机时唯一的视觉回归手段。 | |
| name: installer-ui-smoke | |
| on: | |
| push: | |
| branches: [claude/installer-oneclick-ui, claude/win-dual-arch] | |
| workflow_dispatch: | |
| jobs: | |
| smoke: | |
| runs-on: windows-latest | |
| timeout-minutes: 20 | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Render one-click art (Chrome + ImageMagick, runner 自带) | |
| shell: pwsh | |
| run: | | |
| node desktop/scripts/render-oneclick-art.mjs --product desktop --out desktop/build/win/generated --version 9.9.9 | |
| node desktop/scripts/render-oneclick-art.mjs --product addin --out office-addin/installer/win/generated --version 9.9.9 | |
| - name: Ensure NSIS | |
| shell: pwsh | |
| run: | | |
| if (-not (Get-Command makensis -ErrorAction SilentlyContinue)) { | |
| choco install nsis -y --no-progress | |
| Add-Content $env:GITHUB_PATH 'C:\Program Files (x86)\NSIS' | |
| } | |
| - name: Compile harness (zh/en) and addin installer | |
| shell: pwsh | |
| # NSIS 的相对 File 路径是相对脚本所在目录解析的,所有 -D 路径一律给绝对路径 | |
| run: | | |
| $ws = $env:GITHUB_WORKSPACE | |
| New-Item -ItemType Directory -Force payload | Out-Null | |
| 1..4 | ForEach-Object { fsutil file createnew ("payload\blob$_.bin") 41943040 } | |
| # REQUIRED_KB 打开磁盘空间闸(dev-board#350)。200MB:payload 只有 160MB, | |
| # runner 盘上剩几十 GB,走的是「够用、正常放行」那条分支——这一路本身就是 | |
| # 「闸没把正常安装挡住」的回归证据。 | |
| makensis /INPUTCHARSET UTF8 /DHARNESS_LANG=SimpChinese /DREQUIRED_KB=204800 "/DGENART=$ws\desktop\build\win\generated" "/DPAYLOAD=$ws\payload" "/DOUTFILE=$ws\harness-zh.exe" desktop\build\win\ui-harness.nsi | |
| makensis /INPUTCHARSET UTF8 /DHARNESS_LANG=English /DREQUIRED_KB=204800 "/DGENART=$ws\desktop\build\win\generated" "/DPAYLOAD=$ws\payload" "/DOUTFILE=$ws\harness-en.exe" desktop\build\win\ui-harness.nsi | |
| # 反向用例:所需空间约 858 GB,runner 上必然不足,走「拦下」分支 | |
| makensis /INPUTCHARSET UTF8 /DHARNESS_LANG=SimpChinese /DREQUIRED_KB=900000000 "/DGENART=$ws\desktop\build\win\generated" "/DPAYLOAD=$ws\payload" "/DOUTFILE=$ws\harness-nospace.exe" desktop\build\win\ui-harness.nsi | |
| # electron-builder 页序复刻(dev-board#356):欢迎页与 INSTFILES 之间夹一张 | |
| # 运行期被 Abort 跳过、编译期照吃 MUI 定义的「安装模式」页。上面几个 harness | |
| # 是欢迎页紧贴 INSTFILES 的理想页序,测不出这个坑;桌面端真产物走的是这一种。 | |
| makensis /INPUTCHARSET UTF8 /DHARNESS_LANG=SimpChinese /DREQUIRED_KB=204800 /DEB_PAGE_ORDER "/DGENART=$ws\desktop\build\win\generated" "/DPAYLOAD=$ws\payload" "/DOUTFILE=$ws\harness-eborder.exe" desktop\build\win\ui-harness.nsi | |
| Set-Content -Path dummy-manifest.xml -Value '<?xml version="1.0"?><OfficeApp/>' | |
| makensis /INPUTCHARSET UTF8 /DVERSION=0.0.1 "/DMANIFEST=$ws\dummy-manifest.xml" "/DOUTFILE=$ws\addin-smoke.exe" "/DARTDIR=$ws\office-addin\installer\win" "/DAWD_UI_ENGINE=$ws\desktop\build\win\awd-oneclick-ui.nsh" "/DGENART=$ws\office-addin\installer\win\generated" /DLEGALBASE=https://www.aiworkdeck.com office-addin\installer\win\installer.nsi | |
| - name: Drive zh harness with screenshots | |
| shell: pwsh | |
| run: pwsh -File desktop/scripts/installer-smoke.ps1 -Exe harness-zh.exe -OutDir shots/zh | |
| - name: Drive zh harness close button (欢迎卡右上角 ✕ 必须退出,dev-board#354) | |
| shell: pwsh | |
| # 单独起一个进程只测这一下:欢迎卡一出来就点 ✕,不经过任何对话框或别的热区。 | |
| # 失败时日志里会带两条对照(同排的最小化热区是否生效、外部发 IDCANCEL 是否能关), | |
| # 直接分辨「点击没落到热区上」还是「关窗动作没生效」。 | |
| run: pwsh -File desktop/scripts/installer-smoke.ps1 -Exe harness-zh.exe -OutDir shots/close -CloseOnly | |
| - name: Drive eborder harness (electron-builder 页序,dev-board#356) | |
| shell: pwsh | |
| # 与桌面端真产物同一种页序。走的是正常流程,断言在 installer-smoke.ps1 里: | |
| # 点完「立即安装」窗口必须缩成角落小进度卡、原生「上一步」按钮必须不可见。 | |
| run: pwsh -File desktop/scripts/installer-smoke.ps1 -Exe harness-eborder.exe -OutDir shots/eborder | |
| - name: Drive en harness with screenshots | |
| shell: pwsh | |
| run: pwsh -File desktop/scripts/installer-smoke.ps1 -Exe harness-en.exe -OutDir shots/en | |
| - name: Drive nospace harness (磁盘空间闸必须拦下,dev-board#350) | |
| shell: pwsh | |
| # 断言三件事:弹了提示框、进程没退出、窗口还是 760 宽的大卡片(开装了会 | |
| # 缩成 360x132 的角落小进度卡)。截图落 shots/nospace/03-blocked.png。 | |
| run: pwsh -File desktop/scripts/installer-smoke.ps1 -Exe harness-nospace.exe -OutDir shots/nospace -ExpectBlocked | |
| - name: Drive addin installer (无目录展开分支的实跑覆盖) | |
| shell: pwsh | |
| # 插件端不开 AWD_UI_DIR_CHOICE,欢迎页少一组控件、安装秒完——点自定义安装 | |
| # 的那一下落在空白处无害,其余流程同款;在 runner 上写 HKCU sideload 键无碍 | |
| run: pwsh -File desktop/scripts/installer-smoke.ps1 -Exe addin-smoke.exe -OutDir shots/addin | |
| - name: Upload screenshots | |
| if: always() | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: installer-ui-shots | |
| path: shots/ | |
| if-no-files-found: warn | |
| - name: Upload rendered art for the ARM job | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: oneclick-art-desktop | |
| path: desktop/build/win/generated/ | |
| retention-days: 1 | |
| # 真 ARM64 Windows(public 仓才有的 windows-11-arm runner):验证一键 UI 在 | |
| # ARM 上的实际表现(NSIS 产物是 x86,走系统转译层),并断言双架构检测判据 | |
| #(dev-board#341 的 customInstall 用同一注册表位)。探索性 job,失败不拦主 job。 | |
| smoke-arm: | |
| needs: smoke | |
| runs-on: windows-11-arm | |
| timeout-minutes: 25 | |
| continue-on-error: true | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Assert native arch detection reads ARM64 | |
| shell: pwsh | |
| run: | | |
| # reg query 输出是行数组:-notmatch 对数组做过滤不是布尔,必须先拼成串 | |
| #(首轮真机 run 实锤:值明明是 ARM64 断言却红) | |
| $out = (reg query 'HKLM\SYSTEM\CurrentControlSet\Control\Session Manager\Environment' /v PROCESSOR_ARCHITECTURE) | Out-String | |
| if ($out -notmatch 'ARM64') { throw "native arch not ARM64: $out" } | |
| Write-Host 'detection ok: ARM64' | |
| - name: Ensure NSIS | |
| shell: pwsh | |
| run: | | |
| if (-not (Get-Command makensis -ErrorAction SilentlyContinue)) { | |
| choco install nsis -y --no-progress | |
| Add-Content $env:GITHUB_PATH 'C:\Program Files (x86)\NSIS' | |
| } | |
| # 位图复用 x64 job 的渲染产物:ARM runner 镜像的 ImageMagick 缺模块注册表 | |
| #(RegistryKeyLookupFailed,连 PNG 都解不了,首轮真机 run 实锤),而位图 | |
| # 本来就与架构无关,没必要在 ARM 上再渲染一遍 | |
| - name: Download rendered art from x64 job | |
| uses: actions/download-artifact@v4 | |
| with: | |
| name: oneclick-art-desktop | |
| path: desktop/build/win/generated/ | |
| - name: Compile harness (zh) | |
| shell: pwsh | |
| run: | | |
| $ws = $env:GITHUB_WORKSPACE | |
| New-Item -ItemType Directory -Force payload | Out-Null | |
| 1..4 | ForEach-Object { fsutil file createnew ("payload\blob$_.bin") 41943040 } | |
| makensis /INPUTCHARSET UTF8 /DHARNESS_LANG=SimpChinese /DREQUIRED_KB=204800 "/DGENART=$ws\desktop\build\win\generated" "/DPAYLOAD=$ws\payload" "/DOUTFILE=$ws\harness-zh.exe" desktop\build\win\ui-harness.nsi | |
| if ($LASTEXITCODE -ne 0) { throw "makensis failed" } | |
| if (-not (Test-Path "$ws\harness-zh.exe")) { throw 'harness exe missing' } | |
| - name: Drive harness with screenshots (ARM real machine) | |
| shell: pwsh | |
| run: pwsh -File desktop/scripts/installer-smoke.ps1 -Exe harness-zh.exe -OutDir shots-arm/zh | |
| - name: Upload ARM screenshots | |
| if: always() | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: installer-ui-shots-arm | |
| path: shots-arm/ | |
| if-no-files-found: warn |