-
Notifications
You must be signed in to change notification settings - Fork 264
191 lines (170 loc) · 5.7 KB
/
Copy pathdesktop-ci-dev.yml
File metadata and controls
191 lines (170 loc) · 5.7 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
name: Desktop CI Dev
on:
pull_request:
paths:
- 'apps/desktop/**'
- 'apps/controller/**'
- 'apps/web/**'
- 'packages/shared/**'
- 'packages/slimclaw/**'
- 'tests/desktop/**'
- 'scripts/dev-launchd.sh'
- 'tools/dev/**'
- 'scripts/desktop-check-dev.sh'
- 'scripts/desktop-stop-smoke.sh'
- 'scripts/desktop-ci-check.mjs'
- 'scripts/launchd-lifecycle-e2e.sh'
- 'scripts/kill-all.sh'
- 'vitest.config.ts'
- 'tsconfig.base.json'
- 'scripts/postinstall.mjs'
- '.npmrc'
- 'package.json'
- 'pnpm-lock.yaml'
- 'pnpm-workspace.yaml'
- '.github/workflows/desktop-ci-dev.yml'
workflow_dispatch:
push:
branches:
- main
paths:
- 'apps/desktop/**'
- 'apps/controller/**'
- 'apps/web/**'
- 'packages/shared/**'
- 'packages/slimclaw/**'
- 'tests/desktop/**'
- 'scripts/dev-launchd.sh'
- 'tools/dev/**'
- 'scripts/desktop-check-dev.sh'
- 'scripts/desktop-stop-smoke.sh'
- 'scripts/desktop-ci-check.mjs'
- 'scripts/launchd-lifecycle-e2e.sh'
- 'scripts/kill-all.sh'
- 'vitest.config.ts'
- 'tsconfig.base.json'
- 'scripts/postinstall.mjs'
- '.npmrc'
- 'package.json'
- 'pnpm-lock.yaml'
- 'pnpm-workspace.yaml'
- '.github/workflows/desktop-ci-dev.yml'
permissions:
contents: read
concurrency:
group: desktop-ci-dev-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true
jobs:
desktop-ci:
strategy:
fail-fast: false
matrix:
include:
- os: macos
runs_on: macos-14
- os: windows
runs_on: windows-latest
runs-on: ${{ matrix.runs_on }}
timeout-minutes: 45
env:
LANGFUSE_PUBLIC_KEY: ${{ secrets.LANGFUSE_PUBLIC_KEY }}
LANGFUSE_SECRET_KEY: ${{ secrets.LANGFUSE_SECRET_KEY }}
LANGFUSE_BASE_URL: ${{ secrets.LANGFUSE_BASE_URL }}
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Setup pnpm
uses: pnpm/action-setup@v4
with:
version: 10.26.0
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: 24
cache: pnpm
cache-dependency-path: pnpm-lock.yaml
- name: Restore npm cache for runtime installs
uses: actions/cache@v4
with:
path: ~/.npm
key: desktop-npm-cache-${{ runner.os }}-arm64-${{ hashFiles('packages/slimclaw/runtime-seed/package-lock.json', 'apps/controller/static/runtime-plugins/openclaw-weixin/package-lock.json') }}
restore-keys: |
desktop-npm-cache-${{ runner.os }}-arm64-
desktop-npm-cache-${{ runner.os }}-
- name: Restore Electron build caches
uses: actions/cache@v4
with:
path: |
~/Library/Caches/electron
~/Library/Caches/electron-builder
apps/desktop/.cache
key: desktop-electron-cache-${{ runner.os }}-arm64-${{ hashFiles('pnpm-lock.yaml', 'apps/desktop/package.json') }}
restore-keys: |
desktop-electron-cache-${{ runner.os }}-arm64-
desktop-electron-cache-${{ runner.os }}-
- name: Install dependencies
run: pnpm install --frozen-lockfile
- name: Install tmux
if: matrix.os == 'macos'
shell: bash
run: |
set -euo pipefail
brew install tmux
- name: Show desktop toolchain versions
shell: pwsh
run: |
pnpm exec electron --version
if ("${{ matrix.os }}" -eq "macos") {
tmux -V
}
- name: Build all
run: pnpm build
- name: Run unit tests (includes real launchd integration tests on macOS)
run: pnpm test
- name: Launchd lifecycle e2e test
shell: bash
run: bash scripts/launchd-lifecycle-e2e.sh
- name: Verify desktop runtime unit health
if: matrix.os == 'macos'
env:
NEXU_DESKTOP_CHECK_CAPTURE_DIR: ${{ runner.temp }}/desktop-ci
NEXU_USE_LAUNCHD: "0"
run: pnpm check:dev
- name: Verify Windows desktop build pipeline
if: matrix.os == 'windows'
run: pnpm --filter @nexu/desktop build
- name: Capture desktop logs
if: always()
shell: pwsh
run: |
$captureDir = Join-Path $env:RUNNER_TEMP "desktop-ci"
New-Item -ItemType Directory -Force -Path $captureDir | Out-Null
if (Test-Path ".tmp/dev/logs") {
Copy-Item ".tmp/dev/logs" (Join-Path $captureDir "repo-logs") -Recurse -Force
}
if (Test-Path ".tmp/desktop/electron/logs") {
Copy-Item ".tmp/desktop/electron/logs" (Join-Path $captureDir "electron-logs") -Recurse -Force
}
- name: Capture tmux log
if: always() && matrix.os == 'macos'
shell: bash
run: |
set -euo pipefail
mkdir -p "$RUNNER_TEMP/desktop-ci"
if [ -d .tmp/dev/logs ]; then
cp -R .tmp/dev/logs "$RUNNER_TEMP/desktop-ci/repo-logs"
fi
if [ -d .tmp/desktop/electron/logs ]; then
cp -R .tmp/desktop/electron/logs "$RUNNER_TEMP/desktop-ci/electron-logs"
fi
if command -v tmux >/dev/null 2>&1 && tmux has-session -t nexu-desktop 2>/dev/null; then
tmux capture-pane -pt nexu-desktop -S -400 > "$RUNNER_TEMP/desktop-ci/tmux.log"
fi
- name: Upload desktop logs
if: always()
uses: actions/upload-artifact@v4
with:
name: desktop-ci-logs-${{ matrix.os }}
path: ${{ runner.temp }}/desktop-ci
if-no-files-found: warn
retention-days: 7