|
| 1 | +# Harmont examples |
| 2 | + |
| 3 | +Minimal idiomatic starter projects, each wired up to a Harmont CI pipeline. Every example lives in its own subdirectory with a `.harmont/pipeline.py` you can read, copy, and run via `hm run <slug> --local`. |
| 4 | + |
| 5 | +| Example | Toolchain | Pipeline | |
| 6 | +|---|---|---| |
| 7 | +| [react](./react) | npm + Vite + Vitest + ESLint | `hm.npm(...)` | |
| 8 | +| [nextjs](./nextjs) | npm + Jest + ESLint | `hm.npm(...)` | |
| 9 | +| [typescript](./typescript) | tsc + Vitest + ESLint | `hm.npm(...)` | |
| 10 | +| [rust](./rust) | cargo + clippy + rustfmt | `hm.rust(...)` | |
| 11 | +| [haskell](./haskell) | cabal + hlint + fourmolu | `hm.haskell(ghc="9.6.7")` | |
| 12 | +| [python-uv](./python-uv) | uv + pytest + ruff + mypy | `hm.python(...)` | |
| 13 | +| [go](./go) | go build/test/vet/fmt | `hm.go(...)` | |
| 14 | +| [java](./java) | Gradle + JUnit 5 | `hm.gradle(jdk="21")` | |
| 15 | +| [kotlin](./kotlin) | Gradle + kotlin.test | `hm.gradle(jdk="21", kotlin=True)` | |
| 16 | +| [c](./c) | CMake + CTest + clang-format | `hm.cmake(lang="c")` | |
| 17 | +| [cpp](./cpp) | CMake + CTest + clang-format | `hm.cmake(lang="cpp")` | |
| 18 | +| [csharp](./csharp) | dotnet + xunit + dotnet-format | `hm.dotnet(channel="8.0")` | |
| 19 | +| [ruby](./ruby) | Bundler + RSpec + Rubocop | `hm.ruby(...)` | |
| 20 | +| [perl](./perl) | cpanm + Test::More + Perl::Critic | `hm.perl(...)` | |
| 21 | +| [php-laravel](./php-laravel) | Composer + Laravel test + PHPStan | `hm.composer(laravel=True)` | |
| 22 | +| [ocaml](./ocaml) | opam + Dune + Alcotest | `hm.ocaml(compiler="5.1.1")` | |
| 23 | +| [zig](./zig) | zig build/test/fmt | `hm.zig(version="0.13.0")` | |
| 24 | + |
| 25 | +## How to run an example locally |
| 26 | + |
| 27 | +1. Install the Harmont CLI (`cli/` in this repo, or `cargo install harmont-cli` once published). |
| 28 | +2. `cd examples/<lang>` and run `hm run ci --local`. The CLI uses the project's `.harmont/pipeline.py` and executes each step in a local Docker container, sharing caches across runs. |
| 29 | + |
| 30 | +Every pipeline uses `default_image="ubuntu:24.04"` and the apt-base / language-install steps are cached forever — only the action leaves (`test`, `lint`, etc.) re-run after a code change. |
| 31 | + |
| 32 | +## What to copy |
| 33 | + |
| 34 | +The shape every pipeline shares: a single `@hm.target()` builds the toolchain object once; the `@hm.pipeline("ci")` body returns a tuple of leaves (`build`, `test`, `lint`). Each leaf forks off the shared install step, so adding a fifth check costs you the action — never the install. |
0 commit comments