Curriculum

Curriculum

Run Your Tests on Every Push

Scenario

You push a booking change. The project has a workflow that runs its test command.

  1. 1Check out the pushed commit
  2. 2Set up the runtime and run the project’s test command
  3. 3Read the resulting status
.github/workflows/test.yml
name: Test booking
on: push
permissions:
  contents: read
jobs:
  test:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v6
      - uses: actions/setup-node@v6
        with:
          node-version: 24
      - run: node booking.mjs

Try it yourself

Follow the pushed commit through the checks.

Reveal the explanation
  1. Check out the pushed commit

    The runner reads the files associated with that commit.

  2. Set up the runtime and run the project’s test command

    The same booking cases are evaluated in a clean job.

  3. Read the resulting status

    A failed check gives you a run and a log to investigate.

Begin with a test command that works locally. Use the same command in the workflow. A required check needs a separate branch protection setting.

Your turn

Configure a push workflow with the same test command you ran locally. Inspect the first run.

Common mistake Using a CI command that silently skips the local tests.

Check your work

The run identifies the pushed commit and shows the expected cases executing.