| Crates.io | astro-runner |
| lib.rs | astro-runner |
| version | 1.0.0 |
| created_at | 2023-08-17 13:38:51.20015+00 |
| updated_at | 2024-07-20 01:28:59.323004+00 |
| description | AstroRun is a highly customizable workflow orchestrator that allows users to define their own core runners. Whether it's Docker or other platforms, AstroRun empowers users to run workflows with ease and flexibility. |
| homepage | https://github.com/panghu-huang/astro-run |
| repository | https://github.com/panghu-huang/astro-run |
| max_upload_size | |
| id | 947027 |
| size | 93,816 |
astro-run-runner is a specific runner implementation within astro-run. It supports running the smallest execution unit of workflow steps in both local and Dockerfile environments.
It can also be used in conjunction with other components of the astro-run ecosystem, such as astro-run-server and astro-run-remote-runner.
Add astro-run and astro-runner as dependencies in your Cargo.toml:
[dependencies]
astro-run = "0.1"
astro-runner = "0.1"
use astro_run::{AstroRun, Workflow};
use astro_runner::AstroRunner;
#[tokio::main]
#[ignore]
async fn main() {
let workflow = r#"
jobs:
test:
name: Test Job
steps:
- timeout: 60m
continue-on-error: false
run: echo "Hello World" >> test.txt
- run: |
content=$(cat test.txt)
echo Content is $content
echo "Cache" >> /home/work/caches/test.txt
"#;
let runner = AstroRunner::builder().build().unwrap();
let astro_run = AstroRun::builder().runner(runner).build();
let workflow = Workflow::builder()
.config(workflow)
.build(&astro_run)
.await
.unwrap();
let ctx = astro_run.execution_context().build();
let _res = workflow.run(ctx).await;
}