2025-10-11 14:11:31 -07:00
|
|
|
use crate::config::EntryDeclaration;
|
2025-10-04 23:12:01 -07:00
|
|
|
use crate::context::Context;
|
2025-10-11 14:11:31 -07:00
|
|
|
use crate::generators::matrix::MatrixConfiguration;
|
|
|
|
|
use serde::{Deserialize, Serialize};
|
2025-10-04 23:12:01 -07:00
|
|
|
use std::rc::Rc;
|
|
|
|
|
|
|
|
|
|
pub mod matrix;
|
|
|
|
|
|
2025-10-11 14:11:31 -07:00
|
|
|
#[derive(Serialize, Deserialize, Default, Clone)]
|
|
|
|
|
pub struct GeneratorDeclaration {
|
|
|
|
|
#[serde(default)]
|
|
|
|
|
pub matrix: Option<MatrixConfiguration>,
|
|
|
|
|
}
|
|
|
|
|
|
2025-10-04 23:12:01 -07:00
|
|
|
pub fn generate(
|
|
|
|
|
context: Rc<Context>,
|
|
|
|
|
generator: &GeneratorDeclaration,
|
|
|
|
|
) -> Vec<(Rc<Context>, EntryDeclaration)> {
|
|
|
|
|
if let Some(matrix) = &generator.matrix {
|
|
|
|
|
matrix::generate(context, matrix)
|
|
|
|
|
} else {
|
|
|
|
|
panic!("unknown action configuration");
|
|
|
|
|
}
|
|
|
|
|
}
|