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
:
toml
[dependencies]
astro-run = "0.1"
astro-runner = "0.1"
```rust use astrorun::{AstroRun, Workflow}; use astrorunner::AstroRunner;
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) .unwrap();
let ctx = astrorun.executioncontext().build();
let _res = workflow.run(ctx).await; } ```