How to Move Heavy CI Jobs to Nightly Instead of Per-Push
Running a two-hour suite on every push repeats near-identical work dozens of times a day.
Some suites are slow and rarely catch a regression on a single commit. Running them once per night, plus on demand, keeps their coverage while removing the many redundant per-push executions that dominate their cost.
Steps
- Split fast checks (unit, lint) from slow suites (full e2e, fuzz, load).
- Keep fast checks on push and pull_request for developer feedback.
- Move slow suites to
on.schedulewithworkflow_dispatchfor on-demand runs.
Workflow
.github/workflows/nightly.yml
on:
schedule:
- cron: '0 3 * * *' # 03:00 UTC nightly
workflow_dispatch:
jobs:
full-e2e:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- run: npm ci && npm run test:e2e:fullTradeoffs
- A nightly regression is found up to a day later than a per-push one.
- Keep a smoke subset on PRs so obvious breakage is still caught immediately.
Related guides
How to Turn Off Unused Scheduled CI JobsFind and disable scheduled GitHub Actions workflows that no one relies on anymore, so cron jobs stop burning…
How to Batch Small CI Jobs to Cut Startup OverheadCombine many tiny CI jobs into fewer batched jobs so you stop paying repeated checkout and setup overhead, cu…