Lesson 17 / 20
A Minimal Workflow
Write a minimal GitHub Actions YAML workflow that checks out code, sets up Node and 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: 22
- run: npm ci
- run: npm testQuick check: Where must GitHub Actions workflow YAML files live in a repository?
- actions/
- .github/workflows/
- ci/
- .git/hooks/
Answer
.github/workflows/ — GitHub only discovers workflow files inside the .github/workflows/ directory.