Test, build, and share data
Separate caches from artifacts
Use dependency caches to save time and workflow artifacts to preserve outputs or evidence between jobs.
9 minute lesson
The package manager cache speeds installation, while the built site and test report are uploaded as artifacts. That contrast gives us something useful to test instead of a rule to memorize.
Caches are optimization keyed for reuse; artifacts are named outputs from one run with retention and download behavior. The useful target is not encyclopedic coverage. Make one deliberate choice, observe its consequences, and know which requirement would make you revise it.
The happy path can hide a bad design: you can use a cache as the release artifact or assume a cache hit means dependencies are trustworthy and still get one successful demo. Push past the demo. key caches from the dependency lock, validate installs, and upload exact build outputs as immutable run artifacts, then test the condition most likely to prove the choice wrong.
The module is moving toward one outcome: Build a fast CI graph that preserves useful evidence without sharing mutable state accidentally. Save the before-and-after evidence now; it will make the final project review much more honest.
Restore a stale cache and prove the clean install corrects it; then download and inspect the build artifact. Save the evidence, then explain which requirement would force you to choose a different design.
Lesson completed