Skip to content
Latchkey

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.schedule with workflow_dispatch for 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:full

Tradeoffs

  • 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

Run this faster and cheaper on Latchkey managed runners. Start free →