Scheduling Nightly Regression

Cron Triggers

Smoke tests run on every pull request (fast feedback). The full regression runs every night on the QA environment, when nobody is deploying. Both GitHub Actions and Jenkins use cron syntax: minute hour day-of-month month day-of-week.

Example

GitHub Actions schedules are in UTC: 20:30 UTC is 2:00 AM IST.

.github/workflows/nightly.yml

on:
  schedule:
    - cron: "30 20 * * 1-5"     # Mon-Fri 02:00 IST
// Jenkinsfile: Jenkins uses the server's time zone; H spreads load across jobs
triggers { cron('H 2 * * 1-5') }

Checking the Time Zone Maths

Example

The most common mistake is forgetting that GitHub cron is UTC. Convert a fixed UTC run time to IST:

import java.time.*;
import java.time.format.*;

public class Main {
    public static void main(String[] args) {
        DateTimeFormatter f = DateTimeFormatter.ofPattern("EEE dd MMM yyyy HH:mm z");
        ZonedDateTime utcRun = ZonedDateTime.of(2026, 3, 16, 20, 30, 0, 0, ZoneId.of("UTC"));
        ZonedDateTime ist = utcRun.withZoneSameInstant(ZoneId.of("Asia/Kolkata"));
        System.out.println("cron 30 20 * * 1-5 runs at " + utcRun.format(f));
        System.out.println("which is                  " + ist.format(f));

        ZonedDateTime wrongGuess = ZonedDateTime.of(2026, 3, 16, 2, 0, 0, 0, ZoneId.of("UTC"));
        System.out.println("cron 0 2 * * * would be   "
                + wrongGuess.withZoneSameInstant(ZoneId.of("Asia/Kolkata")).format(f));
    }
}

Output

cron 30 20 * * 1-5 runs at Mon 16 Mar 2026 20:30 UTC
which is                  Tue 17 Mar 2026 02:00 IST
cron 0 2 * * * would be   Mon 16 Mar 2026 07:30 IST