Lesson 16 / 18

A Minimal Workflow

A YAML workflow that runs tests on every push.

Where workflows live

Workflows are YAML files stored under .github/workflows/ — GitHub picks them up automatically.

Run tests on push

This minimal workflow checks out the code, sets up Node.js, and runs the test suite on every push.

name: CI
on: [push]
jobs:
  test:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v4
      - uses: actions/setup-node@v4
        with:
          node-version: 20
      - run: npm install
      - run: npm test

Quick check: Where must GitHub Actions workflow YAML files live in a repository?

  • .github/workflows/
  • actions/
  • ci/
Answer

.github/workflows/ — GitHub only discovers workflow files inside the .github/workflows/ directory.