Short, self-study exercises — each takes minutes to an hour. Exercises 2–4 are hands-on; keep the Actions tab open.
A teammate wrote this workflow. It contains three mistakes. Find them by reading only — then check yourself.
name: CI
on:
pull-request:
jobs:
test:
runs-on: ubuntu latest
steps:
- uses: actions/setup-java@v4
with:
distribution: temurin
java-version: '25'
- name: Run tests
run: mvn --batch-mode verify
Meet the machine your pipelines run on.
<aside> ⌨️
Hands on: create a new empty repository (this is a sandbox — not your project). Add .github/workflows/hello.yaml that triggers on: push and runs these steps, then push and read the log of each step:
</aside>
- name: Who and where am I?
run: |
whoami
pwd
ls -la
- uses: actions/checkout@v4
- name: And now?
run: ls -la
- name: What is in the environment?
run: printenv | sort | head -30
Notice: before checkout the folder is empty; after checkout your repository appears; and the environment contains GitHub's variables — none of yours. You are on a stranger's fresh computer, and now you have seen it with your own eyes.
In your project's workflow, temporarily remove the cache: maven line, push, and note the duration of the Run tests step in the run summary. Put the line back, push again twice, and compare the durations of the second and third runs.
This only works after you set up branch protection from the GitHub Actions chapter.
<aside> ⌨️
Hands on: on a new branch, change one assertion in a test so it fails. Push, open a pull request, and watch: the check turns red and the merge button is disabled. Read the CI log and find which test failed and why — practise the four-step reading routine. Then fix the test, push, and watch the button come back.
</aside>
<aside> 🎉
You have now seen the gate catch a real (well, staged) bug before it reached main. That moment — red check, disabled button — is CI doing its job.
</aside>
The HackYourFuture curriculum is licensed under CC BY-NC-SA 4.0 *https://hackyourfuture.net/*

Built with ❤️ by the HackYourFuture community · Thank you, contributors
Found a mistake or have a suggestion? Let us know in the feedback form.