CI that runs what you run
You will: Make CI execute exactly what you run locally, and make it check decisions as well as tests.
Builds on A simulator that runs in CI and Keeping the suite fast is a feature you maintain.
The principle is one sentence: CI runs what you run. It builds the
same Dockerfile, to the ci stage, and executes the same commands
your machine does. A green tick means the thing you ran passed — not
that a parallel pipeline happens to agree with it.
Two architectures, deliberately. Development happens on Apple Silicon and most servers are x86. Running both is the only way to catch divergence in either direction.
Beyond "the tests pass", CI asserts three decisions, because decisions rot silently:
- No mixed Gazebo installation — fail if any Gazebo package resolves from the second apt repository, because the failure otherwise appears much later as a segfault.
xacro.load_yamlstill exists — the single-source design rests on it, and if a future release removed it, this fails with a clear message rather than a confusing expansion error.- The seam is intact — checked on the expanded descriptions as files, not only as a unit test.
And it uploads the expanded robot descriptions as an artefact, so a reviewer can diff the actual robot a pull request produces rather than reasoning about macros.
What CI caught here was mostly habits, not code. A lint failure was missed locally because the output was searched for text instead of the exit status being checked. A release workflow raced the image it was meant to publish. A version tag was pushed without the version file being bumped — and the release refused.
One honest caveat, true of this repository as you read it: CI runs on
pushes to main and on pull requests. Work on a branch that has never
been opened as a pull request has never been through CI, however
green it is locally.
In the simulation
CI's promise is that the same input gives the same result wherever it runs. Record and replay is the arm-sized version: the same setpoints, played again, put the arm in the same place. The page runs on one machine; it cannot show you two architectures, or any CI.
Kinematic: joints move at their real speed limit, but there is no gravity, no load and no physics. That is what the steps below are for.
The SO-101 loads as you reach it.
make drive keysIn this lesson
- Press Record, move two or three joints, and press it again to stop.
- Press
hto home the arm. Note where the recording ended. - Press Replay, and watch the arm end exactly where the recording did.
Joints · SO-101 follower
1–5 joint · , . jog · [ ] jaw · - + step · h home · f frames
the keys of make drive
The buttons do what the keys do: hold one to repeat.
Limits from the description; speed capped at 1.7434 rad/s, the servo's datasheet derated. Poses from the profile.
Inspector
Code
The repository's own code behind what you do here appears once you move the arm.
Do it
Read the workflow. Find the three decision checks.
less .github/workflows/ci.ymlRun CI's seam check yourself, exactly as CI does, inside the container. CI runs it on the profiles this project generates itself; the SO-101's is not in CI yet, because CI does not fetch its description. That is a gap, and a good first contribution.
make shell S=/ws/install/threevn_robot_description/share/threevn_robot_description for t in mock gz esp32; do ros2 run xacro xacro "$S/urdf/threevn_arm.urdf.xacro" params_file:="$S/config/threevn_arm_v1.yaml" target:=$t > /tmp/$t.urdf done ! grep -q "gz_ros2_control\|<gazebo" /tmp/mock.urdf && echo "mock is clean"Push the repository to your own GitHub copy, open a pull request with a deliberately failing test, and watch both architectures go red. Then fix it and watch them go green.
When it goes wrong
Lint "passed" locally and failed in CI.
Why: The local check searched the output for a word rather than checking the exit status.
Fix: Exit codes are the contract. echo $?, or set -e in scripts.
A failure appears only on one architecture.
Why: A binary dependency, a floating-point difference, or an image layer that differs by platform.
Fix: That is the reason both run. Reproduce on the failing architecture before guessing.
Terms
- CI parity
- CI running the same image and the same commands as a developer's machine, so local green and CI green mean the same thing.
- Build matrix
- One job run across several configurations — here amd64 and arm64.
- Decision check
- A CI step that asserts an architectural decision still holds, not just that tests pass.
Every term in the course: glossary.
Check yourself
Answer in your head first, then open it.
Why check in CI that xacro.load_yaml exists, when every test would fail without it anyway?
Every test would fail with a confusing expansion error. The direct check fails with the actual cause, in one line, the first time it happens.
Why upload the expanded descriptions as an artefact?
So a reviewer can diff the robot a pull request actually produces, rather than reasoning about what a macro change does.
Stretch
Pick a decision from docs/decisions/ that CI does not yet check. Add a step to your copy of ci.yml that fails when the decision is violated, and prove it on a pull request that violates it.
Hint
A good decision check fails in one line with the actual cause. The course curriculum is checked this way: python3 scripts/build_site.py --check fails a pull request whose lessons point at a Make target or a document that does not exist.