Skip to content

ci: centralize all tests in main.yml; drop redundant test re-run from publish.yml#1497

Merged
obiot merged 1 commit into
masterfrom
ci/centralize-tests-in-main
Jun 8, 2026
Merged

ci: centralize all tests in main.yml; drop redundant test re-run from publish.yml#1497
obiot merged 1 commit into
masterfrom
ci/centralize-tests-in-main

Conversation

@obiot

@obiot obiot commented Jun 8, 2026

Copy link
Copy Markdown
Member

Two related cleanups that also unblock the 19.7.0 publish:

1. main.yml now gates all package tests, not just melonjs

The adapter test specs (3 × matter, 3 × planck) existed but were only invoked at publish time — PR merges never gated on them. The new `pnpm -F @melonjs/{matter,planck}-adapter test` lines run inside the same `mcr.microsoft.com/playwright:v1.59.1-noble` container the existing melonjs test job uses, so chromium is pre-baked and no install step is needed.

Package Tests in CI BEFORE this PR Tests in CI AFTER
`melonjs` ✅ main.yml ✅ main.yml
`@melonjs/matter-adapter` ❌ publish.yml only ✅ main.yml
`@melonjs/planck-adapter` ❌ publish.yml only ✅ main.yml

Pre-existing CI gap closed.

2. publish.yml stops re-running tests main.yml now gates

  • Drop the `Install Playwright browsers` step entirely (no test step at publish time → no chromium needed)
  • Replace melonjs `pnpm dist` (`clean + lint + vitest + build + doc`) with new `pnpm dist:publish` (drops `vitest`)
  • Drop trailing `&& pnpm test` from matter / planck build_cmd

Also sidesteps a real Playwright bug

We've been blocked all day shipping 19.7.0 because on bare `ubuntu-latest` runners, `playwright install chromium` was hanging indefinitely on the post-download extract step. Download itself completes in <2s; extract emits no further log line and times out the whole job. Six consecutive runs hit the same hang on distinct runners. Identified via the `DEBUG: pw:install` + `timeout-minutes: 10` instrumentation that #1496 added. The container-based path main.yml already uses sidesteps the install entirely.

Test plan

  • `pnpm -F @melonjs/matter-adapter test` locally — 177 / 177 pass
  • `pnpm -F @melonjs/planck-adapter test` locally — 169 / 169 pass
  • `pnpm dist:publish` locally — clean exit, docs generated
  • CI green on this PR — confirms main.yml's adapter test invocations work in the container
  • Merge → dispatch `publish.yml` with `package=melonjs` → ship 19.7.0

🤖 Generated with Claude Code

… publish.yml

Two related cleanups:

1. **main.yml now runs ALL package tests**, not just melonjs. The
   adapter test specs (3 × matter, 3 × planck) existed but were
   only invoked at publish time — meaning PR merges never gated on
   them. The new `pnpm -F @melonjs/{matter,planck}-adapter test`
   lines run inside the same `mcr.microsoft.com/playwright:v1.59.1-noble`
   container the existing melonjs test job uses, so chromium is
   pre-baked, no install step needed.

2. **publish.yml stops re-running tests** that main.yml now gates:
   - Drop the `Install Playwright browsers` step entirely (no
     tests at publish time → no chromium needed).
   - melonjs `pnpm dist` (`clean + lint + vitest + build + doc`) is
     replaced with new `pnpm dist:publish` (drops `vitest`).
   - matter / planck build_cmd drops the trailing `&& pnpm test`.

This also sidesteps a real Playwright bug we've been hitting all day:
on bare `ubuntu-latest` runners, `playwright install chromium` was
hanging indefinitely on the post-download extract step (download
itself completes in <2s; extract emits no further log line and
times out the entire job). Six consecutive runs hit the same hang
on distinct runners. Identified via the `DEBUG: pw:install` +
`timeout-minutes: 10` instrumentation from #1496. Sidestepping the
install entirely is the cleanest fix and aligns with main.yml's
container-based approach anyway.

Local verify:
- `pnpm -F @melonjs/matter-adapter test` → 177 / 177 pass
- `pnpm -F @melonjs/planck-adapter test` → 169 / 169 pass
- `pnpm dist:publish` → clean exit, docs generated

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@obiot obiot merged commit e793183 into master Jun 8, 2026
8 of 9 checks passed
@obiot obiot deleted the ci/centralize-tests-in-main branch June 8, 2026 16:00
obiot added a commit that referenced this pull request Jun 8, 2026
#1497 swapped the publish workflow's build_cmd from `pnpm dist` to
`pnpm dist:publish` (drops the redundant `pnpm vitest run` — main.yml
gates tests now). But `npm publish` ALSO fires the package's own
`prepublishOnly` hook, which still hardcoded `pnpm dist`. So the
workflow built cleanly with the new recipe and then `npm publish`
re-triggered `pnpm dist` → `pnpm vitest run` → died on missing
Playwright browsers.

Point `prepublishOnly` at the same `dist:publish` script the workflow
uses. Keeps the safety net for local manual `npm publish` (build before
shipping) without dragging the broken vitest step back in.

Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant