diff --git a/harness/src/build.rs b/harness/src/build.rs index 7bd68dce..2de5726b 100644 --- a/harness/src/build.rs +++ b/harness/src/build.rs @@ -32,7 +32,7 @@ use std::{path::PathBuf, process::Command}; pub const BINARIES: [&str; 4] = ["skyd", "sky-bench", "skysh", "sky-migrate"]; /// The build mode -#[derive(Copy, Clone)] +#[derive(Copy, Clone, PartialEq)] pub enum BuildMode { Debug, Release, diff --git a/harness/src/bundle.rs b/harness/src/bundle.rs index 17088c25..257da7b1 100644 --- a/harness/src/bundle.rs +++ b/harness/src/bundle.rs @@ -54,12 +54,12 @@ fn get_bundle_name() -> String { pub fn bundle(mode: BuildMode) -> HarnessResult<()> { let target_folder = build::build(mode)?; // now package - package_binaries(target_folder)?; + package_binaries(target_folder, mode)?; Ok(()) } /// Package the binaries into a ZIP file -fn package_binaries(target_folder: PathBuf) -> HarnessResult<()> { +fn package_binaries(target_folder: PathBuf, mode: BuildMode) -> HarnessResult<()> { // get the file index let file_index = build::get_files_index(&target_folder); // get the bundle file name @@ -72,9 +72,14 @@ fn package_binaries(target_folder: PathBuf) -> HarnessResult<()> { // create a temp buffer let mut buffer = Vec::new(); // ZIP settings - let options = FileOptions::default() - .compression_method(zip::CompressionMethod::Deflated) - .unix_permissions(0o755); + let mut options = FileOptions::default().unix_permissions(0o755); + if mode == BuildMode::Debug { + // avoid compressing in debug since the binaries will be huge, so it's + // better to avoid wasting CI time + options = options.compression_method(zip::CompressionMethod::Stored); + } else { + options = options.compression_method(zip::CompressionMethod::Deflated); + } for file in file_index { let path = file.as_path(); let name = path.strip_prefix(Path::new(&target_folder)).unwrap(); diff --git a/harness/src/cli.rs b/harness/src/cli.rs index 90fbaf11..73a313f5 100644 --- a/harness/src/cli.rs +++ b/harness/src/cli.rs @@ -37,8 +37,9 @@ OPTIONS: harness [SUBCOMMAND] SUBCOMMANDS: - test Run the full test suite - bundle Build the bundle\ + test Run the full test suite + bundle Build the bundle + bundle-dbg Build the debug bundle \ "; #[derive(Copy, Clone)] diff --git a/sky-macros/src/lib.rs b/sky-macros/src/lib.rs index 2ae66cbd..8a306830 100644 --- a/sky-macros/src/lib.rs +++ b/sky-macros/src/lib.rs @@ -60,8 +60,7 @@ pub fn dbtest_module(args: TokenStream, item: TokenStream) -> TokenStream { /// use within the `skyd` or `WORKSPACEROOT/server/` crate. If you use this compiler /// macro in any other crate, you'll simply get compilation errors /// -/// All tests will clean up all values once a single test is over. **These tests should not -/// be run in multi-threaded environments because they often use the same keys** +/// All tests will clean up all values once a single test is over /// /// ## Arguments /// - `table -> str`: Custom table declaration