From 0467e1d8e8392e6ebd2357d0eaf52f6986ba6056 Mon Sep 17 00:00:00 2001 From: Owen McGirr Date: Fri, 16 Oct 2026 01:40:08 +0100 Subject: [PATCH] CI: keep the matrix check names when skipping native builds Skipping the native job at job level reported one "native" check, but branch protection requires "native (windows-latest, nsis)" and "native (macos-14, app,dmg)", so docs-only pull requests stayed blocked. The matrix jobs now always run and every step carries the docs-only condition instead, so they finish in about a minute under the required names. Closes #1088 Co-Authored-By: Claude Fable 5.1 --- .github/workflows/ci.yml | 41 ++++++++++++++++++++++++++-------------- 1 file changed, 27 insertions(+), 14 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index b4313bd2..e7cb8449 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -125,10 +125,9 @@ jobs: fi native: - # Docs-only changes skip the native builds. A skipped job still satisfies - # the required status check, so such pull requests can merge. + # Docs-only changes skip every step but keep the matrix check names that + # branch protection requires, so such pull requests can merge quickly. needs: changes - if: needs.changes.outputs.app == 'true' strategy: fail-fast: false matrix: @@ -140,54 +139,65 @@ jobs: runs-on: ${{ matrix.os }} steps: - uses: actions/checkout@d23441a48e516b6c34aea4fa41551a30e30af803 # v6 + if: needs.changes.outputs.app == 'true' - uses: actions/setup-node@249970729cb0ef3589644e2896645e5dc5ba9c38 # v6 + if: needs.changes.outputs.app == 'true' with: node-version: 24 cache: npm cache-dependency-path: package-lock.json - uses: dtolnay/rust-toolchain@4360b52568e2003a75bf9bc1d59f33a8e3fc893c # stable + if: needs.changes.outputs.app == 'true' with: toolchain: 1.97.1 components: rustfmt, clippy - run: npm ci + if: needs.changes.outputs.app == 'true' - name: Fetch prediction model and released companion workers + if: needs.changes.outputs.app == 'true' run: npm run prediction-model - name: Diagnose released ARM worker - if: runner.os == 'macOS' + if: needs.changes.outputs.app == 'true' && (runner.os == 'macOS') env: SWITCHIFY_BENCHMARK_MODEL: src-tauri/resources/prediction-model/english.sqlite SWITCHIFY_BENCHMARK_WORKER: src-tauri/binaries/switchify-smol-worker-aarch64-apple-darwin run: python3 scripts/probe-neural-worker.py - run: cargo fmt --manifest-path src-tauri/Cargo.toml --check + if: needs.changes.outputs.app == 'true' - run: cargo clippy --locked --manifest-path src-tauri/Cargo.toml --all-targets -- -D warnings + if: needs.changes.outputs.app == 'true' - run: cargo test --locked --manifest-path src-tauri/Cargo.toml + if: needs.changes.outputs.app == 'true' - run: cargo fmt --manifest-path tools/updater-signature-verifier/Cargo.toml --check + if: needs.changes.outputs.app == 'true' - run: cargo clippy --locked --manifest-path tools/updater-signature-verifier/Cargo.toml --all-targets -- -D warnings + if: needs.changes.outputs.app == 'true' - run: cargo test --locked --manifest-path tools/updater-signature-verifier/Cargo.toml - - if: runner.os == 'Windows' + if: needs.changes.outputs.app == 'true' + - if: needs.changes.outputs.app == 'true' && (runner.os == 'Windows') run: cargo fmt --manifest-path src-tauri/startup-launcher/Cargo.toml --check - - if: runner.os == 'Windows' + - if: needs.changes.outputs.app == 'true' && (runner.os == 'Windows') run: cargo clippy --locked --manifest-path src-tauri/startup-launcher/Cargo.toml --all-targets -- -D warnings - - if: runner.os == 'Windows' + - if: needs.changes.outputs.app == 'true' && (runner.os == 'Windows') run: cargo test --locked --manifest-path src-tauri/startup-launcher/Cargo.toml - - if: runner.os == 'macOS' + - if: needs.changes.outputs.app == 'true' && (runner.os == 'macOS') run: npm run tauri build -- --bundles ${{ matrix.bundles }} --no-sign - - if: runner.os == 'Windows' + - if: needs.changes.outputs.app == 'true' && (runner.os == 'Windows') run: pwsh ./scripts/Build-WindowsUiAccess.ps1 -SkipSign - - if: runner.os == 'Windows' + - if: needs.changes.outputs.app == 'true' && (runner.os == 'Windows') run: | $env:SWITCHIFY_ALLOW_UNSIGNED_UIACCESS_PACKAGE = '1' pwsh ./scripts/Verify-WindowsUiAccessPackage.ps1 - name: Verify macOS packaged prediction resources - if: runner.os == 'macOS' + if: needs.changes.outputs.app == 'true' && (runner.os == 'macOS') shell: bash run: | model=$(node scripts/check-packaged-prediction.mjs src-tauri/target/release/bundle/macos) echo "SWITCHIFY_BENCHMARK_MODEL=$model" >> "$GITHUB_ENV" echo "SWITCHIFY_BENCHMARK_WORKER=$(node scripts/check-packaged-prediction.mjs src-tauri/target/release/bundle/macos --worker)" >> "$GITHUB_ENV" - name: Verify Windows packaged prediction resources - if: runner.os == 'Windows' + if: needs.changes.outputs.app == 'true' && (runner.os == 'Windows') shell: pwsh run: | $installer = Get-ChildItem src-tauri/target/release/bundle/nsis/*.exe | Select-Object -First 1 @@ -201,21 +211,24 @@ jobs: if ($LASTEXITCODE -ne 0) { throw 'Packaged workers failed verification.' } "SWITCHIFY_BENCHMARK_WORKER=$worker" >> $env:GITHUB_ENV - name: Measure packaged prediction without desktop input + if: needs.changes.outputs.app == 'true' env: SWITCHIFY_BENCHMARK_REPORT: prediction-benchmark.json run: cargo test --release --lib --locked --manifest-path src-tauri/Cargo.toml bundled_prediction_benchmark -- --ignored --nocapture --test-threads=1 - uses: actions/setup-python@a26af69be951a213d495a4c3e4e4022e16d87065 # v5 + if: needs.changes.outputs.app == 'true' with: python-version: '3.13' - name: Measure packaged neural integration without desktop input + if: needs.changes.outputs.app == 'true' run: | python -m pip install psutil==7.0.0 python scripts/measure-neural.py --build --output src-tauri/neural-benchmark.json - name: Diagnose packaged worker after benchmark failure - if: failure() && env.SWITCHIFY_BENCHMARK_WORKER != '' + if: needs.changes.outputs.app == 'true' && (failure() && env.SWITCHIFY_BENCHMARK_WORKER != '') run: python scripts/probe-neural-worker.py - name: Upload prediction measurements - if: always() + if: needs.changes.outputs.app == 'true' && (always()) uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4 with: name: prediction-benchmark-${{ runner.os }}