hearthforge-ci-template.toml
⎇
Raw
1# HearthForge CI Pipeline Template
2# Place this file at .hearthforge-ci.toml in your repository root.
3
4image = "docker.io/debian:stable"
5work_dir = "/ci/build"
6# Must be absolute. The image needs no git. HearthForge exports the commit
7# and uploads it. No .git reaches the container, so `git describe` needs a
8# step that fetches history itself.
9clone_project_to = "/ci/build/project"
10# shell = ["/bin/sh", "-c"]
11shell_setup = "set -euo pipefail"
12# timeout = 3600 # default per-step timeout in seconds
13# cpu_limit = 2.0 # CPU cores limit
14# memory_limit = "2g" # memory limit (k/m/g suffix)
15# Caches persist between runs. An entry is a bare path, or a table with a
16# max_size cap (k/m/g suffix). A capped cache is deleted after the run that
17# takes it over, so the next run starts cold. Uncapped caches grow forever.
18# cache = [
19# { path = "/root/.cargo", max_size = "8g" },
20# "/root/.npm",
21# ]
22# A cache path must not overlap clone_project_to, in either direction. The
23# checkout is extracted over that directory. A `clear` step deletes it.
24
25[on]
26push = ["main"] # trigger on push to these branches; use ["*"] for all
27tag = false # trigger on tag push
28# manual runs are always available from the UI
29
30[variables]
31 # [variables.MY_VAR]
32 # default = "hello"
33 # description = "A custom variable, overridable from the UI"
34
35# Files taken from another image before any step runs, like COPY --from.
36# `to` is a directory and the source basename is kept, so the example below
37# lands at /usr/local/bin/bun. HearthForge creates `to` when it is missing.
38# Match the libc: an -alpine tag is musl and will not run on this glibc image.
39# A "/." suffix on `from` copies the contents instead of the directory itself.
40#
41# [[copy]]
42# image = "docker.io/oven/bun:1.4.0"
43# from = "/usr/local/bin/bun"
44# to = "/usr/local/bin"
45
46# Steps run in file order. Names are labels only, repeats are allowed.
47
48[[steps]]
49name = "setup"
50run_sh = "apt-get update -qq && apt-get install -y --no-install-recommends build-essential"
51timeout = 180
52
53[[steps]]
54name = "lint"
55run_sh = "make -C project lint"
56# warn_on_fail marks the step "warning" instead of failing the run, and the
57# steps after it still run.
58# warn_on_fail = true
59
60[[steps]]
61name = "build"
62run_sh = "make -C project all"
63
64[[steps]]
65name = "test"
66# run_if is a shell expression; the step is skipped if it returns non-zero
67# run_if = 'test -n "${CI_COMMIT_TAG}"'
68run_sh = "make -C project test"
69
70[[steps]]
71name = "package"
72run_sh = "make -C project dist"
73# Publish artifacts — these can appear in any step
74# publish_file: copy a single file directly
75# publish_file = ["/ci/build/project/dist/my-binary"]
76# publish_gzip: create a .tar.gz archive (requires tar in image)
77# publish_gzip = ["/ci/build/project/dist/"]
78# publish_tar: create a plain .tar archive
79# publish_tar = ["/ci/build/project/dist/"]
80# publish_zip: create a .zip archive (requires zip in image)
81# publish_zip = ["/ci/build/project/dist/"]
82# publish_zstd: create a .tar.zst archive (requires tar + zstd in image)
83# publish_zstd = ["/ci/build/project/dist/"]
84
85[[steps]]
86name = "cleanup"
87# always runs the step even when an earlier one failed.
88always = true
89run_sh = "rm -rf /ci/build/scratch"
90