Skip to content

Commit b209e51

Browse files
committed
Add self-contained GitHub Actions lab
1 parent f96bb94 commit b209e51

1 file changed

Lines changed: 43 additions & 0 deletions

File tree

‎examples/actions/README.md‎

Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
# Controlled GitHub Actions Lab
2+
3+
This lab removes the need to hunt for a random public workflow. Run it in your disposable `git-github-lab` repository.
4+
5+
## 1. Copy the demo
6+
7+
Copy these files into your student lab:
8+
9+
- `examples/actions/demo/app.py` → `app.py`
10+
- `examples/actions/demo/tests/test_app.py` → `tests/test_app.py`
11+
- `examples/actions/basic-python-ci.yml` → `.github/workflows/ci.yml`
12+
13+
Commit and push them.
14+
15+
## 2. Inspect before running
16+
17+
Open `.github/workflows/ci.yml` and identify:
18+
19+
- the events under `on`
20+
- the job under `jobs`
21+
- the runner
22+
- each step
23+
- the command that decides whether the check passes
24+
25+
## 3. Prove green
26+
27+
Open the Actions tab or the commit checks. Confirm the tests pass.
28+
29+
## 4. Break it deliberately
30+
31+
Change `add(2, 3)` in the test expectation so the test is wrong, commit, and push.
32+
33+
Predict the result before checking GitHub.
34+
35+
Confirm the workflow fails and inspect the failing test output.
36+
37+
## 5. Repair
38+
39+
Fix the test, commit, push, and verify the workflow returns to green.
40+
41+
## Pass condition
42+
43+
You can explain why CI is useful, what caused the red check, and why a green check only proves the checks that actually ran—not all possible correctness.

0 commit comments

Comments
 (0)