diff options
author | iximeow <me@iximeow.net> | 2023-06-27 01:48:16 -0700 |
---|---|---|
committer | iximeow <me@iximeow.net> | 2023-06-27 01:48:16 -0700 |
commit | 3b311571c92da4be6908c7b7d32b1b46b7224926 (patch) | |
tree | 285617f5ead506a03f067912d875d74ad4d61921 /src/ci_runner.rs | |
parent | 55ed9f337ae0cf8e1336448d6b4273b3ee31aca2 (diff) |
[driver] basic tools to track steps as reported by runners
Diffstat (limited to 'src/ci_runner.rs')
-rw-r--r-- | src/ci_runner.rs | 30 |
1 files changed, 30 insertions, 0 deletions
diff --git a/src/ci_runner.rs b/src/ci_runner.rs index f78fdbc..a83866d 100644 --- a/src/ci_runner.rs +++ b/src/ci_runner.rs @@ -44,6 +44,7 @@ impl RequestedJob { RunningJob { job: self, client, + current_step: StepTracker::new(), } } } @@ -75,6 +76,35 @@ impl JobEnv { pub struct RunningJob { job: RequestedJob, client: RunnerClient, + current_step: StepTracker, +} + +pub struct StepTracker { + scopes: Vec<String> +} + +impl StepTracker { + pub fn new() -> Self { + StepTracker { + scopes: Vec::new() + } + } + + pub fn push(&mut self, name: String) { + self.scopes.push(name); + } + + pub fn pop(&mut self) { + self.scopes.pop(); + } + + pub fn clear(&mut self) { + self.scopes.clear(); + } + + pub fn full_step_path(&self) -> &[String] { + self.scopes.as_slice() + } } impl RunningJob { |