diff --git a/.github/workflows/cross_check.yaml b/.github/workflows/cross_check.yaml new file mode 100644 index 00000000..e58bc87e --- /dev/null +++ b/.github/workflows/cross_check.yaml @@ -0,0 +1,50 @@ +name: Cross Platform Cargo Check + +on: + workflow_dispatch: +# pull_request: +# push: +# branches: [main, dev] + +permissions: + contents: read + +jobs: + cargo-check: + # Treat all Rust compiler warnings as errors + env: + RUSTFLAGS: "-D warnings" + strategy: + fail-fast: false + matrix: + include: + - os: macos-latest + target: aarch64-apple-darwin + - os: windows-latest + target: x86_64-pc-windows-msvc + - os: ubuntu-latest + target: x86_64-unknown-linux-gnu + runs-on: ${{ matrix.os }} + steps: + - name: Checkout Repository + uses: actions/checkout@v4 + + - name: Install Rust Stable + uses: dtolnay/rust-toolchain@stable + with: + targets: ${{ matrix.target }} + + - name: Add Rust Target + run: rustup target add ${{ matrix.target }} + + - name: Rust Cache + uses: Swatinem/rust-cache@v2 + with: + workspaces: src-tauri + cache-all-crates: true + cache-on-failure: true + + - name: Cargo Check (deny warnings) + working-directory: src-tauri + run: | + cargo check --target ${{ matrix.target }} --workspace --all-features diff --git a/src-tauri/src_crates/crate_mihomo_api/Cargo.toml b/src-tauri/src_crates/crate_mihomo_api/Cargo.toml index 3655756c..1691bbd6 100644 --- a/src-tauri/src_crates/crate_mihomo_api/Cargo.toml +++ b/src-tauri/src_crates/crate_mihomo_api/Cargo.toml @@ -2,9 +2,6 @@ name = "mihomo_api" edition = "2024" -[features] -debug = [] - [dependencies] reqwest = { version = "0.12.19", features = ["json"] } serde = { version = "1.0.219", features = ["derive"] } diff --git a/src-tauri/src_crates/crate_mihomo_api/src/model.rs b/src-tauri/src_crates/crate_mihomo_api/src/model.rs index 0481b240..aed81a95 100644 --- a/src-tauri/src_crates/crate_mihomo_api/src/model.rs +++ b/src-tauri/src_crates/crate_mihomo_api/src/model.rs @@ -3,17 +3,3 @@ pub struct MihomoManager { pub(crate) mihomo_server: String, pub(crate) client: reqwest::Client, } - -#[cfg(feature = "debug")] -impl Drop for MihomoData { - fn drop(&mut self) { - println!("Dropping MihomoData"); - } -} - -#[cfg(feature = "debug")] -impl Drop for MihomoManager { - fn drop(&mut self) { - println!("Dropping MihomoManager"); - } -}