Skip to content

Local UI to run and train LLMs and diffusion models. Supports GGUF, MLX, Qwen3.8, DeepSeek-V4.1, MiniMax-H3, Gemma 4, FLUX and more.

CI: skip Windows, macOS and Tauri jobs on draft pull requests (#14971)

Daniel Han8a60386fbdc4
diff --git a/.github/workflows/clean-machine-install-ci.yml b/.github/workflows/clean-machine-install-ci.yml
index 0869b31ad29..983d5b6f0c2 100644
--- a/.github/workflows/clean-machine-install-ci.yml
+++ b/.github/workflows/clean-machine-install-ci.yml
@@ -47,6 +47,9 @@ name: Clean machine install
on:
pull_request:
+ # ready_for_review: Windows/macOS jobs below skip draft pull requests, so marking
+ # one ready has to start the run that tests it.
+ types: [opened, synchronize, reopened, ready_for_review]
paths:
- 'install.sh'
- 'install.ps1'
@@ -216,6 +219,7 @@ jobs:
# ── macOS: the reported failure ────────────────────────────────────────────
macos:
+ if: github.event_name != 'pull_request' || !github.event.pull_request.draft
name: mac ${{ matrix.os }} / ${{ matrix.mode }} / ${{ matrix.delivery }}${{ matrix.flags && format(' {0}', matrix.flags) || '' }}
needs: select
runs-on: ${{ matrix.os }}
@@ -1277,6 +1281,7 @@ jobs:
# ── Windows ───────────────────────────────────────────────────────────────
windows:
+ if: github.event_name != 'pull_request' || !github.event.pull_request.draft
name: win ${{ matrix.os }} / winget=${{ matrix.winget }}
needs: select
runs-on: ${{ matrix.os }}
@@ -1662,7 +1667,7 @@ jobs:
name: virgin win container / probe
needs: select
# Only a gate for the install rows: skipped with them when none is selected.
- if: needs.select.outputs.windows_container_install_count != '0'
+ if: (needs.select.outputs.windows_container_install_count != '0') && (github.event_name != 'pull_request' || !github.event.pull_request.draft)
runs-on: windows-2022
timeout-minutes: 30
env:
@@ -1741,7 +1746,7 @@ jobs:
windows_container_install:
name: virgin win container / overlay=${{ matrix.overlay }}
needs: [select, windows_container_probe]
- if: needs.select.outputs.windows_container_install_count != '0'
+ if: (needs.select.outputs.windows_container_install_count != '0') && (github.event_name != 'pull_request' || !github.event.pull_request.draft)
runs-on: windows-2022
timeout-minutes: 90
env:
diff --git a/.github/workflows/desktop-app-clean-machine-ci.yml b/.github/workflows/desktop-app-clean-machine-ci.yml
index 5ac1f6f61e0..6e2628c1626 100644
--- a/.github/workflows/desktop-app-clean-machine-ci.yml
+++ b/.github/workflows/desktop-app-clean-machine-ci.yml
@@ -23,6 +23,9 @@ on:
# from the DEFAULT branch, so an edit on a feature branch could only run after a blind
# merge.
pull_request:
+ # ready_for_review: Windows/macOS jobs below skip draft pull requests, so marking
+ # one ready has to start the run that tests it.
+ types: [opened, synchronize, reopened, ready_for_review]
paths:
- '.github/workflows/desktop-app-clean-machine-ci.yml'
- '.github/scripts/retry-with-apt-lock.sh'
@@ -114,7 +117,7 @@ jobs:
# A fork PR's token is read-only whatever this workflow declares, so it cannot list
# review drafts. Skip rather than fail: a
# property of the trigger, not a broken release.
- if: github.event.pull_request.head.repo.fork != true
+ if: (github.event.pull_request.head.repo.fork != true) && (github.event_name != 'pull_request' || !github.event.pull_request.draft)
name: desktop macOS ${{ matrix.os }}
runs-on: ${{ matrix.os }}
timeout-minutes: 45
@@ -1018,7 +1021,7 @@ jobs:
# ── Windows: NSIS setup.exe, silent install ──────────────────────────────
windows:
# See the macOS job: a fork PR's token cannot list drafts, so skip rather than fail.
- if: github.event.pull_request.head.repo.fork != true
+ if: (github.event.pull_request.head.repo.fork != true) && (github.event_name != 'pull_request' || !github.event.pull_request.draft)
name: desktop windows
runs-on: windows-latest
# 60, not 45: a full torch install is slowest on Windows.
diff --git a/.github/workflows/interrupted-install-ci.yml b/.github/workflows/interrupted-install-ci.yml
index fe342383c40..bffd996574f 100644
--- a/.github/workflows/interrupted-install-ci.yml
+++ b/.github/workflows/interrupted-install-ci.yml
@@ -27,6 +27,9 @@ name: Interrupted install recovery
on:
pull_request:
+ # ready_for_review: Windows/macOS jobs below skip draft pull requests, so marking
+ # one ready has to start the run that tests it.
+ types: [opened, synchronize, reopened, ready_for_review]
paths:
- 'install.sh'
- 'install.ps1'
@@ -335,7 +338,7 @@ jobs:
# only printed by Write-TauriLog (install.ps1:2440), so the torch leg's marker could
# never appear. The runner is ephemeral, so the default root is safe to install into.
needs: select
- if: needs.select.outputs.interrupt_windows_count != '0'
+ if: (needs.select.outputs.interrupt_windows_count != '0') && (github.event_name != 'pull_request' || !github.event.pull_request.draft)
runs-on: windows-latest
timeout-minutes: 90
strategy:
diff --git a/.github/workflows/mlx-ci.yml b/.github/workflows/mlx-ci.yml
index a7b40bb87f5..e53e5d8c70e 100644
--- a/.github/workflows/mlx-ci.yml
+++ b/.github/workflows/mlx-ci.yml
@@ -73,6 +73,9 @@ name: MLX CI on Mac M1
on:
pull_request:
+ # ready_for_review: Windows/macOS jobs below skip draft pull requests, so marking
+ # one ready has to start the run that tests it.
+ types: [opened, synchronize, reopened, ready_for_review]
paths:
- 'unsloth/__init__.py'
- 'unsloth/_gpu_init.py'
@@ -191,6 +194,7 @@ permissions:
jobs:
dispatch:
+ if: github.event_name != 'pull_request' || !github.event.pull_request.draft
name: dispatch
# macos-26, not macos-15, on a measurement rather than a preference. Both are
# free Apple Silicon standard runners, so this is the same class of machine.
diff --git a/.github/workflows/pester-guard-ci.yml b/.github/workflows/pester-guard-ci.yml
index c69f7d7be0d..e4facc6a5fc 100644
--- a/.github/workflows/pester-guard-ci.yml
+++ b/.github/workflows/pester-guard-ci.yml
@@ -14,6 +14,9 @@ name: Pester guard
on:
pull_request:
+ # ready_for_review: Windows/macOS jobs below skip draft pull requests, so marking
+ # one ready has to start the run that tests it.
+ types: [opened, synchronize, reopened, ready_for_review]
paths:
- 'tests/studio/test_pester_bootstrap_hardening.py'
- '.github/workflows/pester-guard-ci.yml'
@@ -28,6 +31,7 @@ permissions:
jobs:
guard:
+ if: github.event_name != 'pull_request' || !github.event.pull_request.draft
name: Pester bootstrap guard
runs-on: windows-latest
timeout-minutes: 10
diff --git a/.github/workflows/studio-export-capability-ci.yml b/.github/workflows/studio-export-capability-ci.yml
index 1a5041794f0..af8f29da3e2 100644
--- a/.github/workflows/studio-export-capability-ci.yml
+++ b/.github/workflows/studio-export-capability-ci.yml
@@ -9,6 +9,9 @@ name: Unsloth export capability
on:
pull_request:
+ # ready_for_review: Windows/macOS jobs below skip draft pull requests, so marking
+ # one ready has to start the run that tests it.
+ types: [opened, synchronize, reopened, ready_for_review]
paths:
- 'studio/backend/core/export/export.py'
- 'studio/backend/routes/export.py'
@@ -85,6 +88,7 @@ permissions:
jobs:
capability:
+ if: github.event_name != 'pull_request' || !github.event.pull_request.draft
name: capability (${{ matrix.os }})
strategy:
fail-fast: false
diff --git a/.github/workflows/studio-frontend-ci.yml b/.github/workflows/studio-frontend-ci.yml
index ab1690c48da..866fcb19ea2 100644
--- a/.github/workflows/studio-frontend-ci.yml
+++ b/.github/workflows/studio-frontend-ci.yml
@@ -13,6 +13,9 @@ name: Frontend CI
on:
pull_request:
+ # ready_for_review: Windows/macOS jobs below skip draft pull requests, so marking
+ # one ready has to start the run that tests it.
+ types: [opened, synchronize, reopened, ready_for_review]
paths:
- 'studio/frontend/**'
- 'scripts/check_frontend_dep_removal.py'
@@ -720,6 +723,7 @@ jobs:
# runner's core.autocrlf says, and the assertions that match on exact source
# substrings see the bytes in the repo.
windows:
+ if: github.event_name != 'pull_request' || !github.event.pull_request.draft
name: Frontend unit tests (Windows)
runs-on: windows-latest
# 30, not 15. The cap stopped fitting the job's own steps once the browser smokes
diff --git a/.github/workflows/studio-mac-install-matrix.yml b/.github/workflows/studio-mac-install-matrix.yml
index 4fe09f9695c..ae1ee8cf45f 100644
--- a/.github/workflows/studio-mac-install-matrix.yml
+++ b/.github/workflows/studio-mac-install-matrix.yml
@@ -10,6 +10,9 @@ name: Mac Unsloth Install Matrix CI
on:
pull_request:
+ # ready_for_review: Windows/macOS jobs below skip draft pull requests, so marking
+ # one ready has to start the run that tests it.
+ types: [opened, synchronize, reopened, ready_for_review]
paths:
- 'studio/install_llama_prebuilt.py'
- 'studio/setup.sh'
@@ -120,6 +123,7 @@ permissions:
jobs:
install-load:
+ if: github.event_name != 'pull_request' || !github.event.pull_request.draft
name: Install + load (${{ matrix.os }})
runs-on: ${{ matrix.os }}
timeout-minutes: 25
diff --git a/.github/workflows/studio-mac-ui-smoke.yml b/.github/workflows/studio-mac-ui-smoke.yml
index 04ceb2e932b..5770b11be84 100644
--- a/.github/workflows/studio-mac-ui-smoke.yml
+++ b/.github/workflows/studio-mac-ui-smoke.yml
@@ -26,6 +26,9 @@ name: Mac Unsloth UI + API + Update + Inference CI
on:
pull_request:
+ # ready_for_review: Windows/macOS jobs below skip draft pull requests, so marking
+ # one ready has to start the run that tests it.
+ types: [opened, synchronize, reopened, ready_for_review]
paths:
# The two halves Playwright drives, the backend and the React bundle, plus the
# installer and CLI that put them on the box. Not studio/** and unsloth/**: the
@@ -151,6 +154,7 @@ permissions:
jobs:
ui-smoke:
+ if: github.event_name != 'pull_request' || !github.event.pull_request.draft
name: Chat UI, API, Update and GGUF inference
runs-on: macos-15
# 35 covered the UI phases alone. The absorbed API and update phases each
diff --git a/.github/workflows/studio-tauri-smoke.yml b/.github/workflows/studio-tauri-smoke.yml
index f373b09d1a7..ffdd7260a54 100644
--- a/.github/workflows/studio-tauri-smoke.yml
+++ b/.github/workflows/studio-tauri-smoke.yml
@@ -18,6 +18,9 @@ name: Unsloth Tauri CI
on:
pull_request:
+ # ready_for_review: every job below skips draft pull requests, so marking
+ # one ready has to start the run that tests it.
+ types: [opened, synchronize, reopened, ready_for_review]
paths:
- 'studio/frontend/**'
- 'studio/src-tauri/**'
@@ -81,6 +84,7 @@ permissions:
jobs:
linux-debug-build:
+ if: github.event_name != 'pull_request' || !github.event.pull_request.draft
name: Tauri Linux debug build (no codesign)
runs-on: ubuntu-22.04
timeout-minutes: 25
@@ -329,6 +333,7 @@ jobs:
# checking, so nothing there compiles that code, let alone runs its tests.
# That is how the RemoteSigned regression in #7819 reached two draft bundles.
windows-unit-tests:
+ if: github.event_name != 'pull_request' || !github.event.pull_request.draft
name: Rust unit tests (windows)
runs-on: windows-latest
# A cold cache compiles both the debug and the release dependency tree.
@@ -382,6 +387,7 @@ jobs:
run: cargo check --all-targets --release
macos-unit-tests:
+ if: github.event_name != 'pull_request' || !github.event.pull_request.draft
name: Rust unit tests (macos)
# macos-26, not macos-15, on a measurement rather than a preference. Both are
# free Apple Silicon standard runners, so this is the same class of machine.
diff --git a/.github/workflows/studio-update-smoke.yml b/.github/workflows/studio-update-smoke.yml
index 4142d6705d4..efb996eddbb 100644
--- a/.github/workflows/studio-update-smoke.yml
+++ b/.github/workflows/studio-update-smoke.yml
@@ -13,6 +13,9 @@ name: Unsloth Update CI
on:
pull_request:
+ # ready_for_review: Windows/macOS jobs below skip draft pull requests, so marking
+ # one ready has to start the run that tests it.
+ types: [opened, synchronize, reopened, ready_for_review]
paths:
- 'install.sh'
- 'scripts/uninstall.sh'
@@ -432,6 +435,7 @@ jobs:
retention-days: 7
idempotency-macos:
+ if: github.event_name != 'pull_request' || !github.event.pull_request.draft
name: Unsloth Updating Tests (macOS)
runs-on: macos-15
# The install is the expensive half; the harness itself is three updates that are
@@ -493,6 +497,7 @@ jobs:
retention-days: 7
idempotency-windows:
+ if: github.event_name != 'pull_request' || !github.event.pull_request.draft
name: Unsloth Updating Tests (Windows)
runs-on: windows-latest
# Windows installs are 3x the Linux ones (268-292s against 88s in the API smoke),
diff --git a/.github/workflows/studio-windows-api-smoke.yml b/.github/workflows/studio-windows-api-smoke.yml
index d68794e0f19..16b4f44770a 100644
--- a/.github/workflows/studio-windows-api-smoke.yml
+++ b/.github/workflows/studio-windows-api-smoke.yml
@@ -14,6 +14,9 @@ name: Windows Unsloth API CI
on:
pull_request:
+ # ready_for_review: Windows/macOS jobs below skip draft pull requests, so marking
+ # one ready has to start the run that tests it.
+ types: [opened, synchronize, reopened, ready_for_review]
paths:
# What the test boots: the backend, the Windows installer chain and the CLI.
# studio/frontend/** stays because install.ps1 builds the bundle and the dist cache
@@ -88,6 +91,7 @@ permissions:
jobs:
api-smoke:
+ if: github.event_name != 'pull_request' || !github.event.pull_request.draft
name: Unsloth API & Auth Tests
runs-on: windows-latest
timeout-minutes: 30
diff --git a/.github/workflows/studio-windows-inference-smoke.yml b/.github/workflows/studio-windows-inference-smoke.yml
index ddeef628657..1f844a12137 100644
--- a/.github/workflows/studio-windows-inference-smoke.yml
+++ b/.github/workflows/studio-windows-inference-smoke.yml
@@ -23,6 +23,9 @@ name: Windows Unsloth GGUF CI
on:
pull_request:
+ # ready_for_review: Windows/macOS jobs below skip draft pull requests, so marking
+ # one ready has to start the run that tests it.
+ types: [opened, synchronize, reopened, ready_for_review]
paths:
# What the phases exercise: the backend's OpenAI and Anthropic surfaces over the
# Windows llama.cpp prebuilt, the installer chain and the CLI. studio/frontend/**
@@ -131,6 +134,7 @@ jobs:
# phase, earlier phases' logs survive it, and later phases still run -- the
# same independence the three jobs had.
inference-smoke:
+ if: github.event_name != 'pull_request' || !github.event.pull_request.draft
name: GGUF inference smoke (API, tools, vision)
runs-on: windows-latest
# Was 30 + 30 + 35 across three runners. Sequentially they share one install,
@@ -1518,6 +1522,7 @@ jobs:
# ── folded from studio-windows-no-vs-smoke.yml: install + run with no Visual Studio ──
no-vs-cpu:
+ if: github.event_name != 'pull_request' || !github.event.pull_request.draft
name: Unsloth install + inference without Visual Studio
runs-on: windows-latest
timeout-minutes: 35
@@ -1852,6 +1857,7 @@ jobs:
# of them writes the VC++ registry keys the round-trip reads as ground truth,
# so its clean-box precondition still holds when it starts.
small-checks:
+ if: github.event_name != 'pull_request' || !github.event.pull_request.draft
name: ${{ matrix.name }}
strategy:
fail-fast: false
diff --git a/.github/workflows/studio-windows-ui-smoke.yml b/.github/workflows/studio-windows-ui-smoke.yml
index 6da64eade3c..dde8c472c57 100644
--- a/.github/workflows/studio-windows-ui-smoke.yml
+++ b/.github/workflows/studio-windows-ui-smoke.yml
@@ -12,6 +12,9 @@ name: Windows Unsloth UI CI
on:
pull_request:
+ # ready_for_review: Windows/macOS jobs below skip draft pull requests, so marking
+ # one ready has to start the run that tests it.
+ types: [opened, synchronize, reopened, ready_for_review]
paths:
# The two halves the lanes drive, the backend and the React bundle, plus the
# Windows installer chain and the CLI. Not unsloth/** or studio/src-tauri: the
@@ -100,6 +103,7 @@ permissions:
jobs:
ui-smoke:
+ if: github.event_name != 'pull_request' || !github.event.pull_request.draft
name: Chat UI Tests
runs-on: windows-latest
timeout-minutes: 45
diff --git a/.github/workflows/studio-windows-update-smoke.yml b/.github/workflows/studio-windows-update-smoke.yml
index b56e76e384a..33b11bf3d0c 100644
--- a/.github/workflows/studio-windows-update-smoke.yml
+++ b/.github/workflows/studio-windows-update-smoke.yml
@@ -21,6 +21,9 @@ name: Windows Unsloth Update CI
on:
pull_request:
+ # ready_for_review: Windows/macOS jobs below skip draft pull requests, so marking
+ # one ready has to start the run that tests it.
+ types: [opened, synchronize, reopened, ready_for_review]
paths:
- 'install.ps1'
- '.github/actions/frontend-dist-restore/action.yml'
@@ -94,6 +97,7 @@ permissions:
jobs:
update-idempotency:
+ if: github.event_name != 'pull_request' || !github.event.pull_request.draft
name: Unsloth Updating Tests
runs-on: windows-latest
timeout-minutes: 30
diff --git a/.github/workflows/windows-amsi-defender-differential-ci.yml b/.github/workflows/windows-amsi-defender-differential-ci.yml
index 0bc636394e3..e982beb3e11 100644
--- a/.github/workflows/windows-amsi-defender-differential-ci.yml
+++ b/.github/workflows/windows-amsi-defender-differential-ci.yml
@@ -33,6 +33,9 @@ name: "Windows: AMSI and Defender differential"
on:
workflow_dispatch:
pull_request:
+ # ready_for_review: Windows/macOS jobs below skip draft pull requests, so marking
+ # one ready has to start the run that tests it.
+ types: [opened, synchronize, reopened, ready_for_review]
paths:
- 'install.ps1'
- 'studio/setup.ps1'
@@ -54,6 +57,7 @@ concurrency:
jobs:
measure:
+ if: github.event_name != 'pull_request' || !github.event.pull_request.draft
name: does the scanner refuse either side
runs-on: windows-latest
timeout-minutes: 30
diff --git a/.github/workflows/windows-application-control-ci.yml b/.github/workflows/windows-application-control-ci.yml
index 442ba1b6cb2..e47f9869fb6 100644
--- a/.github/workflows/windows-application-control-ci.yml
+++ b/.github/workflows/windows-application-control-ci.yml
@@ -41,6 +41,9 @@ name: Windows Application Control CI
on:
pull_request:
+ # ready_for_review: Windows/macOS jobs below skip draft pull requests, so marking
+ # one ready has to start the run that tests it.
+ types: [opened, synchronize, reopened, ready_for_review]
paths:
- 'install.ps1'
- 'scripts/uninstall.ps1'
@@ -97,6 +100,7 @@ permissions:
jobs:
applocker-denied-launcher:
+ if: github.event_name != 'pull_request' || !github.event.pull_request.draft
name: installer survives a denied unsloth.exe
runs-on: windows-latest
timeout-minutes: 45
diff --git a/.github/workflows/windows-arm64-ci.yml b/.github/workflows/windows-arm64-ci.yml
index 968cf553499..b239699918d 100644
--- a/.github/workflows/windows-arm64-ci.yml
+++ b/.github/workflows/windows-arm64-ci.yml
@@ -43,6 +43,9 @@ on:
- 'studio/backend/utils/wheel_utils.py'
- 'studio/backend/utils/uv_path_safety.py'
pull_request:
+ # ready_for_review: Windows/macOS jobs below skip draft pull requests, so marking
+ # one ready has to start the run that tests it.
+ types: [opened, synchronize, reopened, ready_for_review]
paths:
- 'install.ps1'
- 'scripts/uninstall.ps1'
@@ -91,6 +94,7 @@ permissions:
jobs:
woa:
+ if: github.event_name != 'pull_request' || !github.event.pull_request.draft
# Free for public repositories since 2025-08-07; a fork on a private plan fails to start.
runs-on: windows-11-arm
timeout-minutes: 40
diff --git a/.github/workflows/windows-llama-signature-audit.yml b/.github/workflows/windows-llama-signature-audit.yml
index 3fc78dcc33e..1e3c486d90d 100644
--- a/.github/workflows/windows-llama-signature-audit.yml
+++ b/.github/workflows/windows-llama-signature-audit.yml
@@ -19,6 +19,9 @@ on:
schedule:
- cron: '17 6 * * 1'
pull_request:
+ # ready_for_review: Windows/macOS jobs below skip draft pull requests, so marking
+ # one ready has to start the run that tests it.
+ types: [opened, synchronize, reopened, ready_for_review]
paths:
- '.github/workflows/windows-llama-signature-audit.yml'
- 'scripts/windows_sac_probe/**'
@@ -32,6 +35,7 @@ concurrency:
jobs:
audit:
+ if: github.event_name != 'pull_request' || !github.event.pull_request.draft
name: Audit signatures
runs-on: windows-latest
timeout-minutes: 30
@@ -189,6 +193,7 @@ jobs:
# The job above reads certificate tables.
code-integrity:
+ if: github.event_name != 'pull_request' || !github.event.pull_request.draft
name: App Control audit (signature-only)
runs-on: windows-latest
timeout-minutes: 30
diff --git a/.github/workflows/windows-no-compiler-ci.yml b/.github/workflows/windows-no-compiler-ci.yml
index 56958a07e6f..e2e8e2254b6 100644
--- a/.github/workflows/windows-no-compiler-ci.yml
+++ b/.github/workflows/windows-no-compiler-ci.yml
@@ -36,6 +36,9 @@ name: Windows No Compiler CI
on:
pull_request:
+ # ready_for_review: Windows/macOS jobs below skip draft pull requests, so marking
+ # one ready has to start the run that tests it.
+ types: [opened, synchronize, reopened, ready_for_review]
paths:
- 'install.ps1'
- 'studio/setup.ps1'
@@ -114,6 +117,7 @@ permissions:
jobs:
no-compiler-under-the-installer:
+ if: github.event_name != 'pull_request' || !github.event.pull_request.draft
name: the installer spawns no C# compiler
runs-on: windows-latest
timeout-minutes: 60
diff --git a/.github/workflows/windows-vt-preflight.yml b/.github/workflows/windows-vt-preflight.yml
index 6ca20fe439b..e59a817a006 100644
--- a/.github/workflows/windows-vt-preflight.yml
+++ b/.github/workflows/windows-vt-preflight.yml
@@ -23,6 +23,9 @@ name: "Windows: virtual terminal preflight"
on:
workflow_dispatch:
pull_request:
+ # ready_for_review: Windows/macOS jobs below skip draft pull requests, so marking
+ # one ready has to start the run that tests it.
+ types: [opened, synchronize, reopened, ready_for_review]
paths:
- '.github/scripts/Probe-VirtualTerminal.ps1'
- '.github/workflows/windows-vt-preflight.yml'
@@ -36,6 +39,7 @@ concurrency:
jobs:
measure:
+ if: github.event_name != 'pull_request' || !github.event.pull_request.draft
name: "property vs native call (${{ matrix.os }})"
runs-on: ${{ matrix.os }}
timeout-minutes: 10
@@ -160,7 +164,7 @@ jobs:
agree:
name: did every measured host agree
needs: measure
- if: always()
+ if: (always()) && (github.event_name != 'pull_request' || !github.event.pull_request.draft)
runs-on: ubuntu-latest
timeout-minutes: 5
steps:
diff --git a/.github/workflows/workflow-trigger-lint.yml b/.github/workflows/workflow-trigger-lint.yml
index 31e620293a0..d6aa54e1189 100644
--- a/.github/workflows/workflow-trigger-lint.yml
+++ b/.github/workflows/workflow-trigger-lint.yml
@@ -157,6 +157,7 @@ jobs:
tests/studio/test_en_catalog.py \
tests/studio/test_frontend_dep_removal.py \
tests/studio/test_frontend_dist_cache.py \
+ tests/studio/test_heavy_suites_skip_draft_prs.py \
tests/studio/test_gguf_smoke_phases_stay_independent.py \
tests/studio/test_indicator_browsers_run_in_parallel.py \
tests/studio/test_inference_smoke_http_diagnostics.py \
diff --git a/tests/studio/test_heavy_suites_skip_draft_prs.py b/tests/studio/test_heavy_suites_skip_draft_prs.py
new file mode 100644
index 00000000000..157830b06ce
--- /dev/null
+++ b/tests/studio/test_heavy_suites_skip_draft_prs.py
@@ -0,0 +1,142 @@
+# SPDX-License-Identifier: AGPL-3.0-only
+# Copyright 2026-present the Unsloth AI Inc. team. All rights reserved. See /studio/LICENSE.AGPL-3.0
+
+"""Windows, macOS and Tauri jobs skip draft pull requests, and marking a PR ready runs them.
+
+Draft pushes were taking the scarcest runners for work nobody had asked to be tested yet.
+Each such job carries GATE in its `if`, and its workflow lists ready_for_review so the
+run that tests the PR starts when it leaves draft. Checked across every workflow, so a new
+Windows or macOS job cannot be added without the gate.
+"""
+
+import re
+from pathlib import Path
+
+import yaml
+
+REPO = Path(__file__).resolve().parents[2]
+WORKFLOWS = REPO / ".github" / "workflows"
+
+GATE = "github.event_name != 'pull_request' || !github.event.pull_request.draft"
+# Runs only when a label is added, which is already an explicit request for the run.
+EXEMPT = frozenset({"windows-installer-differential-ci.yml"})
+# Every job, Linux build included: the suite is the Tauri shell, not an OS.
+WHOLE = frozenset({"studio-tauri-smoke.yml"})
+_HEAVY = re.compile(r"windows|macos", re.I)
+
+
+def _documents() -> dict[str, dict]:
+ out = {}
+ for path in sorted(WORKFLOWS.glob("*.y*ml")):
+ document = yaml.safe_load(path.read_text(encoding = "utf-8"))
+ if isinstance(document, dict):
+ out[path.name] = document
+ return out
+
+
+def _pull_request(document: dict):
+ triggers = document.get(True) or document.get("on") or {}
+ if not isinstance(triggers, dict) or "pull_request" not in triggers:
+ return None
+ return triggers["pull_request"] or {}
+
+
+def _labels(job: dict) -> list[str] | None:
+ """The runner labels a job can land on, or None when its matrix is built at run time."""
+ runs_on = str(job.get("runs-on"))
+ found = re.search(r"matrix\.([\w-]+)", runs_on)
+ if not found:
+ return [runs_on]
+ matrix = (job.get("strategy") or {}).get("matrix")
+ if not isinstance(matrix, dict):
+ return None
+ values = matrix.get(found.group(1))
+ if isinstance(values, list):
+ return [str(value) for value in values]
+ include = matrix.get("include")
+ if isinstance(include, list) and all(
+ isinstance(i, dict) and found.group(1) in i for i in include
+ ):
+ return [str(i[found.group(1)]) for i in include]
+ return None
+
+
+def _heavy(name: str, job: dict) -> bool:
+ labels = _labels(job)
+ if labels is None:
+ # A matrix from a selector job: the job is named for the OS it runs on.
+ return bool(re.match(r"(macos|windows)\b", name))
+ return all(_HEAVY.search(label) for label in labels)
+
+
+def _gated_jobs() -> dict[str, list[str]]:
+ out = {}
+ for filename, document in _documents().items():
+ if filename in EXEMPT or _pull_request(document) is None:
+ continue
+ jobs = {n: j for n, j in (document.get("jobs") or {}).items() if isinstance(j, dict)}
+ names = {
+ n
+ for n, j in jobs.items()
+ if filename in WHOLE
+ or (
+ _heavy(n, j)
+ and str(j.get("if", "")).strip() != "github.event_name != 'pull_request'"
+ )
+ }
+ if names:
+ out[filename] = sorted(names)
+ return out
+
+
+def test_the_scan_found_the_heavy_suites():
+ """A rule that matched nothing would pass every check below."""
+ gated = _gated_jobs()
+ for filename in (
+ "studio-windows-ui-smoke.yml",
+ "studio-mac-ui-smoke.yml",
+ "studio-tauri-smoke.yml",
+ ):
+ assert (
+ filename in gated
+ ), f"{filename} has no Windows/macOS job by this scan; the scan is wrong"
+
+
+def test_windows_macos_and_tauri_jobs_skip_drafts():
+ documents = _documents()
+ missing = [
+ f"{filename}::{name}"
+ for filename, names in _gated_jobs().items()
+ for name in names
+ if GATE not in str(documents[filename]["jobs"][name].get("if", ""))
+ ]
+ assert not missing, (
+ f"{missing} run on draft pull requests. Add `{GATE}` to the job's `if` "
+ f"(AND it with any condition already there)."
+ )
+
+
+def test_marking_a_pull_request_ready_starts_the_skipped_jobs():
+ documents = _documents()
+ missing = []
+ for filename in _gated_jobs():
+ pull_request = _pull_request(documents[filename])
+ types = pull_request.get("types") if isinstance(pull_request, dict) else None
+ if not types or "ready_for_review" not in types:
+ missing.append(filename)
+ assert not missing, (
+ f"{missing} skip draft pull requests but do not list ready_for_review, so leaving "
+ f"draft starts nothing and the jobs only run on the next push."
+ )
+
+
+def test_ready_for_review_kept_the_default_events():
+ """Listing types replaces the defaults, so opened, synchronize and reopened must stay."""
+ documents = _documents()
+ dropped = {}
+ for filename in _gated_jobs():
+ types = set(_pull_request(documents[filename]).get("types") or ())
+ lost = {"opened", "synchronize", "reopened"} - types
+ if lost:
+ dropped[filename] = sorted(lost)
+ assert not dropped, f"these workflows stopped running on {dropped}"