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