ci: run the shell's browser tests on the packed tarball, publish on shared code changes

The e2e job's first shard builds the MCP package, packs it, installs the
tarball in an empty directory and runs packages/mcp-server/tests/e2e
against the installed dist/index.js (MCP_SERVER_ENTRY), so a shell that
builds but fails in the browser, or a tarball missing a runtime
dependency, fails the PR. Its traces go with the Playwright report. The
publish workflow also triggers on the web app code the shell is bundled
from (components, contexts, hooks, lib, stores, globals.css) and the
root lockfile.
This commit is contained in:
dayuan.jiang
2026-10-11 20:56:07 +09:00
parent 349ea26d8b
commit 3b3219c73d
3 changed files with 35 additions and 5 deletions
+21 -1
View File
@@ -93,10 +93,30 @@ jobs:
env:
CI: true
# The canvas shell in a browser, from the package as npm installs it:
# the packed tarball goes into an empty directory, its dist/index.js is
# started over stdio and headless Chromium opens the URL start_session
# returns (packages/mcp-server/tests/e2e). Chromium is installed above;
# the build shares the root build's draw.war download.
- name: Run the MCP shell E2E tests on the packed tarball
if: matrix.shard == 1
run: |
npm --prefix packages/mcp-server ci
npm --prefix packages/mcp-server run build
npm pack ./packages/mcp-server --pack-destination "$RUNNER_TEMP/mcp-pack"
mkdir -p "$RUNNER_TEMP/mcp-install"
npm --prefix "$RUNNER_TEMP/mcp-install" install "$RUNNER_TEMP"/mcp-pack/*.tgz
MCP_SERVER_ENTRY="$RUNNER_TEMP/mcp-install/node_modules/@next-ai-drawio/mcp-server/dist/index.js" \
npm --prefix packages/mcp-server run test:e2e
env:
CI: true
- name: Upload test results
uses: actions/upload-artifact@v6
if: always()
with:
name: playwright-report-${{ matrix.shard }}
path: playwright-report/
path: |
playwright-report/
packages/mcp-server/test-results/
retention-days: 7