From c26385e8e790609fd40bdfcb9a286a99ffb63925 Mon Sep 17 00:00:00 2001 From: lshw54 Date: Sun, 26 Apr 2026 13:33:40 +0800 Subject: [PATCH 1/2] chore(ci): skip frontend/rust jobs when only the other side changed Uses dorny/paths-filter to detect which files changed and skips the frontend or rust job accordingly. Manual workflow_dispatch always runs both. --- .github/workflows/ci.yml | 57 +++++++++++++++++++++++++++++++++++----- 1 file changed, 50 insertions(+), 7 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index c054176..240a7e1 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -12,15 +12,57 @@ concurrency: cancel-in-progress: true jobs: + # ----------------------------------------------------------- + # Detect which parts of the repo changed so we can skip jobs + # that have no relevant file modifications. + # ----------------------------------------------------------- + changes: + name: Detect changes + runs-on: ubuntu-latest + outputs: + frontend: ${{ steps.filter.outputs.frontend }} + rust: ${{ steps.filter.outputs.rust }} + steps: + - uses: actions/checkout@v6 + - uses: dorny/paths-filter@v4 + id: filter + with: + filters: | + frontend: + - 'src/**' + - 'tests/**' + - 'scripts/**' + - 'package.json' + - 'package-lock.json' + - 'tsconfig.json' + - 'tsconfig.node.json' + - 'vite.config.ts' + - 'vitest.config.ts' + - 'eslint.config.js' + - '.prettierrc.json' + rust: + - 'src-tauri/src/**' + - 'src-tauri/tests/**' + - 'src-tauri/Cargo.toml' + - 'src-tauri/Cargo.lock' + - 'src-tauri/build.rs' + - 'src-tauri/clippy.toml' + - 'src-tauri/rustfmt.toml' + + # ----------------------------------------------------------- + # Frontend: ESLint / Prettier / TypeCheck / Vitest + # ----------------------------------------------------------- frontend: name: 'Frontend: ESLint / Prettier / TypeCheck / Vitest' + needs: changes + if: needs.changes.outputs.frontend == 'true' || github.event_name == 'workflow_dispatch' runs-on: windows-latest steps: - name: Checkout - uses: actions/checkout@v4 + uses: actions/checkout@v6 - name: Setup Node.js - uses: actions/setup-node@v4 + uses: actions/setup-node@v6 with: node-version: '22' cache: npm @@ -41,20 +83,21 @@ jobs: - name: Unit tests (Vitest) run: npm run test + # ----------------------------------------------------------- + # Rust: fmt / Clippy / Test + # ----------------------------------------------------------- rust: name: 'Rust: fmt / Clippy / Test' + needs: changes + if: needs.changes.outputs.rust == 'true' || github.event_name == 'workflow_dispatch' runs-on: windows-latest - # Cap the job at 25 min so a hung test (e.g. wiremock + tokio - # paused-time interaction on Windows) fails loudly within the - # next CI cycle instead of silently consuming the GitHub default - # 6-hour budget. Healthy runs land in 4-8 min on a warm cache. timeout-minutes: 25 defaults: run: working-directory: src-tauri steps: - name: Checkout - uses: actions/checkout@v4 + uses: actions/checkout@v6 - name: Install Rust (stable) uses: dtolnay/rust-toolchain@stable From a8acc4597bd6baba04605de6f5a135ee0925836a Mon Sep 17 00:00:00 2001 From: lshw54 Date: Sun, 26 Apr 2026 13:35:42 +0800 Subject: [PATCH 2/2] chore(ci): bump actions/checkout to v6, setup-node to v6, action-gh-release to v3 --- .github/workflows/build-and-release.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/build-and-release.yml b/.github/workflows/build-and-release.yml index bb45f2f..404f736 100644 --- a/.github/workflows/build-and-release.yml +++ b/.github/workflows/build-and-release.yml @@ -37,12 +37,12 @@ jobs: steps: - name: Checkout - uses: actions/checkout@v4 + uses: actions/checkout@v6 with: fetch-depth: 0 - name: Setup Node.js - uses: actions/setup-node@v4 + uses: actions/setup-node@v6 with: node-version: '22' cache: npm @@ -180,7 +180,7 @@ jobs: - name: Create GitHub Release if: steps.prep_release.outputs.exists == 'false' - uses: softprops/action-gh-release@v2 + uses: softprops/action-gh-release@v3 with: tag_name: ${{ steps.prep_version.outputs.tag_name }} name: >