From 76c36955676394ea394b5fb8f7b3ef60487c6c83 Mon Sep 17 00:00:00 2001 From: Tunglies <77394545+Tunglies@users.noreply.github.com> Date: Fri, 22 Aug 2025 19:20:35 +0800 Subject: [PATCH] feat: add Clippy and Oxlint workflows for enhanced linting --- .../workflows/{clippy.yml => lint-clippy.yml} | 6 +--- .github/workflows/lint-oxlint.yml | 35 +++++++++++++++++++ 2 files changed, 36 insertions(+), 5 deletions(-) rename .github/workflows/{clippy.yml => lint-clippy.yml} (92%) create mode 100644 .github/workflows/lint-oxlint.yml diff --git a/.github/workflows/clippy.yml b/.github/workflows/lint-clippy.yml similarity index 92% rename from .github/workflows/clippy.yml rename to .github/workflows/lint-clippy.yml index 2dd00550..c8fe9cc3 100644 --- a/.github/workflows/clippy.yml +++ b/.github/workflows/lint-clippy.yml @@ -46,6 +46,7 @@ jobs: uses: actions/setup-node@v4 with: node-version: "22" + cache: "pnpm" - name: Install pnpm uses: pnpm/action-setup@v4 @@ -57,10 +58,5 @@ jobs: pnpm i pnpm run prebuild ${{ matrix.target }} - - name: Build Web Assets - run: pnpm run web:build - env: - NODE_OPTIONS: "--max_old_space_size=4096" - - name: Run Clippy run: cargo clippy --manifest-path src-tauri/Cargo.toml --all-targets --all-features -- -D warnings diff --git a/.github/workflows/lint-oxlint.yml b/.github/workflows/lint-oxlint.yml new file mode 100644 index 00000000..b5407e12 --- /dev/null +++ b/.github/workflows/lint-oxlint.yml @@ -0,0 +1,35 @@ +name: Oxlint Lint + +on: + pull_request: + workflow_dispatch: + +jobs: + clippy: + strategy: + fail-fast: false + matrix: + include: + - os: ubuntu-22.04 + target: x86_64-unknown-linux-gnu + + runs-on: ${{ matrix.os }} + steps: + - name: Checkout Repository + uses: actions/checkout@v4 + + - name: Install Node + uses: actions/setup-node@v4 + with: + node-version: "22" + cache: "pnpm" + + - name: Install pnpm + uses: pnpm/action-setup@v4 + with: + run_install: false + + - name: Pnpm install and check + run: | + pnpm i + pnpm lint