hammerkit

Tutorials

Build, test and cache a small project in your language, the same way on your laptop and in CI.

Each tutorial takes a small greet project from an empty build file to a cached pipeline that CI runs with one command. The steps are the same in every language:

  1. Pick an image that pins the toolchain, so nothing needs to be installed on the host.
  2. Declare what each task reads (src) and produces (generates).
  3. Order the tasks with deps.
  4. Group everything CI checks in one ci task.
  5. Run it twice: the second run executes nothing.

Dependencies first

Every tutorial except Go starts with a task that only downloads dependencies. It reads nothing but the manifest and the lockfile, so it runs again only when a dependency changes, and the tasks after it build against what it downloaded:

LanguageImageDownload taskKeeps
Node.jsnode:24-alpinenpm cinode_modules
Pythonpython:3.13-slimpip install -r requirements.txt.venv
Rustrust:1.90-slimcargo fetch.cargo-home
Javamaven:3.9-eclipse-temurin-21mvn dependency:go-offline.m2
.NETmcr.microsoft.com/dotnet/sdk:10.0dotnet restore.nuget

A task's outputs have to be inside the project, so where a package manager downloads into the home directory by default, the tutorial points it at a folder in the project. Go is the exception: its module cache can only be set to an absolute path, which differs between your laptop and CI. There the module cache is mounted instead, and every task downloads what's missing from it.

Tested like the code

Every tutorial's project is in the repository's examples/ folder (tutorial-node, tutorial-python, …) and hammerkit's integration tests run it: ci builds from scratch, then a second run has to come entirely from the cache. The build files in the tutorials are those files.

On this page