Goal
Each student creates their own website repository and builds a CI pipeline that performs:
Developer
↓
Feature Branch
↓
Push
↓
Pull Request
↓
CI
↓
Checkout
↓
Lint
↓
Test
↓
Security
↓
Build
↓
PASS ✓
↓
Merge
For this homework, the Lint, Test, Security, Build stages can be simple educational checks. They don't need SonarQube, Trivy, or Docker yet.
Part 1 — Create the project
mkdir ci-homework
cd ci-homework
git init
git branch -M main
touch index.html
Add:
<!DOCTYPE html>
<html>
<head>
<title>JumpToTech CI Homework</title>
</head>
<body>
<h1>My DevOps CI Project</h1>
<p>Student: YOUR NAME</p>
<p>I am learning Continuous Integration.</p>
</body>
</html>
Then:
git status
git add .
git commit -m "Create website"
Create an empty GitHub repository named:
ci-homework
Connect it:
git remote add origin YOUR-REPOSITORY-URL
git push -u origin main
Part 2 — Work like a real Developer
Do not build the CI directly on main.
git switch -c feature-ci
Create:
mkdir -p .github/workflows
nano .github/workflows/ci.yml
Part 3 — Create the CI Pipeline
Use:
name: Student CI Pipeline
on:
push:
pull_request:
jobs:
ci:
runs-on: ubuntu-latest
steps:
- name: Checkout Code
uses: actions/checkout@v4
- name: Lint
run: |
echo "Running Lint..."
test -s index.html
- name: Test
run: |
echo "Running Tests..."
grep "DevOps" index.html
- name: Security Check
run: |
echo "Running Security Check..."
if grep -qi "password" index.html; then
echo "Security check failed"
exit 1
fi
echo "Security check passed"
- name: Build
run: |
echo "Running Build..."
mkdir -p build
cp index.html build/index.html
test -f build/index.html
- name: CI Complete
run: echo "CI PIPELINE PASSED"
Tell students:
These are simplified educational checks. The purpose is to understand pipeline structure and failure behavior before we introduce professional Lint, Test, Security and Build tools.
Part 4 — Understand every stage
They must be able to explain:
Checkout
↓
Get repository code onto Runner
Lint
↓
Basic file/code validation
Test
↓
Check expected content/behavior
Security
↓
Look for an intentionally unsafe pattern
Build
↓
Produce build output
They should not receive full credit simply because everything is green.
They need to explain what each stage does.
Part 5 — Commit and Push
git status
git diff
git add .
git commit -m "Add CI pipeline"
git push -u origin feature-ci
Then create:
feature-ci
↓
Pull Request
↓
main
Do not merge yet.
First check GitHub Actions.
Goal:
✓ Checkout
✓ Lint
✓ Test
✓ Security Check
✓ Build
✓ CI Complete
Part 6 — BREAK the Pipeline
This part is mandatory.
Change:
<p>I am learning Continuous Integration.</p>
and remove the word:
DevOps
from the entire index.html.
Commit:
git add .
git commit -m "Test CI failure"
git push
Because CI contains:
grep "DevOps" index.html
the Test stage should fail:
✓ Checkout
✓ Lint
✗ Test
- Security
- Build
Students must open the failed workflow and read the logs.
Part 7 — Troubleshoot
They should answer:
Which Job failed?
Which Step failed?
Which command failed?
Why did it fail?
What should I change?
Then put DevOps back into index.html.
git add .
git commit -m "Fix failed CI test"
git push
Now:
FAIL ✗
↓
Read Logs
↓
Find Root Cause
↓
Fix
↓
Commit
↓
Push
↓
PASS ✓
Part 8 — Security Failure Challenge
Now intentionally add:
<p>password=123456</p>
Commit and push:
git add .
git commit -m "Test security check"
git push
This time students should see:
✓ Checkout
✓ Lint
✓ Test
✗ Security Check
Ask them:
Why didn't Build run?
Because an earlier required step failed.
Then remove:
password=123456
Commit and push again.
Goal:
✓ Checkout
✓ Lint
✓ Test
✓ Security Check
✓ Build
✓ CI Complete
Part 9 — Merge only after Green
Now return to the Pull Request.
Only when CI is:
✓ GREEN
merge:
feature-ci
↓
PR
↓
CI ✓
↓
Review
↓
Merge
↓
main
Then locally:
git switch main
git pull origin main
Check:
git log --oneline
What Students Must Submit
Send me:
- GitHub repository link
- Screenshot of Pull Request
- Screenshot of successful green CI
- Screenshot of failed Test
- Screenshot showing the Test error/log
- Screenshot of failed Security Check
- Screenshot of final successful pipeline
- Screenshot showing the merged PR
And prepare to explain Monday:
What is CI?
What is a Pipeline?
What is a Trigger?
What is a Runner?
What does Checkout do?
What is a Job?
What is a Step?
What is Lint?
What is Test?
What is Security Check?
What is Build?
Why did your Test fail?
Why did your Security Check fail?
How did you troubleshoot them?
Why should CI pass before Merge?
The rule for the homework
Do not just send me a green check. Be ready to explain how you made it RED, how you found the problem, how you fixed it, and how you made it GREEN again.
Top comments (0)