-
Notifications
You must be signed in to change notification settings - Fork 103
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Validate builder configs in CI (#294)
## 📝 Summary Add a CLI tool to validate the builder config and run it in CI to validate all configs found in the root of the repo. ## 💡 Motivation and Context Fix #278 --- ## ✅ I have completed the following steps: * [x] Run `make lint` * [x] Run `make test` * [ ] Added tests (if applicable)
- Loading branch information
1 parent
2e4c1ab
commit 8989fca
Showing
3 changed files
with
31 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
//! CLI tool to validate a rbuilder config file | ||
use clap::Parser; | ||
use rbuilder::live_builder::{base_config::load_config_toml_and_env, config::Config}; | ||
use std::path::PathBuf; | ||
|
||
#[derive(Parser, Debug)] | ||
struct Cli { | ||
#[clap(long, help = "Config file path", env = "RBUILDER_CONFIG")] | ||
config: PathBuf, | ||
} | ||
|
||
#[tokio::main] | ||
async fn main() -> eyre::Result<()> { | ||
let cli = Cli::parse(); | ||
|
||
let config_path = &cli.config; | ||
let _: Config = load_config_toml_and_env(config_path)?; | ||
|
||
println!("Config file '{}' is valid", config_path.display()); | ||
|
||
Ok(()) | ||
} |