mirror of https://github.com/aya-rs/aya
Making full build_test_aya run with Mélodium
parent
f5901900cb
commit
31cb3a7e3d
@ -1,156 +0,0 @@
|
|||||||
use cicd/logging::manageLogs
|
|
||||||
use cicd/services/github::prepareContexts
|
|
||||||
use cicd/services/github::postGithubStateContext
|
|
||||||
use cicd/services/github::|pending
|
|
||||||
use cicd/services/github::|success
|
|
||||||
use cicd/services/github::|error
|
|
||||||
use cicd/services/github::|failure
|
|
||||||
use cicd/naive::localStep
|
|
||||||
use log/logger::Logger
|
|
||||||
use javascript::JavaScriptEngine
|
|
||||||
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/engine/util::startup
|
|
||||||
use std/flow::waitBlock
|
|
||||||
use std/flow::trigger
|
|
||||||
use std/flow/concentrate::Concentrator
|
|
||||||
use std/flow/concentrate::concentrateBlock
|
|
||||||
use std/flow/concentrate::concentrated
|
|
||||||
use std/ops/option::|wrap
|
|
||||||
use std/text/compose::|format
|
|
||||||
|
|
||||||
treatment buildTestAya(const github_contexts: string = "{}")
|
|
||||||
model logger: Logger()
|
|
||||||
model finish_concentrator: Concentrator()
|
|
||||||
model github_contexts: JavaScriptEngine()
|
|
||||||
{
|
|
||||||
startup()
|
|
||||||
prepareContexts[contexts=github_contexts](github_contexts=github_contexts)
|
|
||||||
manageLogs[logger=logger](output_directory="logs/")
|
|
||||||
concentratedFinish: concentrated<void>[concentrator=finish_concentrator]()
|
|
||||||
triggerFinish: trigger<void>()
|
|
||||||
startup.trigger -> prepareContexts.trigger,ready -> concentratedFinish.trigger,data -> triggerFinish.stream,end -> manageLogs.stop
|
|
||||||
|
|
||||||
build_aarch64: buildTestAyaForArch[logger=logger, github_contexts=github_contexts, finish_concentrator=finish_concentrator](
|
|
||||||
short_rust_arch="aarch64",
|
|
||||||
full_rust_arch="aarch64-unknown-linux-gnu",
|
|
||||||
ubuntu_arch="arm64"
|
|
||||||
)
|
|
||||||
/*build_armv7: buildTestAyaForArch[logger=logger, dispatcher=dispatcher, github_contexts=github_contexts, finish_concentrator=finish_concentrator](
|
|
||||||
short_rust_arch="armv7",
|
|
||||||
full_rust_arch="armv7-unknown-linux-gnueabi",
|
|
||||||
ubuntu_arch="armhf",
|
|
||||||
repository_clone_ref=repository_clone_ref,
|
|
||||||
repository_clone_url=repository_clone_url
|
|
||||||
)
|
|
||||||
build_powerpc64le: buildTestAyaForArch[logger=logger, dispatcher=dispatcher, github_contexts=github_contexts, finish_concentrator=finish_concentrator](
|
|
||||||
short_rust_arch="powerpc64le",
|
|
||||||
full_rust_arch="powerpc64le-unknown-linux-gnu",
|
|
||||||
ubuntu_arch="ppc64le",
|
|
||||||
repository_clone_ref=repository_clone_ref,
|
|
||||||
repository_clone_url=repository_clone_url
|
|
||||||
)
|
|
||||||
build_riscv64gc: buildTestAyaForArch[logger=logger, dispatcher=dispatcher, github_contexts=github_contexts, finish_concentrator=finish_concentrator](
|
|
||||||
short_rust_arch="riscv64gc",
|
|
||||||
full_rust_arch="riscv64gc-unknown-linux-gnu",
|
|
||||||
ubuntu_arch="riscv64",
|
|
||||||
repository_clone_ref=repository_clone_ref,
|
|
||||||
repository_clone_url=repository_clone_url
|
|
||||||
)
|
|
||||||
build_s390x: buildTestAyaForArch[logger=logger, dispatcher=dispatcher, github_contexts=github_contexts, finish_concentrator=finish_concentrator](
|
|
||||||
short_rust_arch="s390x",
|
|
||||||
full_rust_arch="s390x-unknown-linux-gnu",
|
|
||||||
ubuntu_arch="s390x",
|
|
||||||
repository_clone_ref=repository_clone_ref,
|
|
||||||
repository_clone_url=repository_clone_url
|
|
||||||
)
|
|
||||||
build_x86_64: buildTestAyaForArch[logger=logger, dispatcher=dispatcher, github_contexts=github_contexts, finish_concentrator=finish_concentrator](
|
|
||||||
short_rust_arch="x86_64",
|
|
||||||
full_rust_arch="x86_64-unknown-linux-gnu",
|
|
||||||
ubuntu_arch="amd64",
|
|
||||||
repository_clone_ref=repository_clone_ref,
|
|
||||||
repository_clone_url=repository_clone_url
|
|
||||||
)*/
|
|
||||||
|
|
||||||
prepareContexts.ready -> build_aarch64.trigger
|
|
||||||
/*prepareContexts.ready -> build_armv7.trigger
|
|
||||||
prepareContexts.ready -> build_powerpc64le.trigger
|
|
||||||
prepareContexts.ready -> build_riscv64gc.trigger
|
|
||||||
prepareContexts.ready -> build_s390x.trigger
|
|
||||||
prepareContexts.ready -> build_x86_64.trigger*/
|
|
||||||
}
|
|
||||||
|
|
||||||
treatment buildTestAyaForArch[logger: Logger, github_contexts: JavaScriptEngine, finish_concentrator: Concentrator](short_rust_arch: string, full_rust_arch: string, ubuntu_arch: string)
|
|
||||||
input trigger: Block<void>
|
|
||||||
output finished: Block<void>
|
|
||||||
{
|
|
||||||
concentrateFinish: concentrateBlock<void>[concentrator=finish_concentrator]()
|
|
||||||
build.finished -> concentrateFinish.data
|
|
||||||
|
|
||||||
prepareSystem: localStep[logger=logger](
|
|
||||||
name = |format("prepare_system_{short}", |entry("short", short_rust_arch)),
|
|
||||||
commands = |raw_commands([
|
|
||||||
//|format("mkdir /tmp/{short}", |entry("short", short_rust_arch)),
|
|
||||||
//|format("touch /tmp/{short}/github.env", |entry("short", short_rust_arch)),
|
|
||||||
${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/{short}/github.env", |entry("short", short_rust_arch))*/
|
|
||||||
]),
|
|
||||||
variables = |wrap<StringMap>(
|
|
||||||
|map([
|
|
||||||
|entry("INPUT_TARGET", full_rust_arch)/*,
|
|
||||||
|entry("GITHUB_ENV", |format("cat /tmp/{short}/github.env", |entry("short", short_rust_arch)))*/
|
|
||||||
])
|
|
||||||
)
|
|
||||||
)
|
|
||||||
|
|
||||||
prepareRust: localStep[logger=logger](
|
|
||||||
name = |format("prepare_rust_{short}", |entry("short", short_rust_arch)),
|
|
||||||
commands = |raw_commands([
|
|
||||||
|format("rustup target add {arch}", |entry("arch", full_rust_arch)),
|
|
||||||
${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"
|
|
||||||
])
|
|
||||||
)
|
|
||||||
|
|
||||||
prepare: waitBlock<void>()
|
|
||||||
Self.trigger -> prepareSystem.trigger,success -> prepare.a
|
|
||||||
Self.trigger -> prepareRust.trigger,success ---> prepare.b
|
|
||||||
|
|
||||||
build: localStep[logger=logger](
|
|
||||||
name = |format("build_{short}", |entry("short", short_rust_arch)),
|
|
||||||
commands = |raw_commands([
|
|
||||||
// Build
|
|
||||||
${bash -c "set -o allexport && source $GITHUB_ENV && set +o allexport
|
|
||||||
cargo hack build --all-targets --feature-powerset --exclude aya-ebpf --exclude aya-ebpf-bindings --exclude aya-log-ebpf --exclude integration-ebpf --exclude xtask --workspace"
|
|
||||||
},
|
|
||||||
// Test
|
|
||||||
${bash -c "set -o allexport && source $GITHUB_ENV && set +o allexport
|
|
||||||
cargo hack test --all-targets --feature-powerset --exclude aya-ebpf --exclude aya-ebpf-bindings --exclude aya-log-ebpf --exclude integration-ebpf --exclude integration-test --exclude xtask --workspace"
|
|
||||||
},
|
|
||||||
// Doc
|
|
||||||
${bash -c "set -o allexport && source $GITHUB_ENV && set +o allexport
|
|
||||||
cargo hack test --doc --feature-powerset --exclude aya-ebpf --exclude aya-ebpf-bindings --exclude aya-log-ebpf --exclude integration-ebpf --exclude integration-test --exclude xtask --workspace"
|
|
||||||
}
|
|
||||||
]),
|
|
||||||
variables = |wrap<StringMap>(
|
|
||||||
|map([
|
|
||||||
|entry("RUST_BACKTRACE", "full"),
|
|
||||||
|entry("CARGO_BUILD_TARGET", full_rust_arch)
|
|
||||||
])
|
|
||||||
)
|
|
||||||
)
|
|
||||||
|
|
||||||
prepare.awaited -> build.trigger,finished -> Self.finished
|
|
||||||
|
|
||||||
pendingState: postGithubStateContext[contexts=github_contexts, logger=logger](state = |pending(), name = short_rust_arch, description = "Build and Test Aya on arch", log_response = true)
|
|
||||||
successState: postGithubStateContext[contexts=github_contexts, logger=logger](state = |success(), name = short_rust_arch, description = "Build and Test Aya on arch", log_response = true)
|
|
||||||
errorState: postGithubStateContext[contexts=github_contexts, logger=logger](state = |error(), name = short_rust_arch, description = "Build and Test Aya on arch", log_response = true)
|
|
||||||
failureState: postGithubStateContext[contexts=github_contexts, logger=logger](state = |failure(), name = short_rust_arch, description = "Build and Test Aya on arch", log_response = true)
|
|
||||||
|
|
||||||
Self.trigger --> pendingState.trigger
|
|
||||||
build.success -> successState.trigger
|
|
||||||
build.error ---> errorState.trigger
|
|
||||||
build.failed --> failureState.trigger
|
|
||||||
}
|
|
||||||
Loading…
Reference in New Issue