# HearthForge CI Pipeline Template
# Place this file at .hearthforge-ci.toml in your repository root.

image = "docker.io/debian:stable"
work_dir = "/ci/build"
clone_project_to = "/ci/build/project"
# shell = ["/bin/sh", "-c"]
shell_setup = "set -euo pipefail"
# timeout = 3600        # overall run timeout in seconds
# cpu_limit = 2.0       # CPU cores limit
# memory_limit = "2g"   # memory limit (k/m/g suffix)
# cache = ["/root/.cargo", "/root/.npm"]  # persist between runs

[on]
push = ["main"]   # trigger on push to these branches; use ["*"] for all
tag = false       # trigger on tag push
manual = true     # allow manual trigger from the UI

[variables]
  # [variables.MY_VAR]
  # default = "hello"
  # description = "A custom variable, overridable from the UI"

# Steps are executed in file order. Each [section] is one step.
# Reserved section names: [on], [variables]

[setup]
run_sh = "apt-get update -qq && apt-get install -y --no-install-recommends build-essential"
timeout = 180

[build]
run_sh = "make -C project all"

[test]
# run_if is a shell expression; the step is skipped if it returns non-zero
# run_if = 'test -n "${CI_COMMIT_TAG}"'
run_sh = "make -C project test"

[package]
run_sh = "make -C project dist"
# Publish artifacts — these can appear in any step
# publish_file: copy a single file directly
# publish_file = ["/ci/build/project/dist/my-binary"]
# publish_gzip: create a .tar.gz archive (requires tar in image)
# publish_gzip = ["/ci/build/project/dist/"]
# publish_tar: create a plain .tar archive
# publish_tar = ["/ci/build/project/dist/"]
# publish_zip: create a .zip archive (requires zip in image)
# publish_zip = ["/ci/build/project/dist/"]
# publish_zstd: create a .tar.zst archive (requires tar + zstd in image)
# publish_zstd = ["/ci/build/project/dist/"]
