From 3fb197e13d69ac81889dfbdefca095e4c1e1cc40 Mon Sep 17 00:00:00 2001 From: Mohammed Ghannam Date: Sat, 8 Feb 2025 10:02:48 +0100 Subject: [PATCH 1/2] Use debug precompiled binaries in debug mode --- .github/workflows/build_and_test.yml | 22 ++++++++++++++++++++-- bundled.rs | 8 +++++++- 2 files changed, 27 insertions(+), 3 deletions(-) diff --git a/.github/workflows/build_and_test.yml b/.github/workflows/build_and_test.yml index 2abb370..e6c3dcf 100644 --- a/.github/workflows/build_and_test.yml +++ b/.github/workflows/build_and_test.yml @@ -23,9 +23,27 @@ jobs: - uses: actions/checkout@v3 - name: Test bundled run: | - cargo b --features bundled -vv + cargo b --features bundled --release + cargo t --features bundled --release create + cargo t --features bundled --release --examples + + bundled-debug-test: + strategy: + matrix: + os: [ + ubuntu-latest, + macos-latest, + macos-14, # macOS arm runner + windows-latest, + ] + runs-on: ${{ matrix.os }} + steps: + - uses: actions/checkout@v3 + - name: Test bundled + run: | + cargo b --features bundled cargo t --features bundled create - cargo t --features bundled --examples + cargo t --features bundled --examples from-source-test: strategy: diff --git a/bundled.rs b/bundled.rs index e656371..5f36be9 100644 --- a/bundled.rs +++ b/bundled.rs @@ -36,8 +36,14 @@ pub fn download_scip() { panic!("Unsupported OS-arch combination: {}-{}", os, arch); }; + // if debug mode is enabled, download the debug version of SCIP + #[cfg(debug_assertions)] + let debug_str = "-debug"; + #[cfg(not(debug_assertions))] + let debug_str = ""; + let url = format!( - "https://github.com/scipopt/scipoptsuite-deploy/releases/download/v0.7.0/libscip-{os_string}.zip" + "https://github.com/scipopt/scipoptsuite-deploy/releases/download/v0.7.0/libscip-{os_string}{debug_str}" ); download_and_extract_zip(&url, &extract_path) From 167b1d119e724c3f093551fbc09485eab4761cea Mon Sep 17 00:00:00 2001 From: Mohammed Ghannam Date: Sat, 8 Feb 2025 10:04:50 +0100 Subject: [PATCH 2/2] Add missing .zip in url --- bundled.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bundled.rs b/bundled.rs index 5f36be9..120a987 100644 --- a/bundled.rs +++ b/bundled.rs @@ -43,7 +43,7 @@ pub fn download_scip() { let debug_str = ""; let url = format!( - "https://github.com/scipopt/scipoptsuite-deploy/releases/download/v0.7.0/libscip-{os_string}{debug_str}" + "https://github.com/scipopt/scipoptsuite-deploy/releases/download/v0.7.0/libscip-{os_string}{debug_str}.zip", ); download_and_extract_zip(&url, &extract_path)