mirror of
https://github.com/clash-verge-rev/clash-verge-rev.git
synced 2026-01-29 00:35:38 +08:00
chore: add cross-platform cargo check workflow and remove debug features
This commit is contained in:
50
.github/workflows/cross_check.yaml
vendored
Normal file
50
.github/workflows/cross_check.yaml
vendored
Normal file
@@ -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
|
||||||
@@ -2,9 +2,6 @@
|
|||||||
name = "mihomo_api"
|
name = "mihomo_api"
|
||||||
edition = "2024"
|
edition = "2024"
|
||||||
|
|
||||||
[features]
|
|
||||||
debug = []
|
|
||||||
|
|
||||||
[dependencies]
|
[dependencies]
|
||||||
reqwest = { version = "0.12.19", features = ["json"] }
|
reqwest = { version = "0.12.19", features = ["json"] }
|
||||||
serde = { version = "1.0.219", features = ["derive"] }
|
serde = { version = "1.0.219", features = ["derive"] }
|
||||||
|
|||||||
@@ -3,17 +3,3 @@ pub struct MihomoManager {
|
|||||||
pub(crate) mihomo_server: String,
|
pub(crate) mihomo_server: String,
|
||||||
pub(crate) client: reqwest::Client,
|
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");
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|||||||
Reference in New Issue
Block a user