mirror of https://github.com/aya-rs/aya
You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
80 lines
3.4 KiB
Plaintext
80 lines
3.4 KiB
Plaintext
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<void>
|
|
output success: Block<void>
|
|
output finished: Block<void>
|
|
output error: Block<void>
|
|
{
|
|
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<void>
|
|
output success: Block<void>
|
|
output finished: Block<void>
|
|
output error: Block<void>
|
|
{
|
|
prepareSystem: localStep[logger=logger](
|
|
name = |format("setupToolchain ({rust_target})", |entry("rust_target", rust_target)),
|
|
commands = |raw_commands([
|
|
|format("echo GithubEnv /tmp/{rust_target}/github.env", |entry("rust_target", rust_target)),
|
|
|format("mkdir -p /tmp/{rust_target}", |entry("rust_target", rust_target)),
|
|
|format("touch /tmp/{rust_target}/github.env", |entry("rust_target", rust_target)),
|
|
|format("ls /tmp/{rust_target}", |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<StringMap>(
|
|
|map([
|
|
|entry("INPUT_TARGET", rust_target),
|
|
|entry("GITHUB_ENV", |format("/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<void>
|
|
output success: Block<void>
|
|
output finished: Block<void>
|
|
output error: Block<void>
|
|
{
|
|
|
|
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
|
|
} |