From fc3be7410a88e5f2bb018109b68eb9404763579c Mon Sep 17 00:00:00 2001 From: Lars Wirzenius Date: Thu, 4 Jan 2024 17:26:25 +0200 Subject: [PATCH] fix: if building fails, still update the web page Signed-off-by: Lars Wirzenius --- src/main.rs | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/src/main.rs b/src/main.rs index 12c0785..7fe6807 100644 --- a/src/main.rs +++ b/src/main.rs @@ -52,10 +52,20 @@ fn fallible_main() -> Result<(), NativeError> { info!("radicle-native-ci starts"); let config = Config::load_via_env()?; + + let result = fallible_main_inner(&config); + report::build_report(&config.state)?; + result +} + +fn fallible_main_inner(config: &Config) -> Result<(), NativeError> { + pretty_env_logger::init_custom_env("RADICLE_NATIVE_CI_LOG"); + info!("radicle-native-ci starts"); + let mut logfile = config.open_log()?; logfile.write_str("radicle-native-ci starts\n")?; - let (run_id, run_dir) = mkdir_run(&config)?; + let (run_id, run_dir) = mkdir_run(config)?; let run_id = RunId::from(format!("{}", run_id).as_str()); logfile.write(format!("run directory {}\n", run_dir.display()))?;