fix(cli): harden static path resolve and log missing vscode-web assets #15
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
| name: CI | |
| on: | |
| push: | |
| branches: [main, master] | |
| pull_request: | |
| workflow_dispatch: | |
| inputs: | |
| heavy_build: | |
| description: "Optional fat VS Code build (manual only)" | |
| type: choice | |
| required: false | |
| default: none | |
| options: | |
| - none | |
| - reh | |
| - web | |
| - reh-and-e2e | |
| concurrency: | |
| group: ci-${{ github.workflow }}-${{ github.ref }} | |
| cancel-in-progress: true | |
| jobs: | |
| monorepo: | |
| name: Build & test | |
| runs-on: ubuntu-latest | |
| timeout-minutes: 20 | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: pnpm/action-setup@v4 | |
| with: | |
| version: 11.11.0 | |
| - uses: actions/setup-node@v4 | |
| with: | |
| node-version: "22" | |
| cache: pnpm | |
| - name: Install | |
| run: pnpm install --frozen-lockfile | |
| - name: Typecheck | |
| run: pnpm typecheck | |
| - name: Build | |
| run: pnpm build | |
| - name: Test | |
| run: pnpm test | |
| - name: Guard against test-web in release paths | |
| run: bash scripts/check-no-test-web-in-release.sh | |
| e2e: | |
| name: Playwright e2e | |
| runs-on: ubuntu-latest | |
| timeout-minutes: 25 | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: pnpm/action-setup@v4 | |
| with: | |
| version: 11.11.0 | |
| - uses: actions/setup-node@v4 | |
| with: | |
| node-version: "22" | |
| cache: pnpm | |
| - name: Install | |
| run: pnpm install --frozen-lockfile | |
| - name: Build surfaces | |
| run: | | |
| pnpm --filter @zcode/cli build | |
| pnpm --filter @zcode/web build | |
| pnpm --filter zcode-browser-fs build | |
| pnpm --filter zcode-git build | |
| pnpm --filter @zcode/workbench build | |
| - name: Stage vscode-web (dogfood) | |
| run: bash scripts/fetch-vscode-web.sh | |
| - name: Install Playwright Chromium | |
| run: pnpm --filter @zcode/e2e install-browsers | |
| - name: Run Playwright | |
| run: pnpm --filter @zcode/e2e test | |
| env: | |
| CI: true | |
| ZCODE_E2E_PORT: 15010 | |
| - name: Upload report on failure | |
| if: failure() | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: playwright-report | |
| path: e2e/playwright-report | |
| if-no-files-found: ignore | |
| vscode-patches: | |
| name: VS Code patches (quilt) | |
| runs-on: ubuntu-latest | |
| timeout-minutes: 30 | |
| # Only when submodule is present in the commit | |
| steps: | |
| - uses: actions/checkout@v4 | |
| with: | |
| submodules: false | |
| - name: Check submodule registration | |
| id: sub | |
| run: | | |
| if [[ -f .gitmodules ]] && grep -q 'vendor/vscode' .gitmodules; then | |
| echo "present=true" >> "$GITHUB_OUTPUT" | |
| else | |
| echo "present=false" >> "$GITHUB_OUTPUT" | |
| echo "No vendor/vscode submodule yet — skip" | |
| fi | |
| - name: Install quilt | |
| if: steps.sub.outputs.present == 'true' | |
| run: sudo apt-get update && sudo apt-get install -y quilt | |
| - name: Sync vscode + apply patches | |
| if: steps.sub.outputs.present == 'true' | |
| run: | | |
| git submodule update --init --depth 1 vendor/vscode | |
| bash scripts/sync-vscode.sh | |
| - name: build-server prerequisites | |
| if: steps.sub.outputs.present == 'true' | |
| run: bash scripts/build-server.sh --check | |
| - name: build-web prerequisites | |
| if: steps.sub.outputs.present == 'true' | |
| run: bash scripts/build-web.sh --check | |
| # Full REH / owned web compile is intentionally manual — multi-hour, large disk. | |
| # Node 24 matches vendor/vscode/.nvmrc (pin 1.129). | |
| # Trigger: Actions → CI → Run workflow → heavy_build = reh | web | reh-and-e2e | |
| vscode-reh-build: | |
| name: VS Code REH build (manual) | |
| if: > | |
| github.event_name == 'workflow_dispatch' && | |
| (github.event.inputs.heavy_build == 'reh' || | |
| github.event.inputs.heavy_build == 'reh-and-e2e') | |
| runs-on: ubuntu-latest | |
| timeout-minutes: 360 | |
| steps: | |
| - uses: actions/checkout@v4 | |
| with: | |
| submodules: recursive | |
| - uses: actions/setup-node@v4 | |
| with: | |
| node-version: "24" | |
| - name: Free disk | |
| run: | | |
| df -h | |
| sudo rm -rf /usr/share/dotnet /usr/local/lib/android /opt/ghc /usr/local/share/powershell /usr/share/swift || true | |
| # Drop large preinstalled toolchains used by GitHub runners | |
| sudo docker system prune -af || true | |
| df -h | |
| - name: Build REH | |
| env: | |
| ZCODE_REH_PLATFORM: linux | |
| ZCODE_REH_ARCH: x64 | |
| # Helps @vscode/ripgrep postinstall avoid anonymous GitHub 403s | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| run: bash scripts/build-server.sh | |
| - name: Upload dist/server | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: zcode-reh-linux-x64 | |
| path: dist/server | |
| if-no-files-found: error | |
| retention-days: 14 | |
| vscode-web-build: | |
| name: Owned vscode-web build (manual) | |
| if: > | |
| github.event_name == 'workflow_dispatch' && | |
| github.event.inputs.heavy_build == 'web' | |
| runs-on: ubuntu-latest | |
| timeout-minutes: 360 | |
| steps: | |
| - uses: actions/checkout@v4 | |
| with: | |
| submodules: recursive | |
| - uses: actions/setup-node@v4 | |
| with: | |
| node-version: "24" | |
| - name: Free disk | |
| run: | | |
| df -h | |
| sudo rm -rf /usr/share/dotnet /usr/local/lib/android /opt/ghc /usr/local/share/powershell /usr/share/swift || true | |
| sudo docker system prune -af || true | |
| df -h | |
| - name: build-web check | |
| run: bash scripts/build-web.sh --check | |
| - name: Package owned vscode-web | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| run: bash scripts/build-web.sh --package | |
| - name: Verify owned marker | |
| run: | | |
| test -f dist/vscode-web/.zcode-vscode-web.json | |
| grep -q '"source": "owned"' dist/vscode-web/.zcode-vscode-web.json | |
| test -f dist/vscode-web/out/vs/loader.js | |
| - name: Upload dist/vscode-web | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: zcode-vscode-web | |
| path: dist/vscode-web | |
| if-no-files-found: error | |
| retention-days: 14 | |
| # R6 after REH artifact exists — not on default PR path. | |
| vscode-reh-e2e: | |
| name: R6 REH terminal e2e (manual) | |
| if: > | |
| github.event_name == 'workflow_dispatch' && | |
| github.event.inputs.heavy_build == 'reh-and-e2e' | |
| needs: [vscode-reh-build] | |
| runs-on: ubuntu-latest | |
| timeout-minutes: 45 | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: pnpm/action-setup@v4 | |
| with: | |
| version: 11.11.0 | |
| - uses: actions/setup-node@v4 | |
| with: | |
| node-version: "22" | |
| cache: pnpm | |
| - name: Install | |
| run: pnpm install --frozen-lockfile | |
| - name: Download REH artifact | |
| uses: actions/download-artifact@v4 | |
| with: | |
| name: zcode-reh-linux-x64 | |
| path: dist/server | |
| # Artifact zips often drop +x; also flatten accidental nesting from upload path. | |
| - name: Normalize dist/server layout | |
| run: | | |
| set -euo pipefail | |
| # Flatten if artifact was nested (dist/server/dist/server or artifact name folder) | |
| for nested in dist/server/dist/server "dist/server/zcode-reh-linux-x64"; do | |
| if [[ -d "${nested}" ]] && [[ -f "${nested}/.zcode-build.json" || -d "${nested}/bin" ]]; then | |
| echo "Flattening nested REH layout from ${nested}" | |
| shopt -s dotglob | |
| tmp="$(mktemp -d)" | |
| mv "${nested}"/* "${tmp}/" | |
| rm -rf dist/server | |
| mkdir -p dist/server | |
| mv "${tmp}"/* dist/server/ | |
| rmdir "${tmp}" 2>/dev/null || true | |
| fi | |
| done | |
| if [[ -d dist/server/bin ]]; then | |
| chmod +x dist/server/bin/* 2>/dev/null || true | |
| find dist/server/bin -type f -exec chmod +x {} + 2>/dev/null || true | |
| fi | |
| [[ -f dist/server/node ]] && chmod +x dist/server/node || true | |
| [[ -f dist/server/server.sh ]] && chmod +x dist/server/server.sh || true | |
| test -f dist/server/.zcode-build.json | |
| test -f dist/server/bin/code-server-oss \ | |
| -o -f dist/server/bin/code-server \ | |
| -o -f dist/server/server.sh | |
| echo "REH marker:" && cat dist/server/.zcode-build.json | |
| ls -la dist/server/bin 2>/dev/null | head -20 | |
| - name: Build surfaces | |
| run: | | |
| pnpm --filter @zcode/cli build | |
| pnpm --filter @zcode/server build | |
| pnpm --filter @zcode/web build | |
| pnpm --filter zcode-browser-fs build | |
| pnpm --filter zcode-git build | |
| pnpm --filter @zcode/workbench build | |
| bash scripts/fetch-vscode-web.sh | |
| - name: Install Playwright Chromium | |
| run: pnpm --filter @zcode/e2e install-browsers | |
| - name: R6 e2e (required + STRICT + PTY hard-fail) | |
| env: | |
| CI: true | |
| ZCODE_E2E_REH_REQUIRED: "1" | |
| # Workbench remote contract + terminal echo (printf zcode_echo_ok) | |
| ZCODE_E2E_REH_STRICT: "1" | |
| # Fail the job if integrated terminal does not print zcode_echo_ok | |
| ZCODE_E2E_REH_PTY_REQUIRED: "1" | |
| ZCODE_E2E_PASSWORD: zcode-e2e | |
| ZCODE_SPAWN_REH: "1" | |
| run: bash scripts/e2e-reh-terminal.sh | |
| - name: Upload report on failure | |
| if: failure() | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: playwright-reh-report | |
| path: e2e/playwright-report | |
| if-no-files-found: ignore |