From cc1c23543dda8eadef0dec2bb5eee1276672db7b Mon Sep 17 00:00:00 2001 From: Samuel K Date: Tue, 14 Jul 2026 10:12:29 -0500 Subject: [PATCH] ci(desktop): make lint-and-test a always-reporting gate job Split path filtering out of the workflow trigger and into a 'changes' job so Desktop CI runs on every PR. lint-and-test now always reports a status, skipping its steps when desktop/** is untouched, so it can be added to the branch ruleset as a required check without blocking non-desktop PRs. build-desktop and build-flatpak stay gated on the desktop filter. --- .github/workflows/desktop-ci.yml | 35 ++++++++++++++++++++++++-------- 1 file changed, 27 insertions(+), 8 deletions(-) diff --git a/.github/workflows/desktop-ci.yml b/.github/workflows/desktop-ci.yml index a54ce93b1a..65e26d0730 100644 --- a/.github/workflows/desktop-ci.yml +++ b/.github/workflows/desktop-ci.yml @@ -3,13 +3,7 @@ name: Desktop CI on: push: branches: [electron-ui, main] - paths: - - "desktop/**" - - ".github/workflows/desktop-ci.yml" pull_request: - paths: - - "desktop/**" - - ".github/workflows/desktop-ci.yml" workflow_dispatch: concurrency: @@ -17,31 +11,55 @@ concurrency: cancel-in-progress: true jobs: + changes: + runs-on: ubuntu-latest + permissions: + contents: read + pull-requests: read + outputs: + desktop: ${{ steps.filter.outputs.desktop }} + steps: + - uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7 + - uses: dorny/paths-filter@7b450fff21473bca461d4b92ce414b9d0420d706 # v4 + id: filter + with: + filters: | + desktop: + - 'desktop/**' + - '.github/workflows/desktop-ci.yml' + lint-and-test: + needs: changes runs-on: ubuntu-latest steps: - uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7 + if: needs.changes.outputs.desktop == 'true' - uses: actions/setup-node@249970729cb0ef3589644e2896645e5dc5ba9c38 # v6 + if: needs.changes.outputs.desktop == 'true' with: node-version: 22 cache: npm cache-dependency-path: desktop/package-lock.json - name: Install dependencies + if: needs.changes.outputs.desktop == 'true' working-directory: desktop run: npm ci - name: Type check + if: needs.changes.outputs.desktop == 'true' working-directory: desktop run: npm run check - name: Unit tests + if: needs.changes.outputs.desktop == 'true' working-directory: desktop run: npm run test build-desktop: - needs: lint-and-test + needs: [changes, lint-and-test] + if: needs.changes.outputs.desktop == 'true' strategy: fail-fast: false matrix: @@ -156,7 +174,8 @@ jobs: if-no-files-found: warn build-flatpak: - needs: build-desktop + needs: [changes, build-desktop] + if: needs.changes.outputs.desktop == 'true' runs-on: ubuntu-latest container: image: ghcr.io/flathub-infra/flatpak-github-actions:gnome-48@sha256:50fea670968fd3ec4aeeb3a91d9d807d0af6eab3c3b44c33d4c40c311832c8fa