Harmont docs
Examples

Go

A Go module: build, test, vet, and fmt.

A Go module: build, test, vet, and fmt.

Project layout

go.mod
main_test.go
main.go
README.md

Pipeline

.hm/pipeline.py
"""Go example pipeline."""from __future__ import annotationsimport harmont as hmfrom harmont._go import GoToolchain@hm.target()def project() -> GoToolchain:    return hm.go(path=".")@hm.pipeline(    "ci",    env={"CI": "true"},    default_image="ubuntu:24.04",    triggers=[hm.push(branch="main")],)def ci(project: hm.Target[GoToolchain]) -> tuple[hm.Step, ...]:    return (project.build(), project.test(), project.vet(), project.fmt())
.hm/pipeline.ts
import { pipeline, push, type PipelineDefinition } from "@harmont/hm";import { go } from "@harmont/hm/toolchains";const project = go({ path: "." });const pipelines: PipelineDefinition[] = [  {    slug: "ci",    triggers: [push({ branch: "main" })],    pipeline: pipeline(      [project.build(), project.test(), project.vet(), project.fmt()],      { env: { CI: "true" }, defaultImage: "ubuntu:24.04" },    ),  },];export default pipelines;

Run it

hm run ci

On this page