use cicd/naive::localStep use log/logger::Logger use process/command::|raw_commands use std/data/string_map::StringMap use std/data/string_map::|entry use std/data/string_map::|map use std/ops/option::|wrap use std/text/compose::|format treatment checkout[logger: Logger](label: string, repository_clone_url: string, repository_clone_ref: string, clone_directory: string) input trigger: Block output success: Block output finished: Block output error: Block { localStep[logger=logger]( name = label, commands = |raw_commands([ "git config --global url.https://.insteadOf git://", |format("git clone --branch {repository_clone_ref} --depth 1 {repository_clone_url} {clone_directory}", |map([ |entry("repository_clone_ref", repository_clone_ref), |entry("repository_clone_url", repository_clone_url), |entry("clone_directory", clone_directory) ]) ) ]) ) Self.trigger -> localStep.trigger,success -> Self.success localStep.finished --------> Self.finished localStep.error -----------> Self.error } treatment setupToolchain[logger: Logger](rust_target: string) input trigger: Block output success: Block output finished: Block output error: Block { prepareSystem: localStep[logger=logger]( name = |format("setupToolchain ({rust_target})", |entry("rust_target", rust_target)), commands = |raw_commands([ |format("mkdir /tmp/{rust_target}", |entry("rust_target", rust_target)), |format("touch /tmp/{rust_target}/github.env", |entry("rust_target", rust_target)), ${bash -c "curl -L --proto '=https' --tlsv1.2 -sSf https://raw.githubusercontent.com/taiki-e/setup-cross-toolchain-action/refs/tags/v1/main.sh | bash -"}, |format("cat /tmp/{rust_target}/github.env", |entry("rust_target", rust_target)) ]), variables = |wrap( |map([ |entry("INPUT_TARGET", rust_target), |entry("GITHUB_ENV", |format("cat /tmp/{rust_target}/github.env", |entry("rust_target", rust_target))) ]) ) ) Self.trigger -> prepareSystem.trigger,success -> Self.success prepareSystem.finished --------> Self.finished prepareSystem.error -----------> Self.error } treatment prepareRust[logger: Logger](rust_target: string) input trigger: Block output success: Block output finished: Block output error: Block { localStep[logger=logger]( name = |format("prepareRust ({arch})", |entry("arch", rust_target)), commands = |raw_commands([ |format("rustup target add {arch}", |entry("arch", rust_target)), ${bash -c "curl -L --proto '=https' --tlsv1.2 -sSf https://raw.githubusercontent.com/cargo-bins/cargo-binstall/main/install-from-binstall-release.sh | bash -"}, "cargo binstall cargo-hack" ]) ) Self.trigger -> localStep.trigger,success -> Self.success localStep.finished --------> Self.finished localStep.error -----------> Self.error }