The runner starts empty
A fresh runner has no copy of your code. Steps fix that: actions are reusable building blocks (uses:) — actions/checkout downloads the repository, actions/setup-node installs the Node.js version you need — and run: does the rest.
uses and run
name: CI
on: push
jobs:
test:
runs-on: ubuntu-latest
steps:
- name: Without checkout
run: ls
- uses: actions/checkout@v4
- name: With checkout
run: ls
- uses: actions/setup-node@v4
with:
node-version: 22
- run: node --version
- run: npm ci
- run: npm test- Failed step → later steps are skipped and the job fails.
- Read the log from the first red step: the real error is usually right there.
- working-directory: api runs a step inside a sub-folder.