Liking cljdoc? Tell your friends :D

bsdkrun.ci

CI workflows defined in code instead of YAML.

The workflow is plain data — a map built up threading-style — and the YAML emitted from it is exactly the file bsdkrun ci (and tangled's spindle) consumes: yaml renders it, save! commits it to .tangled/workflows/, and run! executes it in a microVM without a file ever touching the repository.

(-> (ci/workflow "test")
    (ci/on-push "main")
    (ci/deps "clojure" "jdk21")
    (ci/env "CI_FROM" "sdk")
    (ci/step "deps" "clojure -P")
    (ci/step "test" "clojure -X:test")
    (ci/run!))

Code is the source of truth and YAML the wire format, in that order — which is why save! writes a generated-file header: a hand-edit there will be overwritten by the next save.

CI workflows defined in code instead of YAML.

The workflow is plain data — a map built up threading-style — and the YAML
emitted from it is exactly the file `bsdkrun ci` (and tangled's spindle)
consumes: `yaml` renders it, `save!` commits it to `.tangled/workflows/`,
and `run!` executes it in a microVM without a file ever touching the
repository.

    (-> (ci/workflow "test")
        (ci/on-push "main")
        (ci/deps "clojure" "jdk21")
        (ci/env "CI_FROM" "sdk")
        (ci/step "deps" "clojure -P")
        (ci/step "test" "clojure -X:test")
        (ci/run!))

Code is the source of truth and YAML the wire format, in that order — which
is why `save!` writes a generated-file header: a hand-edit there will be
overwritten by the next save.
raw docstring

clone-depthclj

(clone-depth wf depth)

Set the clone depth (default 1).

Set the clone depth (default 1).
sourceraw docstring

depsclj

(deps wf & packages)

Add nixpkgs dependencies — the toolchain the steps run against.

Add nixpkgs dependencies — the toolchain the steps run against.
sourceraw docstring

deps-fromclj

(deps-from wf registry & packages)

Add dependencies from a custom registry (a flake reference).

Add dependencies from a custom registry (a flake reference).
sourceraw docstring

engineclj

(engine wf engine)

Override the engine (nixery by default).

Override the engine (`nixery` by default).
sourceraw docstring

envclj

(env wf k v)

Set a workflow-level environment variable.

Set a workflow-level environment variable.
sourceraw docstring

file-nameclj

(file-name {:keys [name]})

The workflow file name save! writes: <name>.yml.

The workflow file name `save!` writes: `<name>.yml`.
sourceraw docstring

on-pull-requestclj

(on-pull-request wf & branches)

Add a pull_request trigger targeting the given branches.

Add a pull_request trigger targeting the given branches.
sourceraw docstring

on-pushclj

(on-push wf & branches)

Add a push trigger for the given branches.

Add a push trigger for the given branches.
sourceraw docstring

run!clj

(run! wf)
(run! wf {:keys [dir]})

Execute the workflow in a microVM, streaming output. The YAML never touches the repository — it goes to a temp file and bsdkrun ci run -f. Returns true when every step passed; throws when the run fails.

Options: :dir — the repository to run against (default: cwd).

Execute the workflow in a microVM, streaming output. The YAML never
touches the repository — it goes to a temp file and `bsdkrun ci run -f`.
Returns true when every step passed; throws when the run fails.

Options: `:dir` — the repository to run against (default: cwd).
sourceraw docstring

save!clj

(save! wf repo)

Write into <repo>/.tangled/workflows/ and return the path.

Write into `<repo>/.tangled/workflows/` and return the path.
sourceraw docstring

skip-cloneclj

(skip-clone wf)

Skip the checkout entirely.

Skip the checkout entirely.
sourceraw docstring

stepclj

(step wf name command)
(step wf name command step-env)

Append a step; steps run serially in one VM, from the workspace root. An optional trailing map sets step-scoped environment variables.

Append a step; steps run serially in one VM, from the workspace root.
An optional trailing map sets step-scoped environment variables.
sourceraw docstring

workflowclj

(workflow name)

Start a CI workflow definition.

Start a CI workflow definition.
sourceraw docstring

yamlclj

(yaml wf)

Render the workflow file. Scalars are emitted as JSON strings — valid YAML by construction — and commands as literal blocks when safe.

Render the workflow file. Scalars are emitted as JSON strings — valid YAML
by construction — and commands as literal blocks when safe.
sourceraw docstring

cljdoc builds & hosts documentation for Clojure/Script libraries

Keyboard shortcuts
Ctrl+kJump to recent docs
Move to previous article
Move to next article
Ctrl+/Jump to the search field
× close