One proof signal
A test suite is stronger when it runs without you clicking anything. Put it in CI so every push to GitHub runs the same test command.
Recruiters and mentors can then see a public commit, a workflow run, and a green check. That is better proof than saying “tests pass on my laptop.”
What CI does
CI means continuous integration. For this track, it only needs to do one job: install your project and run tests whenever code is pushed.
GitHub Actions is free enough for most student public repos. It reads a workflow file from your repo and runs the commands on a clean machine.
Before you add CI
Do each one yourself, then tap it to tick it off. The ticks are only a checklist for you: they are not marked or scored.
0 of 4 done
Node.js workflow
Create this file in your repo. Use it if your project has package.json and runs tests with npm test.
The workflow installs dependencies with npm ci, then runs your test script on every push and pull request.
# .github/workflows/tests.yml
name: Tests
on:
push:
pull_request:
jobs:
test:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Set up Node.js
uses: actions/setup-node@v4
with:
node-version: 20
- name: Install dependencies
run: npm ci
- name: Run tests
run: npm testPython workflow
Use this version if your tests run with pytest. Keep a requirements.txt file in the repo, or change the install step to match your project.
If you use FastAPI, Flask, or Django, this same pattern still works. CI should run the command you already use locally.
# .github/workflows/tests.yml
name: Tests
on:
push:
pull_request:
jobs:
test:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: "3.11"
- name: Install dependencies
run: pip install -r requirements.txt
- name: Run tests
run: pytestUse AI carefully
You can ask ChatGPT or Gemini: “Write a GitHub Actions workflow for my repo. It uses Node 20 and npm test.” Paste your package.json or test command too.
Check what it gives back. The file path must be .github/workflows/tests.yml. The run command must match your real local command. Do not add secrets or deployment steps for this lesson.
Green by accident
A workflow can pass even when it did not run your real tests. This happens when npm test only prints a message, or when pytest finds zero tests.
Open the workflow log after the first run. Look for your test runner output and the number of tests. Fix the script if CI is only pretending to test.
// package.json
{
"scripts": {
"test": "jest"
}
}Do this now
Do each one yourself, then tap it to tick it off. The ticks are only a checklist for you: they are not marked or scored.
0 of 5 done