mirror of
https://github.com/clash-verge-rev/clash-verge-rev.git
synced 2026-10-30 02:32:09 +08:00
The paths-filter output in lint-clippy.yml only gated two echo steps; checkout, toolchain setup and clippy itself ran unconditionally, so frontend-only PRs still burned a 3-runner matrix on a full clippy build plus the logging-check tool install. - lint-clippy/rustfmt/frontend-check: move path filters to workflow level so irrelevant PRs spawn no runner at all - split contract-parity into its own workflow; its trigger set spans both sides and workflow paths cannot vary per job - clippy paths now cover crates/** and workspace Cargo files, which the old src-tauri/** filter missed dev has no required status checks, so path-filtered workflows cannot get stuck in "Expected".
77 lines
2.0 KiB
YAML
77 lines
2.0 KiB
YAML
name: Clippy Lint
|
|
|
|
on:
|
|
pull_request:
|
|
paths:
|
|
- "src-tauri/**"
|
|
- "crates/**"
|
|
- "Cargo.toml"
|
|
- "Cargo.lock"
|
|
- "rust-toolchain.toml"
|
|
- ".github/workflows/lint-clippy.yml"
|
|
workflow_dispatch:
|
|
env:
|
|
HUSKY: 0
|
|
permissions:
|
|
contents: read
|
|
|
|
jobs:
|
|
clippy:
|
|
strategy:
|
|
fail-fast: false
|
|
matrix:
|
|
include:
|
|
- os: windows-latest
|
|
target: x86_64-pc-windows-msvc
|
|
- os: macos-latest
|
|
target: aarch64-apple-darwin
|
|
- os: ubuntu-22.04
|
|
target: x86_64-unknown-linux-gnu
|
|
|
|
runs-on: ${{ matrix.os }}
|
|
steps:
|
|
- name: Checkout Repository
|
|
uses: actions/checkout@v7
|
|
|
|
- name: Install Rust Stable
|
|
uses: dtolnay/rust-toolchain@master
|
|
with:
|
|
toolchain: stable
|
|
components: clippy
|
|
|
|
- name: Add Rust Target
|
|
run: rustup target add ${{ matrix.target }}
|
|
|
|
- name: Rust Cache
|
|
uses: Swatinem/rust-cache@v2
|
|
with:
|
|
save-if: ${{ github.ref == 'refs/heads/dev' }}
|
|
prefix-key: 'v1-rust'
|
|
key: 'rust-shared-stable-${{ matrix.os }}-${{ matrix.target }}'
|
|
workspaces: |
|
|
. -> target
|
|
cache-all-crates: true
|
|
cache-workspace-crates: true
|
|
|
|
- name: Install dependencies (ubuntu only)
|
|
if: matrix.os == 'ubuntu-22.04'
|
|
run: |
|
|
sudo apt-get update
|
|
sudo apt-get install -y libxslt1.1 libwebkit2gtk-4.1-dev libayatana-appindicator3-dev librsvg2-dev patchelf
|
|
|
|
- name: Run Clippy
|
|
working-directory: ./src-tauri
|
|
run: cargo clippy-all
|
|
|
|
- name: Run Windows security tests
|
|
if: matrix.os == 'windows-latest'
|
|
working-directory: ./src-tauri
|
|
run: cargo test --all-features --target ${{ matrix.target }}
|
|
|
|
- name: Run Logging Check
|
|
working-directory: ./src-tauri
|
|
shell: bash
|
|
run: |
|
|
cargo install --git https://github.com/clash-verge-rev/clash-verge-logging-check.git
|
|
clash-verge-logging-check
|