-
Notifications
You must be signed in to change notification settings - Fork 668
175 lines (148 loc) · 6.75 KB
/
windows-arm64-e2e.yml
File metadata and controls
175 lines (148 loc) · 6.75 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
name: Windows ARM64 E2E
on:
workflow_dispatch:
env:
FORCE_JAVASCRIPT_ACTIONS_TO_NODE24: 'true'
jobs:
windows-arm64-e2e:
runs-on: windows-11-arm
timeout-minutes: 120
steps:
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd
with:
persist-credentials: false
- name: Setup Node.js
uses: actions/setup-node@48b55a011bda9f5d6aeb4c2d9c7362e8dae4041e
with:
node-version: '24.14.1'
package-manager-cache: false
- name: Setup pnpm
uses: pnpm/action-setup@0e279bb959325dab635dd2c09392533439d90093
- name: Install dependencies
run: pnpm install
- name: Configure pnpm workspace for Windows arm64
run: pnpm run install:sharp
env:
TARGET_OS: win32
TARGET_ARCH: arm64
- name: Install Windows arm64 dependencies
run: pnpm install
env:
npm_config_build_from_source: true
npm_config_platform: win32
npm_config_arch: arm64
- name: Install Windows arm64 runtimes
run: pnpm run installRuntime:win:arm64
- name: Verify DuckDB and VSS on Windows arm64
run: pnpm run smoke:duckdb:vss
- name: Build Windows arm64 package
run: |
pnpm run build
pnpm run plugin:bundle:clean
pnpm run plugin:bundle -- --name feishu --platform win32 --arch arm64
pnpm exec electron-builder --win --arm64 --publish=never
env:
VITE_GITHUB_CLIENT_ID: ${{ secrets.DC_GITHUB_CLIENT_ID }}
VITE_GITHUB_CLIENT_SECRET: ${{ secrets.DC_GITHUB_CLIENT_SECRET }}
VITE_GITHUB_REDIRECT_URI: ${{ secrets.DC_GITHUB_REDIRECT_URI }}
VITE_PROVIDER_DB_URL: ${{ secrets.CDN_PROVIDER_DB_URL }}
- name: Verify bundled plugins
shell: bash
run: |
pnpm run plugin:verify -- --name feishu --platform win32 --arch arm64 --plugin-root dist/win-arm64-unpacked/resources/app.asar.unpacked/plugins
- name: Run Windows arm64 launch smoke test
run: pnpm exec playwright test -c test/e2e/playwright.ci.config.ts test/e2e/specs/01-launch.smoke.spec.ts
- name: Run packaged app process smoke
shell: pwsh
run: |
$diagRoot = Join-Path $env:GITHUB_WORKSPACE 'build/windows-arm64-e2e-diagnostics'
New-Item -ItemType Directory -Force -Path $diagRoot | Out-Null
$exe = Join-Path $env:GITHUB_WORKSPACE 'dist/win-arm64-unpacked/DeepChat.exe'
$stdout = Join-Path $diagRoot 'packaged-smoke-stdout.log'
$stderr = Join-Path $diagRoot 'packaged-smoke-stderr.log'
$chromiumLog = Join-Path $diagRoot 'packaged-smoke-chromium.log'
Get-Process -Name 'DeepChat' -ErrorAction SilentlyContinue | Stop-Process -Force
Start-Sleep -Seconds 2
if (!(Test-Path $exe)) {
throw "Packaged executable not found: $exe"
}
$process = Start-Process `
-FilePath $exe `
-WorkingDirectory (Split-Path $exe) `
-ArgumentList @('--enable-logging', '--v=1', "--log-file=$chromiumLog") `
-RedirectStandardOutput $stdout `
-RedirectStandardError $stderr `
-PassThru
try {
Start-Sleep -Seconds 20
$process.Refresh()
if ($process.HasExited) {
"Packaged app exited during process smoke. Exit code: $($process.ExitCode)" |
Out-File -FilePath (Join-Path $diagRoot 'packaged-smoke-result.log') -Encoding utf8
throw "Packaged app exited during process smoke. Exit code: $($process.ExitCode)"
}
"Packaged app stayed alive for 20 seconds. PID: $($process.Id)" |
Out-File -FilePath (Join-Path $diagRoot 'packaged-smoke-result.log') -Encoding utf8
} finally {
$process.Refresh()
if (!$process.HasExited) {
taskkill /pid $($process.Id) /t /f | Out-Null
Start-Sleep -Seconds 2
}
}
- name: Collect Windows arm64 diagnostics
if: always()
shell: pwsh
run: |
$diagRoot = Join-Path $env:GITHUB_WORKSPACE 'build/windows-arm64-e2e-diagnostics'
New-Item -ItemType Directory -Force -Path $diagRoot | Out-Null
$filesystemLog = Join-Path $diagRoot 'filesystem.txt'
$paths = @(
"$env:APPDATA\DeepChat",
"$env:LOCALAPPDATA\DeepChat",
"$env:GITHUB_WORKSPACE\dist\win-arm64-unpacked",
"$env:GITHUB_WORKSPACE\runtime"
)
foreach ($path in $paths) {
"== $path ==" | Out-File -Append -FilePath $filesystemLog -Encoding utf8
if (Test-Path $path) {
Get-ChildItem -Force -Recurse $path |
Select-Object FullName, Length, LastWriteTime |
Format-Table -AutoSize |
Out-String -Width 4096 |
Out-File -Append -FilePath $filesystemLog -Encoding utf8
} else {
"MISSING" | Out-File -Append -FilePath $filesystemLog -Encoding utf8
}
}
$deepchatLogDir = Join-Path $env:APPDATA 'DeepChat\logs'
if (Test-Path $deepchatLogDir) {
Copy-Item -Path (Join-Path $deepchatLogDir '*') -Destination $diagRoot -Recurse -Force -ErrorAction SilentlyContinue
}
$nativeModulesLog = Join-Path $diagRoot 'native-modules.txt'
if (Test-Path "$env:GITHUB_WORKSPACE\dist\win-arm64-unpacked") {
Get-ChildItem -Force -Recurse "$env:GITHUB_WORKSPACE\dist\win-arm64-unpacked" -Filter '*.node' |
Select-Object FullName, Length, LastWriteTime |
Format-Table -AutoSize |
Out-String -Width 4096 |
Out-File -FilePath $nativeModulesLog -Encoding utf8
}
try {
Get-WinEvent -FilterHashtable @{ LogName = 'Application'; StartTime = (Get-Date).AddMinutes(-30) } -ErrorAction Stop |
Where-Object { $_.Message -match 'DeepChat|Electron|Application Error|Faulting application' } |
Select-Object TimeCreated, ProviderName, Id, LevelDisplayName, Message |
Format-List |
Out-File -FilePath (Join-Path $diagRoot 'windows-application-events.txt') -Encoding utf8
} catch {
$_ | Out-File -FilePath (Join-Path $diagRoot 'windows-application-events.txt') -Encoding utf8
}
- name: Upload Windows arm64 E2E diagnostics
if: always()
uses: actions/upload-artifact@b7c566a772e6b6bfb58ed0dc250532a479d7789f
with:
name: deepchat-win-arm64-e2e-diagnostics
if-no-files-found: warn
path: |
build/windows-arm64-e2e-diagnostics
test-results/e2e
playwright-report