The workflow
The job installsmomentic from devDependencies, so your lockfile pins the
CLI version. Add it once with npm install -D momentic.
.github/workflows/nightly.yml
Decisions
- Shards. Size
--shard-countto keep each shard under ~15 minutes. Hosted browsers (browser.remoteBrowser: true) remove the browser footprint from your runners and raise parallelism; see hosted test environments. - Environment.
--env stagingpicks thestagingentry inmomentic.config.yaml; secrets for it live in CI, not the repo. See environments. - One run group. Merging shard output keeps the dashboard view and triage scoped to the whole night, not four partial views.
- Triage in the same job. Running
ai triageafter the upload lets auto-maintenance repair drifted tests before the next night, and classifications land on the merged run group. workflow_dispatch. Keep the manual trigger; debugging a nightly should not require a fake commit.
Triage failures
A nightly suite fails more often than a PR gate, by design. Keep it actionable:- Quarantine flakes instead of deleting them; they keep producing data.
- Give each test an
owner:label so the right person reads the failure. - Watch the trend, not one night: a test that fails twice in a week wants a fix, not a retry.