Repository navigation
317 lines (310 loc) · 13.6 KB
/
Copy pathdesktop.yml
File metadata and controls
317 lines (310 loc) · 13.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
name: Desktop validation
on:
workflow_call:
inputs:
suites:
description: Scope already selected by the Main orchestrator
required: true
type: string
push:
branches: [codex/desktop-preview]
workflow_dispatch:
permissions:
actions: read
contents: read
concurrency:
group: desktop-${{ github.event.pull_request.number || github.ref }}-${{ github.event_name }}
cancel-in-progress: true
jobs:
changes:
if: ${{ inputs.suites == '' && github.event_name != 'workflow_dispatch' }}
uses: ./.github/workflows/ci-changes.yml
with:
baseline-workflow: desktop.yml
windows:
needs: changes
if: >-
${{ !cancelled() &&
((inputs.suites == '' && needs.changes.result != 'success') || fromJSON(inputs.suites || needs.changes.outputs.suites || '{}').desktop) }}
runs-on: windows-2025
timeout-minutes: 40
defaults:
run:
working-directory: desktop
shell: pwsh
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7
id: checkout
with:
persist-credentials: false
fetch-depth: 0
- name: Verify Server version baseline tag
run: |
git fetch --no-tags https://github.com/oceanbase/powercontext.git refs/tags/powercontext-v1.0.0:refs/tags/powercontext-v1.0.0
if ($LASTEXITCODE -ne 0) { exit $LASTEXITCODE }
if ((git rev-parse refs/tags/powercontext-v1.0.0) -ne 'ec97efba5f26fc972e9d8bf5027d8233acab3ca1') {
throw 'Unexpected Server version baseline tag'
}
- uses: jdx/mise-action@924e7c586e33d7d4bae9c14e26c5d22e2beb6e78 # v5.3.0
with:
working_directory: desktop
- name: Install pinned Windows Rust toolchain
run: rustup toolchain install 1.95.0-x86_64-pc-windows-msvc --profile minimal --component rustfmt --component clippy
- name: Cache desktop dependencies
uses: ./.github/actions/cache-pnpm
with:
working-directory: desktop
cache-dependency-glob: desktop/pnpm-lock.yaml
- name: Cache Rust dependencies and compilation
uses: Swatinem/rust-cache@d1527c8f67ef9af357290475d4af4b0fab8f12e0 # v2.9.3
with:
workspaces: desktop/src-tauri -> target
key: ${{ hashFiles('desktop/rust-toolchain.toml') }}
cache-bin: false
- name: Install locked dependencies
run: pnpm install --frozen-lockfile
- name: Prepare cached OpenAPI Generator
uses: ./.github/actions/setup-openapi-generator
- run: pnpm lint
- run: pnpm typecheck
- run: pnpm test
- run: pnpm build
- run: cargo fmt --manifest-path src-tauri/Cargo.toml --check
- run: cargo clippy --locked --manifest-path src-tauri/Cargo.toml --all-targets -- -D warnings
- name: Test Windows IPC and Desktop behavior
run: cargo test --locked --manifest-path src-tauri/Cargo.toml
- run: pnpm ipc:check
- name: Verify Windows vault across processes
run: cargo run --locked --manifest-path src-tauri/Cargo.toml --example credential_probe
- name: Set up Python fixture tooling
timeout-minutes: 5
uses: astral-sh/setup-uv@1db35dd8eee11c5894872e0b383ae6c406cf738d # v10.4.0
with:
version: "0.10.12"
# Use the release source directly; a stalled mirror download can exhaust the job budget.
download-from-astral-mirror: false
enable-cache: true
cache-suffix: desktop-${{ github.job }}-py3.12
cache-dependency-glob: |
pyproject.toml
uv.lock
integrations/langchain/pyproject.toml
integrations/langgraph/pyproject.toml
integrations/opendal/pyproject.toml
integrations/deepagents/pyproject.toml
- name: Install locked Server test dependencies
working-directory: .
run: uv sync --locked --python 3.12
- name: Build Server wheel for isolated acceptance
working-directory: .
run: uv build --wheel --out-dir desktop/.artifacts/server-wheel
- name: Qualify the disposable checkout and built-wheel fixture
working-directory: .
run: uv run --no-sync python desktop/tests/fixture_qualification.py --server-commit $env:GITHUB_SHA
- name: Check fixture qualification regressions
working-directory: .
run: uv run --no-sync python -m pytest tests/test_desktop_fixture_qualification.py
- name: Build native API acceptance client
run: cargo build --locked --manifest-path src-tauri/Cargo.toml --example server_probe
- name: Test native adapter with real SQLite Server
working-directory: .
run: uv run --no-sync python desktop/tests/real_server.py
- name: Build unsigned internal Windows installer
run: pnpm desktop:build
- name: Prepare matching WebView2 driver
run: ./scripts/prepare-webdriver.ps1
- name: Smoke test installed package
timeout-minutes: 8
run: ./scripts/windows-smoke.ps1
- name: Upload Windows installer
uses: actions/upload-artifact@cf430e030ddbb5b0abf93d22962f4752f3646cd9 # v7
with:
name: desktop-windows-internal-unsigned
path: desktop/src-tauri/target/release/bundle/nsis/*-setup.exe
if-no-files-found: error
- name: Upload Windows failure diagnostics
if: ${{ failure() && steps.checkout.outcome == 'success' }}
uses: ./.github/actions/upload-ci-diagnostics
with:
name: desktop-windows-failure-diagnostics
include-hidden-files: true
path: |
desktop/.artifacts/ci-compatibility.json
desktop/.artifacts/real-server.json
desktop/.artifacts/real-server-*/
desktop/.artifacts/installed-ui-failure.png
if-no-files-found: ignore
retention-days: 7
macos:
needs: changes
if: >-
${{ !cancelled() &&
((inputs.suites == '' && needs.changes.result != 'success') || fromJSON(inputs.suites || needs.changes.outputs.suites || '{}').desktop) }}
strategy:
fail-fast: false
matrix:
runner: [macos-15, macos-15-intel]
runs-on: ${{ matrix.runner }}
timeout-minutes: 40
defaults:
run:
working-directory: desktop
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7
with:
persist-credentials: false
- uses: jdx/mise-action@924e7c586e33d7d4bae9c14e26c5d22e2beb6e78 # v5.3.0
with:
working_directory: desktop
- run: rustup toolchain install 1.95.0 --profile minimal --component rustfmt --component clippy
- uses: Swatinem/rust-cache@d1527c8f67ef9af357290475d4af4b0fab8f12e0 # v2.9.3
with:
workspaces: desktop/src-tauri -> target
key: macos-${{ matrix.runner }}
cache-bin: false
- run: pnpm install --frozen-lockfile
- name: Prepare cached OpenAPI Generator
uses: ./.github/actions/setup-openapi-generator
- run: pnpm lint
- run: pnpm test
- run: pnpm build
- run: cargo fmt --manifest-path src-tauri/Cargo.toml --check
- run: cargo clippy --locked --manifest-path src-tauri/Cargo.toml --all-targets -- -D warnings
- run: cargo test --locked --manifest-path src-tauri/Cargo.toml
- run: pnpm ipc:check
- name: Set up Python for macOS bundle regressions
if: matrix.runner == 'macos-15'
uses: astral-sh/setup-uv@1db35dd8eee11c5894872e0b383ae6c406cf738d # v10.4.0
with:
version: '0.13.5'
enable-cache: true
- name: Test product resources and deployment metadata with native tools
if: matrix.runner == 'macos-15'
working-directory: .
env:
POWERCONTEXT_TEST_TAURI_PRODUCT_BUNDLE: '1'
run: |
uv sync --locked --no-dev --group resource-build --python 3.12
uv run --no-sync python -m pytest -q \
tests/test_desktop_product.py::test_tauri_cli_bundles_the_complete_helper_inventory \
tests/test_desktop_macos_bundle.py::test_macos_release_bundle_deployment_target
- name: Verify native Keychain across processes
run: cargo run --locked --manifest-path src-tauri/Cargo.toml --example credential_probe
- name: Build unsigned macOS app and DMG
id: macos_build
run: python3 scripts/build_macos.py
- name: Verify the release app's macOS deployment target
run: python3 scripts/check_macos_deployment_target.py src-tauri/target/release/bundle/macos/*.app
- name: Upload macOS build diagnostics
if: ${{ failure() || steps.macos_build.outputs.retried == 'true' }}
uses: ./.github/actions/upload-ci-diagnostics
with:
name: desktop-macos-${{ matrix.runner }}-build-diagnostics
include-hidden-files: true
path: |
desktop/.artifacts/macos-build*.log
desktop/.artifacts/macos-packaging-diagnostics.log
desktop/src-tauri/target/release/bundle/dmg/bundle_dmg.sh
desktop/src-tauri/target/release/bundle/share/create-dmg/support/
if-no-files-found: warn
retention-days: 7
- uses: actions/upload-artifact@cf430e030ddbb5b0abf93d22962f4752f3646cd9 # v7
with:
name: desktop-macos-${{ matrix.runner }}-internal-unsigned
path: desktop/src-tauri/target/release/bundle/dmg/*.dmg
if-no-files-found: error
linux:
needs: changes
if: >-
${{ !cancelled() &&
((inputs.suites == '' && needs.changes.result != 'success') || fromJSON(inputs.suites || needs.changes.outputs.suites || '{}').desktop) }}
# Ubuntu Desktop qualification is optional under #2112; required Windows
# and macOS validation must remain independent of a Linux failure.
continue-on-error: true
runs-on: powercontext-ci-standard
timeout-minutes: 40
defaults:
run:
working-directory: desktop
shell: bash
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7
with:
persist-credentials: false
- name: Install Linux Desktop dependencies
uses: ./.github/actions/install-ubuntu-packages
with:
packages: >-
build-essential dbus-x11 gnome-keyring libayatana-appindicator3-dev
libgtk-3-dev libsecret-1-dev libssl-dev libwebkit2gtk-4.1-dev librsvg2-dev
libxdo-dev openjdk-17-jre-headless pkg-config
- uses: ./.github/actions/setup-mise
with:
working_directory: desktop
- name: Install pinned Linux Rust toolchain
uses: ./.github/actions/setup-rust-toolchain
with:
toolchain: '1.95.0'
components: rustfmt clippy
- name: Cache desktop dependencies
uses: ./.github/actions/cache-pnpm
with:
working-directory: desktop
cache-dependency-glob: desktop/pnpm-lock.yaml
- name: Cache Rust dependencies and compilation
id: rust-cache
uses: ./.github/actions/setup-rust-cache
with:
workspaces: desktop/src-tauri -> target
key: linux
cache-bin: false
- name: Fetch locked Rust dependencies through the mirror
uses: ./.github/actions/setup-cargo-mirror
with:
manifest-path: desktop/src-tauri/Cargo.toml
toolchain: '1.95.0'
- name: Install locked dependencies
run: node "$PC_CI_NODE_INSTALLER" pnpm install --frozen-lockfile
- name: Prepare cached OpenAPI Generator
uses: ./.github/actions/setup-openapi-generator
- run: pnpm lint
# Regenerate on the reference platform; Tauri's resized ICO frames vary by host.
- run: pnpm icons:check
- run: pnpm typecheck
- run: pnpm test
- run: pnpm build
- run: cargo fmt --manifest-path src-tauri/Cargo.toml --check
- run: cargo clippy --locked --manifest-path src-tauri/Cargo.toml --all-targets -- -D warnings
- run: cargo test --locked --manifest-path src-tauri/Cargo.toml
- run: pnpm ipc:check
- name: Verify Linux Secret Service across processes
run: |
# Runner Pods have no login session to create the daemon discovery directory.
XDG_RUNTIME_DIR="$(mktemp -d "${RUNNER_TEMP:-/tmp}/desktop-runtime.XXXXXX")"
export XDG_RUNTIME_DIR
trap 'rm -rf -- "$XDG_RUNTIME_DIR"' EXIT
dbus-run-session -- bash -lc '
set -euo pipefail
eval "$(printf "%s\n" powercontext-ci | gnome-keyring-daemon --daemonize --login --components=secrets)"
cargo run --locked --manifest-path src-tauri/Cargo.toml --example credential_probe
'
- name: Build unsigned Debian package
run: pnpm tauri build --bundles deb --ci -- --locked
- name: Verify Debian package
run: |
packages=(src-tauri/target/release/bundle/deb/*.deb)
test "${#packages[@]}" -eq 1
dpkg-deb --info "${packages[0]}"
dpkg-deb --contents "${packages[0]}" >/dev/null
- name: Save Linux Rust dependencies and compilation
if: (success() || failure()) && steps.rust-cache.outputs.cache-backend == 's3' && steps.rust-cache.outputs.cache-hit != 'true'
uses: ./.github/actions/cache-save
with:
path: ${{ steps.rust-cache.outputs.cache-path }}
key: ${{ steps.rust-cache.outputs.cache-key }}
- name: Upload Debian package
uses: actions/upload-artifact@cf430e030ddbb5b0abf93d22962f4752f3646cd9 # v7
with:
name: desktop-linux-ubuntu-24.04-internal-unsigned
path: desktop/src-tauri/target/release/bundle/deb/*.deb
if-no-files-found: error