Docs/Automation

Automation

Tasks and testing

Express dependency-aware workflows and project tests in the language.

About 12 minVersion: 0.10.1

Declare a workflow

task declares an executable workflow node. needs lists task dependencies. Each dependency runs once, failures skip dependents, and cycles are rejected before execution.

automation.orvi
1task build -> Result<string, string> {2    let output = path.join([context.project_dir, "dist", "app.txt"])3    fs.create_dir_all(path.parent(output)?)?4    fs.write_text(output, "ready")?5    return Ok(output)6}78task test_build -> Result<void, string> {9    needs: [build]10    let output = task.result("build")?11    if !fs.exists(output) {12        return Err("build output is missing")13    }14    return Ok()15}

Read dependency results

task.result(name) returns the completed dependency value as Result<any, string>. Only declared dependencies are available to the task.

Project-wide tests

The test command discovers tasks whose names begin with test_ in all project source files.

orviscript test
orviscript test --list
orviscript test --filter build