Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 0 additions & 3 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -120,9 +120,6 @@ jobs:

- uses: ./.github/actions/setup

- name: install guard unit
run: bun run test:install-guard

- uses: actions/cache@27d5ce7f107fe9357f9df03efb73ab90386fccae # actions/cache@v5
with:
path: .turbo/cache
Expand Down
46 changes: 46 additions & 0 deletions .github/workflows/desktop-smoke.yml
Original file line number Diff line number Diff line change
Expand Up @@ -147,6 +147,10 @@ jobs:
- name: Install dependencies
run: bun install --frozen-lockfile

- name: Assert Electron install complete (pre-repair)
run: node ./scripts/repair-electron-install.mjs --assert-complete
working-directory: packages/desktop-electron

- name: Repair Electron install
run: node ./scripts/repair-electron-install.mjs
working-directory: packages/desktop-electron
Expand Down Expand Up @@ -259,6 +263,41 @@ jobs:
env:
PAWWORK_CI_SMOKE_CDP: "true"

install-matrix:
needs: changes
if: needs.changes.outputs.docs_only != 'true'
strategy:
matrix:
node-version: ["24", "26"]
runs-on: macos-14
timeout-minutes: 10
steps:
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # actions/checkout@v6
with:
persist-credentials: false

- uses: actions/setup-node@48b55a011bda9f5d6aeb4c2d9c7362e8dae4041e # actions/setup-node@v6.4.0
with:
node-version: ${{ matrix.node-version }}

- uses: oven-sh/setup-bun@0c5077e51419868618aeaa5fe8019c62421857d6 # oven-sh/setup-bun@v2
with:
bun-version: "1.3.14"

- uses: actions/cache@27d5ce7f107fe9357f9df03efb73ab90386fccae # actions/cache@v5
with:
path: ~/.bun/install/cache
key: bun-${{ runner.os }}-${{ hashFiles('bun.lock') }}
restore-keys: |
bun-${{ runner.os }}-

- name: Install dependencies
run: bun install --frozen-lockfile

- name: Assert Electron install complete
run: node ./scripts/repair-electron-install.mjs --assert-complete
working-directory: packages/desktop-electron

# Compatibility aggregator for branch protection setups that require
# `desktop-smoke / check`. The live dev ruleset currently requires
# `smoke-macos-arm64` directly, so every blocking job added above should
Expand All @@ -268,12 +307,14 @@ jobs:
needs:
- changes
- smoke-macos-arm64
- install-matrix
runs-on: ubuntu-latest
steps:
- name: Validate desktop smoke result
env:
DOCS_ONLY: ${{ needs.changes.outputs.docs_only }}
SMOKE_RESULT: ${{ needs.smoke-macos-arm64.result }}
INSTALL_MATRIX_RESULT: ${{ needs.install-matrix.result }}
run: |
set -euo pipefail

Expand All @@ -286,3 +327,8 @@ jobs:
echo "smoke-macos-arm64=$SMOKE_RESULT"
exit 1
fi

if [ "$INSTALL_MATRIX_RESULT" != "success" ]; then
echo "install-matrix=$INSTALL_MATRIX_RESULT"
exit 1
fi
42 changes: 15 additions & 27 deletions bun.lock

Large diffs are not rendered by default.

2 changes: 0 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,7 @@
"typecheck": "bun turbo typecheck",
"lint": "eslint \"packages/{app,ui,desktop-electron}/src/**/*.{ts,tsx}\"",
"lint:ci": "bun run lint",
"preinstall": "node script/check-node.mjs",
"postinstall": "bun run --cwd packages/opencode fix-node-pty",
"test:install-guard": "cd script && bun test check-node.test.mjs",
"test": "echo 'do not run tests from root' && exit 1"
},
"workspaces": {
Expand Down
2 changes: 1 addition & 1 deletion packages/desktop-electron/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@
"@types/ws": "^8.18.1",
"@typescript/native-preview": "catalog:",
"@valibot/to-json-schema": "1.6.0",
"electron": "40.8.0",
"electron": "40.10.3",
"electron-builder": "^26",
"electron-vite": "^5",
"sharp": "0.34.5",
Expand Down
59 changes: 54 additions & 5 deletions packages/desktop-electron/scripts/repair-electron-install.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -38,10 +38,9 @@ export function isElectronInstallComplete(electronDir, platform = process.platfo
"Frameworks",
"Electron Framework.framework",
)
return [
join(frameworkDir, "Electron Framework"),
join(frameworkDir, "Versions", "A", "Electron Framework"),
].some((candidate) => existsSync(candidate))
return [join(frameworkDir, "Electron Framework"), join(frameworkDir, "Versions", "A", "Electron Framework")].some(
(candidate) => existsSync(candidate),
)
}

return true
Expand Down Expand Up @@ -216,6 +215,56 @@ export function repairElectronInstall() {
repairElectronInstallAt(electronDir)
}

export function assertElectronInstallComplete(
electronDir = join(require.resolve("electron/package.json"), ".."),
platform = process.platform,
) {
const platformPath = platformPathForElectron(platform)
const binaryPath = join(electronDir, "dist", platformPath)

if (!existsSync(binaryPath)) {
throw new Error(`Electron binary missing: ${binaryPath}`)
}

if (platform === "darwin" || platform === "mas") {
const frameworkDir = join(
electronDir,
"dist",
"Electron.app",
"Contents",
"Frameworks",
"Electron Framework.framework",
)
const frameworkBinary = [
join(frameworkDir, "Electron Framework"),
join(frameworkDir, "Versions", "A", "Electron Framework"),
].find((candidate) => existsSync(candidate))

if (!frameworkBinary) {
throw new Error(`Electron Framework binary missing in ${frameworkDir}`)
}
}

let pathContent
try {
pathContent = readFileSync(join(electronDir, "path.txt"), "utf8").trim()
} catch {
throw new Error(`Electron path.txt missing: ${join(electronDir, "path.txt")}`)
}

if (pathContent !== platformPath) {
throw new Error(
`Electron path.txt content mismatch: expected ${JSON.stringify(platformPath)}, got ${JSON.stringify(pathContent)}`,
)
}

console.log(`Electron install complete: binary, Framework, and path.txt verified at ${electronDir}`)
}

if (import.meta.url === `file://${process.argv[1]}`) {
repairElectronInstall()
if (process.argv.includes("--assert-complete")) {
assertElectronInstallComplete()
} else {
repairElectronInstall()
}
}
34 changes: 0 additions & 34 deletions script/check-node.mjs

This file was deleted.

47 changes: 0 additions & 47 deletions script/check-node.test.mjs

This file was deleted.

Loading