pub struct Workflow {
pub name: String,
pub on: WorkflowTrigger,
pub env: HashMap<String, String>,
pub jobs: HashMap<String, Job>,
}Expand description
GitHub Actions compatible workflow definition
Fields§
§name: StringWorkflow name
on: WorkflowTriggerTrigger configuration
env: HashMap<String, String>Global environment variables
jobs: HashMap<String, Job>Workflow jobs
Implementations§
Source§impl Workflow
impl Workflow
Sourcepub fn parse(yaml: &str) -> Result<Self>
pub fn parse(yaml: &str) -> Result<Self>
Parse a workflow from YAML content in legacy mode.
This is the historical entry point: unknown keys are silently dropped.
Existing non-gate callers should keep using this until they explicitly
opt into strict mode. The merge gate should use Workflow::parse_strict
(or Workflow::parse_with with ParseMode::Strict).
Sourcepub fn parse_strict(yaml: &str) -> Result<Self>
pub fn parse_strict(yaml: &str) -> Result<Self>
Parse a workflow from YAML content in strict / fail-closed mode.
Rejects unknown top-level, job-level, and step-level keys. See
ParseMode::Strict for the exact contract and non-goals.
Sourcepub fn parse_with(yaml: &str, mode: ParseMode) -> Result<Self>
pub fn parse_with(yaml: &str, mode: ParseMode) -> Result<Self>
Parse a workflow with an explicit ParseMode.
In ParseMode::Strict the document is first validated against the
known-key sets at the top level, per-job, and per-step (the three
structural levels the parser models) before being handed to
serde_yaml. Validation runs on the raw serde_yaml::Value tree so
that an unknown key can never be silently absorbed by
#[serde(default)].
Sourcepub fn parse_file(path: &Path) -> Result<Self>
pub fn parse_file(path: &Path) -> Result<Self>
Parse a workflow from a file in legacy mode.
Trait Implementations§
Source§impl<'de> Deserialize<'de> for Workflow
impl<'de> Deserialize<'de> for Workflow
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Auto Trait Implementations§
impl Freeze for Workflow
impl RefUnwindSafe for Workflow
impl Send for Workflow
impl Sync for Workflow
impl Unpin for Workflow
impl UnsafeUnpin for Workflow
impl UnwindSafe for Workflow
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more