mirror of
https://github.com/logos-blockchain/lez-programs.git
synced 2026-08-26 06:31:19 +00:00
ci: add IDL freshness check and consolidate artifacts
Move IDL files to artifacts/ and add a convention-based CI check that discovers all programs via */methods/guest/src/bin/*.rs and fails if any program is missing its IDL or has one that is out of date.
This commit is contained in:
@@ -0,0 +1,14 @@
|
||||
[package]
|
||||
name = "idl-gen"
|
||||
version = "0.1.0"
|
||||
edition = "2021"
|
||||
|
||||
[[bin]]
|
||||
name = "idl-gen"
|
||||
path = "src/main.rs"
|
||||
|
||||
[dependencies]
|
||||
spel-framework-core = { git = "https://github.com/logos-co/spel.git", rev = "57201f64b4542bb3f592bc9a0aa654c47aa908a6", features = [
|
||||
"idl-gen",
|
||||
] }
|
||||
serde_json = "1.0"
|
||||
@@ -0,0 +1,19 @@
|
||||
use std::{path::PathBuf, process};
|
||||
|
||||
fn main() {
|
||||
let path: PathBuf = match std::env::args().nth(1) {
|
||||
Some(p) => PathBuf::from(p),
|
||||
None => {
|
||||
eprintln!("Usage: idl-gen <source-file>");
|
||||
process::exit(1);
|
||||
}
|
||||
};
|
||||
|
||||
match spel_framework_core::idl_gen::generate_idl_from_file(&path) {
|
||||
Ok(idl) => println!("{}", serde_json::to_string_pretty(&idl).unwrap()),
|
||||
Err(e) => {
|
||||
eprintln!("Error: {e}");
|
||||
process::exit(1);
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user