From c3bf328eef10c619ba3e10b08095aca49f3300b0 Mon Sep 17 00:00:00 2001 From: yusufipk Date: Sat, 5 Sep 2026 09:37:08 +0300 Subject: [PATCH] Build the bundle only for what the bundle is built from The trigger listed dikte/ggml.py, both test files and the two READMEs, which are among the files that change most often. A typo fix in the README started a run that builds a container image, compiles every Vulkan shader and starts two more containers, with a 45 minute timeout on it because that is roughly what it costs. Nothing is lost. What ties ggml.py to the release, the tag, version, commit and reviewed digest, is asserted in tests/test_packaging.py, and that file already runs on every pull request in milliseconds. --- .github/workflows/whisper-vulkan.yml | 9 ++++----- tests/test_packaging.py | 15 +++++++++++---- 2 files changed, 15 insertions(+), 9 deletions(-) diff --git a/.github/workflows/whisper-vulkan.yml b/.github/workflows/whisper-vulkan.yml index e3bdf05..4e76d0c 100644 --- a/.github/workflows/whisper-vulkan.yml +++ b/.github/workflows/whisper-vulkan.yml @@ -1,15 +1,14 @@ name: whisper.cpp Vulkan bundle +# Only what the bundle is built from. Compiling the Vulkan shaders takes +# tens of minutes, and a README typo is not worth one: what ties ggml.py to +# this release is a handful of assertions in tests/test_packaging.py, and +# those run on every pull request in milliseconds. on: pull_request: paths: - packaging/whisper-vulkan/** - .github/workflows/whisper-vulkan.yml - - dikte/ggml.py - - tests/test_ggml.py - - tests/test_packaging.py - - README.md - - README.tr.md workflow_dispatch: inputs: whisper_version: diff --git a/tests/test_packaging.py b/tests/test_packaging.py index f9addff..9bffa10 100644 --- a/tests/test_packaging.py +++ b/tests/test_packaging.py @@ -58,11 +58,18 @@ class WhisperVulkanPackaging(unittest.TestCase): publish_script = publish_script.split(" run: |", 1)[1] self.assertNotIn("${{ inputs.", publish_script) - def test_bundle_ci_runs_when_its_installer_or_contract_changes(self): + def test_bundle_ci_runs_only_for_what_the_bundle_is_built_from(self): + """A 45 minute build on a README typo is a tax on every other change. + + What ties ggml.py to the release is checked in this file instead, and + this file runs on every pull request in milliseconds.""" workflow = WORKFLOW.read_text(encoding="utf-8") - for path in ("dikte/ggml.py", "tests/test_packaging.py", - "README.md", "README.tr.md"): - self.assertIn(f"- {path}", workflow) + trigger = workflow.split("workflow_dispatch:", 1)[0] + self.assertIn("- packaging/whisper-vulkan/**", trigger) + self.assertIn("- .github/workflows/whisper-vulkan.yml", trigger) + for path in ("dikte/ggml.py", "tests/test_ggml.py", + "tests/test_packaging.py", "README.md", "README.tr.md"): + self.assertNotIn(f"- {path}", trigger) def test_the_validator_checks_tar_links_before_extraction(self): validator = (PACKAGING / "validate-package.sh").read_text(