diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index d7ee4077e..a5756a387 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -2,7 +2,6 @@ name: Build/Test/Release on: push: - branches: [ "*" ] tags: [ "v*" ] pull_request: branches: [ "master" ] @@ -29,6 +28,7 @@ jobs: with: submodules: recursive - uses: ilammy/setup-nasm@v1 + if : ${{ matrix.platforms.os == 'windows-2022' }} - uses: dtolnay/rust-toolchain@stable with: toolchain: stable @@ -39,13 +39,13 @@ jobs: run: cargo check --all --all-features - name: Run cargo clippy run: cargo clippy --all --all-features -- -D warnings - - name: Run cargo test on non-macos - if: ${{ matrix.os }} != 'macos-13' + - name: Run cargo test on Linux + if: ${{ matrix.platforms.os == 'ubuntu-22.04' }} run: cargo test --all --all-features - env: + - name: Run cargo test on non LInux + env: # this is a bit counter intuitive - some tests relies on Docker to run and are marked not(ci), but macos runner doesn't have Docker installed, so we make it "ci" to bypass those tests CLASH_RS_CI: 'true' - - name: Run cargo test on macos - if: ${{ matrix.os }} == 'macos-13' + if: ${{ matrix.platforms.os != 'ubuntu-22.04' }} run: cargo test --all --all-features - name: Build artifacts run: sh ./scripts/build.sh "${{ matrix.platforms.target }}" "${{ matrix.static }}" diff --git a/clash_lib/build.rs b/clash_lib/build.rs index aa8dfbf64..4c2fde659 100644 --- a/clash_lib/build.rs +++ b/clash_lib/build.rs @@ -1,5 +1,5 @@ fn main() { if std::env::var("CLASH_RS_CI").is_ok() { - println!("cargo:rustc-cfg=ci"); + println!("cargo::rustc-cfg=ci"); } } diff --git a/clash_lib/src/lib.rs b/clash_lib/src/lib.rs index 3910e8785..793cbcaf3 100644 --- a/clash_lib/src/lib.rs +++ b/clash_lib/src/lib.rs @@ -149,7 +149,8 @@ async fn start_async(opts: Options) -> Result<(), Error> { let _g = app::logging::setup_logging(config.general.log_level, log_collector, &cwd, opts.log_file) - .map_err(|x| Error::InvalidConfig(format!("failed to setup logging: {}", x)))?; + .map_err(|x| eprintln!("failed to setup logging: {}", x)) + .unwrap_or_default(); let default_panic = std::panic::take_hook(); std::panic::set_hook(Box::new(move |info| {