diff options
| author | Jan Trencansky <jan.trencansky@protonmail.com> | 2026-12-01 12:43:58 -0500 |
|---|---|---|
| committer | Jan Trencansky <jan.trencansky@protonmail.com> | 2026-12-01 12:43:58 -0500 |
| commit | dfce074a05a58aed880f0385b5219ca8e755ce88 (patch) | |
| tree | da004a5134b4c9f827edc692953fe15db878f40f | |
| parent | d2a564b66a96127bc06bb348f3fae52d11e4461e (diff) | |
ci: exclude deprecated legacy C++ runtime/ from automatic CI runsci/exclude-legacy-cpp-runtime-tests
| -rw-r--r-- | .github/workflows/runtime.yml | 148 | ||||
| -rw-r--r-- | .github/workflows/xma2-decoder.yml | 22 | ||||
| -rw-r--r-- | docs/testing.md | 16 | ||||
| -rw-r--r-- | tests/test_ci_main_signal.py | 21 | ||||
| -rw-r--r-- | tests/test_runtime_paths.py | 31 |
5 files changed, 58 insertions, 180 deletions
diff --git a/.github/workflows/runtime.yml b/.github/workflows/runtime.yml index a6b1e0346..8628456eb 100644 --- a/.github/workflows/runtime.yml +++ b/.github/workflows/runtime.yml | |||
| @@ -1,141 +1,19 @@ | |||
| 1 | # Builds the loader (runtime/) with MSVC and Vulkan headers (plus GPU tools and llvmpipe tests on Linux) on runtime | 1 | # Builds the legacy C++ loader (runtime/) with MSVC and Vulkan headers (plus GPU tools and llvmpipe tests on Linux). |
| 2 | # or translator changes, so a change that breaks the C++ build or tests shows up in CI. | 2 | # The legacy C++ Vulkan runtime/ is deprecated in favor of the Rust DX12 runtime (d3d12/) and the new Rust Vulkan |
| 3 | # runtime (in progress), so automatic push, pull_request, and scheduled CI runs are disabled. Trigger manually via | ||
| 4 | # workflow_dispatch when needed. | ||
| 3 | name: Runtime | 5 | name: Runtime |
| 4 | 6 | ||
| 5 | on: | 7 | on: |
| 6 | # What can break this build: the runtime and its vendored queue, the scripts the jobs run, this workflow, the | ||
| 7 | # line endings every checkout gets (.gitattributes), and everything the tools those scripts read depend on - | ||
| 8 | # their sibling imports, the data files they load by name (gfx10_formats.json is one a .py-only scan misses) and | ||
| 9 | # the hw_oracle directory. Any other file under tools/ used to start a full Windows and Wine build it cannot break | ||
| 10 | # (BUILD-856); paths-ignore cannot say "everything under tools/ except these", so the event lists what triggers | ||
| 11 | # it. tests/test_runtime_paths.py recomputes the tools/ part and fails when an entry is missing; keep the two | ||
| 12 | # lists identical. | ||
| 13 | push: | ||
| 14 | branches: [main] | ||
| 15 | paths: | ||
| 16 | - "runtime/**" | ||
| 17 | - "third_party/**" | ||
| 18 | - "scripts/**" | ||
| 19 | - ".github/workflows/runtime.yml" | ||
| 20 | - ".gitattributes" | ||
| 21 | - "tools/hw_oracle/**" | ||
| 22 | - "tools/bary_fallback_gs.py" | ||
| 23 | - "tools/bcpack.py" | ||
| 24 | - "tools/bcpack_history_train.cpp" | ||
| 25 | - "tools/bcpack_tables.py" | ||
| 26 | - "tools/bcpack_tables_bptc.py" | ||
| 27 | - "tools/cf_diff.py" | ||
| 28 | - "tools/cf_ref.py" | ||
| 29 | - "tools/cfg_structure.py" | ||
| 30 | - "tools/conformance/**" | ||
| 31 | - "tools/cpu_ref.py" | ||
| 32 | - "tools/descriptor_sources.py" | ||
| 33 | - "tools/f32_fuzz.py" | ||
| 34 | - "tools/file_mode.py" | ||
| 35 | - "tools/first_light.py" | ||
| 36 | - "tools/fspx_unpack.py" | ||
| 37 | - "tools/fssm_header.py" | ||
| 38 | - "tools/fssm_unpack.py" | ||
| 39 | - "tools/gen_bcpack_runtime_tables.py" | ||
| 40 | - "tools/gen_d3d12_stubs.py" | ||
| 41 | - "tools/gfx10_formats.json" | ||
| 42 | - "tools/heap_index_census.py" | ||
| 43 | - "tools/lane_masks.py" | ||
| 44 | - "tools/lod_bias_probe.py" | ||
| 45 | - "tools/mc_command.py" | ||
| 46 | - "tools/mesh_compute_vs.py" | ||
| 47 | - "tools/native_pso_hashes.py" | ||
| 48 | - "tools/rdna2_decode.py" | ||
| 49 | - "tools/rdna2_isa_tables.py" | ||
| 50 | - "tools/rdna2spirv.py" | ||
| 51 | - "tools/replace_retry.py" | ||
| 52 | - "tools/report_paths.py" | ||
| 53 | - "tools/shader_carve.py" | ||
| 54 | - "tools/shader_carve_accel.py" | ||
| 55 | - "tools/shader_carve_native/**" | ||
| 56 | - "tools/shader_disasm.py" | ||
| 57 | - "tools/shader_ir.py" | ||
| 58 | - "tools/shader_meta.py" | ||
| 59 | - "tools/shader_stage_manifest.py" | ||
| 60 | - "tools/spirv_asm.py" | ||
| 61 | - "tools/spirv_asm_tables.py" | ||
| 62 | - "tools/spirv_loop_guard.py" | ||
| 63 | - "tools/spirv_opt.py" | ||
| 64 | - "tools/spirv_stubs.py" | ||
| 65 | - "tools/vk_lod_bias.py" | ||
| 66 | - "tools/vk_subgroup_info.py" | ||
| 67 | - "tools/wave64_emulate_opt.py" | ||
| 68 | - "tools/wave64_halves.py" | ||
| 69 | - "tools/xdxr_bvh.py" | ||
| 70 | pull_request: | ||
| 71 | paths: | ||
| 72 | - "runtime/**" | ||
| 73 | - "third_party/**" | ||
| 74 | - "scripts/**" | ||
| 75 | - ".github/workflows/runtime.yml" | ||
| 76 | - ".gitattributes" | ||
| 77 | - "tools/hw_oracle/**" | ||
| 78 | - "tools/bary_fallback_gs.py" | ||
| 79 | - "tools/bcpack.py" | ||
| 80 | - "tools/bcpack_history_train.cpp" | ||
| 81 | - "tools/bcpack_tables.py" | ||
| 82 | - "tools/bcpack_tables_bptc.py" | ||
| 83 | - "tools/cf_diff.py" | ||
| 84 | - "tools/cf_ref.py" | ||
| 85 | - "tools/cfg_structure.py" | ||
| 86 | - "tools/conformance/**" | ||
| 87 | - "tools/cpu_ref.py" | ||
| 88 | - "tools/descriptor_sources.py" | ||
| 89 | - "tools/f32_fuzz.py" | ||
| 90 | - "tools/file_mode.py" | ||
| 91 | - "tools/first_light.py" | ||
| 92 | - "tools/fspx_unpack.py" | ||
| 93 | - "tools/fssm_header.py" | ||
| 94 | - "tools/fssm_unpack.py" | ||
| 95 | - "tools/gen_bcpack_runtime_tables.py" | ||
| 96 | - "tools/gen_d3d12_stubs.py" | ||
| 97 | - "tools/gfx10_formats.json" | ||
| 98 | - "tools/heap_index_census.py" | ||
| 99 | - "tools/lane_masks.py" | ||
| 100 | - "tools/lod_bias_probe.py" | ||
| 101 | - "tools/mc_command.py" | ||
| 102 | - "tools/mesh_compute_vs.py" | ||
| 103 | - "tools/native_pso_hashes.py" | ||
| 104 | - "tools/rdna2_decode.py" | ||
| 105 | - "tools/rdna2_isa_tables.py" | ||
| 106 | - "tools/rdna2spirv.py" | ||
| 107 | - "tools/replace_retry.py" | ||
| 108 | - "tools/report_paths.py" | ||
| 109 | - "tools/shader_carve.py" | ||
| 110 | - "tools/shader_carve_accel.py" | ||
| 111 | - "tools/shader_carve_native/**" | ||
| 112 | - "tools/shader_disasm.py" | ||
| 113 | - "tools/shader_ir.py" | ||
| 114 | - "tools/shader_meta.py" | ||
| 115 | - "tools/shader_stage_manifest.py" | ||
| 116 | - "tools/spirv_asm.py" | ||
| 117 | - "tools/spirv_asm_tables.py" | ||
| 118 | - "tools/spirv_loop_guard.py" | ||
| 119 | - "tools/spirv_opt.py" | ||
| 120 | - "tools/spirv_stubs.py" | ||
| 121 | - "tools/vk_lod_bias.py" | ||
| 122 | - "tools/vk_subgroup_info.py" | ||
| 123 | - "tools/wave64_emulate_opt.py" | ||
| 124 | - "tools/wave64_halves.py" | ||
| 125 | - "tools/xdxr_bvh.py" | ||
| 126 | workflow_dispatch: | 8 | workflow_dispatch: |
| 127 | # Daily default-branch snapshot, staggered after CI; ordinary pushes keep coalescing. | ||
| 128 | schedule: | ||
| 129 | - cron: "53 3 * * *" | ||
| 130 | 9 | ||
| 131 | permissions: | 10 | permissions: |
| 132 | contents: read | 11 | contents: read |
| 133 | 12 | ||
| 134 | concurrency: | 13 | concurrency: |
| 135 | # Coalesce superseded pending pushes per branch without canceling an active main build. | 14 | # Each manual dispatch gets its own group so runs do not cancel each other. |
| 136 | # Scheduled/manual runs already use run_id and cannot be replaced by queued pushes. | 15 | group: runtime-${{ github.event_name }}-${{ github.run_id }} |
| 137 | group: runtime-${{ github.event_name }}-${{ github.event.pull_request.number || (github.event_name == 'push' && github.ref) || github.run_id }} | 16 | cancel-in-progress: false |
| 138 | cancel-in-progress: ${{ github.event_name == 'pull_request' }} | ||
| 139 | 17 | ||
| 140 | jobs: | 18 | jobs: |
| 141 | windows: | 19 | windows: |
| @@ -358,23 +236,19 @@ jobs: | |||
| 358 | run: ctest --test-dir runtime/build --output-on-failure --timeout 300 | 236 | run: ctest --test-dir runtime/build --output-on-failure --timeout 300 |
| 359 | 237 | ||
| 360 | # Runs the Windows build's tests under Wine, so a change that breaks the loader on Linux (through Wine or Proton) | 238 | # Runs the Windows build's tests under Wine, so a change that breaks the loader on Linux (through Wine or Proton) |
| 361 | # shows up. The required ones are the loader and the stand-in game run end to end; the table in the job summary | 239 | # shows up when this workflow is dispatched manually. The required ones are the loader and the stand-in game run |
| 362 | # shows the rest. | 240 | # end to end; the table in the job summary shows the rest. |
| 363 | # Two Wines: Ubuntu's own (9.0) and WineHQ's current stable, which is closer to what Proton users run. | 241 | # Two Wines: Ubuntu's own (9.0) and WineHQ's current stable, which is closer to what Proton users run. |
| 364 | # Not on pull requests: in 188 sampled pull request runs these two jobs never failed when the Windows job had passed, | ||
| 365 | # yet they took about a quarter of the account's 20 concurrent runner slots. Pushes to main run winehq-stable only; | ||
| 366 | # the daily schedule and workflow_dispatch run both ubuntu and winehq-stable. Pull requests still build and test the | ||
| 367 | # Windows runtime natively and upload runtime-windows for testers. | ||
| 368 | wine: | 242 | wine: |
| 369 | needs: windows | 243 | needs: windows |
| 370 | # The uploaded build can still be tested under Wine if the later native tests fail. | 244 | # The uploaded build can still be tested under Wine if the later native tests fail. |
| 371 | if: ${{ github.event_name != 'pull_request' && !cancelled() && needs.windows.outputs.wine-artifact == 'success' }} | 245 | if: ${{ !cancelled() && needs.windows.outputs.wine-artifact == 'success' }} |
| 372 | runs-on: ubuntu-24.04 | 246 | runs-on: ubuntu-24.04 |
| 373 | timeout-minutes: 20 | 247 | timeout-minutes: 20 |
| 374 | strategy: | 248 | strategy: |
| 375 | fail-fast: false | 249 | fail-fast: false |
| 376 | matrix: | 250 | matrix: |
| 377 | wine: ${{ fromJSON(github.event_name == 'push' && '["winehq-stable"]' || '["ubuntu", "winehq-stable"]') }} | 251 | wine: [ubuntu, winehq-stable] |
| 378 | steps: | 252 | steps: |
| 379 | - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 | 253 | - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 |
| 380 | with: | 254 | with: |
diff --git a/.github/workflows/xma2-decoder.yml b/.github/workflows/xma2-decoder.yml index d7549a0f4..4f9d44480 100644 --- a/.github/workflows/xma2-decoder.yml +++ b/.github/workflows/xma2-decoder.yml | |||
| @@ -1,27 +1,19 @@ | |||
| 1 | # Builds and tests the legacy C++ runtime's Rust XMA2 FFI crate (runtime/xma_decoder/). | ||
| 2 | # The legacy C++ Vulkan runtime/ is deprecated in favor of the Rust DX12 runtime (d3d12/) and the new Rust Vulkan | ||
| 3 | # runtime (in progress), so automatic push and pull_request CI runs are disabled. Trigger manually via | ||
| 4 | # workflow_dispatch when needed. | ||
| 1 | name: XMA2 decoder | 5 | name: XMA2 decoder |
| 2 | 6 | ||
| 3 | on: | 7 | on: |
| 4 | push: | ||
| 5 | branches: [main] | ||
| 6 | paths: | ||
| 7 | - "runtime/xma_decoder/**" | ||
| 8 | - "third_party/xma/**" | ||
| 9 | - ".github/workflows/xma2-decoder.yml" | ||
| 10 | pull_request: | ||
| 11 | paths: | ||
| 12 | - "runtime/xma_decoder/**" | ||
| 13 | - "third_party/xma/**" | ||
| 14 | - ".github/workflows/xma2-decoder.yml" | ||
| 15 | workflow_dispatch: | 8 | workflow_dispatch: |
| 16 | 9 | ||
| 17 | permissions: | 10 | permissions: |
| 18 | contents: read | 11 | contents: read |
| 19 | 12 | ||
| 20 | concurrency: | 13 | concurrency: |
| 21 | # Pull requests coalesce and cancel superseded pending runs per number; a push gets its own group | 14 | # Each manual dispatch gets its own group so runs do not cancel each other. |
| 22 | # (run_id is unique per run), so a merge burst cannot replace queued main runs before they start. | 15 | group: xma2-decoder-${{ github.event_name }}-${{ github.run_id }} |
| 23 | group: xma2-decoder-${{ github.event_name }}-${{ github.event.pull_request.number || github.run_id }} | 16 | cancel-in-progress: false |
| 24 | cancel-in-progress: ${{ github.event_name == 'pull_request' }} | ||
| 25 | 17 | ||
| 26 | jobs: | 18 | jobs: |
| 27 | windows-ffi: | 19 | windows-ffi: |
diff --git a/docs/testing.md b/docs/testing.md index abfd277cd..a5686330c 100644 --- a/docs/testing.md +++ b/docs/testing.md | |||
| @@ -289,11 +289,11 @@ belongs to the commit that built it; check that commit out as well. | |||
| 289 | 289 | ||
| 290 | If you cannot build the test programs locally, the Runtime workflow publishes them as the `runtime-windows` | 290 | If you cannot build the test programs locally, the Runtime workflow publishes them as the `runtime-windows` |
| 291 | artifact of its own commit. It holds Windows executables, so use them on Windows or under Wine as in the | 291 | artifact of its own commit. It holds Windows executables, so use them on Windows or under Wine as in the |
| 292 | section below; GitHub expires the artifact after 7 days. Not every commit on `main` has one: the workflow runs | 292 | section below; GitHub expires the artifact after 7 days. Because the legacy C++ `runtime/` is deprecated in favor |
| 293 | only when a commit touches what it builds or reads (the `paths` list in `.github/workflows/runtime.yml`), so a | 293 | of `d3d12/` and the new Rust Vulkan runtime (in progress), `.github/workflows/runtime.yml` no longer runs |
| 294 | commit that changes only docs, tests or other tools has no Runtime run. Take the most recent run under | 294 | automatically on pushes or pull requests; start a run of the commit you want with "Run workflow" |
| 295 | Actions -> Runtime, and check out the commit it built, or start a run of the commit you want on your own fork with | 295 | (`workflow_dispatch`) or take an existing run under Actions -> Runtime and check out the commit it built. Download |
| 296 | "Run workflow" (`workflow_dispatch`). Download and unzip `runtime-windows`, and pass the unzipped folder to `--build`: | 296 | and unzip `runtime-windows`, and pass the unzipped folder to `--build`: |
| 297 | 297 | ||
| 298 | ```sh | 298 | ```sh |
| 299 | python -I scripts/run_gpu_tests.py --build <unzipped runtime-windows> | 299 | python -I scripts/run_gpu_tests.py --build <unzipped runtime-windows> |
| @@ -794,9 +794,9 @@ capabilities first: they enable `shaderInt64` only for one that declares `Int64` | |||
| 794 | 794 | ||
| 795 | ## Without a GPU: Mesa llvmpipe | 795 | ## Without a GPU: Mesa llvmpipe |
| 796 | 796 | ||
| 797 | Mesa's llvmpipe is a software Vulkan driver (`mesa-vulkan-drivers` on Debian and Ubuntu). CI runs the suite on it | 797 | Mesa's llvmpipe is a software Vulkan driver (`mesa-vulkan-drivers` on Debian and Ubuntu). `.github/workflows/runtime.yml` |
| 798 | for every pull request that touches the runtime, the scripts or a tool the jobs read (`.github/workflows/runtime.yml` | 798 | can run the legacy C++ `runtime/` suite on it via manual `workflow_dispatch` (automatic runs are disabled while the |
| 799 | lists them), and you can do the same on Linux without a GPU: | 799 | legacy C++ `runtime/` is deprecated), and you can do the same locally on Linux without a GPU: |
| 800 | 800 | ||
| 801 | ```sh | 801 | ```sh |
| 802 | sudo apt-get install -y libvulkan-dev mesa-vulkan-drivers vulkan-tools spirv-tools llvm-21 | 802 | sudo apt-get install -y libvulkan-dev mesa-vulkan-drivers vulkan-tools spirv-tools llvm-21 |
diff --git a/tests/test_ci_main_signal.py b/tests/test_ci_main_signal.py index 4cc2fd4a6..53759ebaa 100644 --- a/tests/test_ci_main_signal.py +++ b/tests/test_ci_main_signal.py | |||
| @@ -5,7 +5,8 @@ import unittest | |||
| 5 | 5 | ||
| 6 | 6 | ||
| 7 | ROOT = Path(__file__).resolve().parents[1] | 7 | ROOT = Path(__file__).resolve().parents[1] |
| 8 | WORKFLOWS = {"ci": "23 3 * * *", "runtime": "53 3 * * *"} | 8 | WORKFLOWS = {"ci": "23 3 * * *"} |
| 9 | DEPRECATED_RUNTIME_WORKFLOWS = ("runtime", "xma2-decoder") | ||
| 9 | SUFFIX = ( | 10 | SUFFIX = ( |
| 10 | "${{ github.event_name }}-${{ github.event.pull_request.number || " | 11 | "${{ github.event_name }}-${{ github.event.pull_request.number || " |
| 11 | "(github.event_name == 'push' && github.ref) || github.run_id }}" | 12 | "(github.event_name == 'push' && github.ref) || github.run_id }}" |
| @@ -23,14 +24,13 @@ def group(name, event, run_id, *, ref="refs/heads/main", pr=None): | |||
| 23 | 24 | ||
| 24 | 25 | ||
| 25 | class MainSignal(unittest.TestCase): | 26 | class MainSignal(unittest.TestCase): |
| 26 | def test_one_staggered_daily_schedule_per_workflow(self): | 27 | def test_one_daily_schedule_per_active_workflow(self): |
| 27 | for name, cron in WORKFLOWS.items(): | 28 | for name, cron in WORKFLOWS.items(): |
| 28 | with self.subTest(workflow=name): | 29 | with self.subTest(workflow=name): |
| 29 | text = workflow(name) | 30 | text = workflow(name) |
| 30 | self.assertEqual(re.findall(r'^ - cron: "([^"]+)"$', text, re.M), [cron]) | 31 | self.assertEqual(re.findall(r'^ - cron: "([^"]+)"$', text, re.M), [cron]) |
| 31 | self.assertIn(" schedule:\n", text) | 32 | self.assertIn(" schedule:\n", text) |
| 32 | self.assertEqual(cron.split()[2:], ["*", "*", "*"]) | 33 | self.assertEqual(cron.split()[2:], ["*", "*", "*"]) |
| 33 | self.assertNotEqual(WORKFLOWS["ci"], WORKFLOWS["runtime"]) | ||
| 34 | 34 | ||
| 35 | def test_push_pr_and_manual_triggers_remain(self): | 35 | def test_push_pr_and_manual_triggers_remain(self): |
| 36 | for name in WORKFLOWS: | 36 | for name in WORKFLOWS: |
| @@ -58,15 +58,24 @@ class MainSignal(unittest.TestCase): | |||
| 58 | self.assertNotEqual(group(name, "schedule", 1), group(name, "push", 1)) | 58 | self.assertNotEqual(group(name, "schedule", 1), group(name, "push", 1)) |
| 59 | self.assertNotEqual(group(name, "schedule", 1), group(name, "schedule", 2)) | 59 | self.assertNotEqual(group(name, "schedule", 1), group(name, "schedule", 2)) |
| 60 | self.assertNotEqual(group(name, "workflow_dispatch", 1), group(name, "schedule", 1)) | 60 | self.assertNotEqual(group(name, "workflow_dispatch", 1), group(name, "schedule", 1)) |
| 61 | self.assertNotEqual(group("ci", "schedule", 1), group("runtime", "schedule", 1)) | ||
| 62 | 61 | ||
| 63 | def test_jobs_are_not_restricted_to_push_events(self): | 62 | def test_jobs_are_not_restricted_to_push_events(self): |
| 64 | for name in WORKFLOWS: | 63 | for name in WORKFLOWS: |
| 65 | jobs = workflow(name).split("\njobs:\n", 1)[1] | 64 | jobs = workflow(name).split("\njobs:\n", 1)[1] |
| 66 | self.assertNotRegex(jobs, r"(?m)^\s+if:.*github\.event_name\s*==\s*'push'") | 65 | self.assertNotRegex(jobs, r"(?m)^\s+if:.*github\.event_name\s*==\s*'push'") |
| 67 | # The Wine artifact consumer remains available to schedules, but still needs a real artifact. | 66 | |
| 67 | def test_legacy_runtime_workflows_are_manual_dispatch_only(self): | ||
| 68 | # Legacy C++ runtime/ is deprecated in favor of d3d12/ and the new Rust Vulkan runtime, | ||
| 69 | # so its workflows are excluded from automatic push, pull_request, and scheduled CI runs. | ||
| 70 | for name in DEPRECATED_RUNTIME_WORKFLOWS: | ||
| 71 | with self.subTest(workflow=name): | ||
| 72 | text = workflow(name) | ||
| 73 | self.assertRegex(text, r"(?m)^ workflow_dispatch:\s*$") | ||
| 74 | for trigger in ("push", "pull_request", "schedule"): | ||
| 75 | self.assertNotRegex(text, rf"(?m)^ {trigger}:") | ||
| 76 | self.assertIn(" cancel-in-progress: false\n", text) | ||
| 77 | # When runtime.yml is dispatched manually, the Wine artifact consumer still needs a real artifact. | ||
| 68 | runtime = workflow("runtime") | 78 | runtime = workflow("runtime") |
| 69 | self.assertIn("github.event_name != 'pull_request'", runtime) | ||
| 70 | self.assertIn("needs.windows.outputs.wine-artifact == 'success'", runtime) | 79 | self.assertIn("needs.windows.outputs.wine-artifact == 'success'", runtime) |
| 71 | 80 | ||
| 72 | 81 | ||
diff --git a/tests/test_runtime_paths.py b/tests/test_runtime_paths.py index 6afc9228b..97431bd73 100644 --- a/tests/test_runtime_paths.py +++ b/tests/test_runtime_paths.py | |||
| @@ -1,13 +1,13 @@ | |||
| 1 | """The Runtime workflow's path filter still lists every file under tools/ that its jobs read. | 1 | """The Runtime workflow's path-filter scanner and manual-only trigger check. |
| 2 | 2 | ||
| 3 | python -I tests/test_runtime_paths.py | 3 | python -I tests/test_runtime_paths.py |
| 4 | 4 | ||
| 5 | ``.github/workflows/runtime.yml`` starts on the paths it lists, not on everything outside an ignore list | 5 | ``.github/workflows/runtime.yml`` builds the deprecated legacy C++ Vulkan ``runtime/`` (superseded by ``d3d12/`` |
| 6 | (BUILD-856): a change to a tool the runtime build never reads should not queue a Windows, Wine and llvmpipe run. | 6 | and the new Rust Vulkan runtime in progress), so it is now manual-only (``workflow_dispatch``) and excluded from |
| 7 | The price is that the list can fall behind. If ``tools/rdna2spirv.py`` starts importing a new ``tools/foo.py``, | 7 | automatic ``push``, ``pull_request``, and ``schedule`` CI runs. |
| 8 | that pull request still runs Runtime (it touches ``rdna2spirv.py``), but a later one that changes only | 8 | |
| 9 | ``foo.py`` would skip the GPU tests without anyone noticing. This test recomputes what the jobs read and fails | 9 | If automatic ``push`` / ``pull_request`` path filters are ever restored on ``runtime.yml``, ``problems()`` |
| 10 | when an entry is missing: | 10 | recomputes every file under ``tools/`` that its jobs read and fails when an entry is missing: |
| 11 | 11 | ||
| 12 | * the seeds are the code that runs during the jobs: the CMake files under ``runtime/`` and the workflow's | 12 | * the seeds are the code that runs during the jobs: the CMake files under ``runtime/`` and the workflow's |
| 13 | ``jobs:``, with ``#`` comments removed, and the Python under ``runtime/`` plus the scripts the workflow runs. | 13 | ``jobs:``, with ``#`` comments removed, and the Python under ``runtime/`` plus the scripts the workflow runs. |
| @@ -22,10 +22,6 @@ Comments, docstrings and the C++, shader and header sources are not read as depe | |||
| 22 | them says where a table or a test came from, not that the build runs it, and counting those would make every | 22 | them says where a table or a test came from, not that the build runs it, and counting those would make every |
| 23 | such note a required entry. | 23 | such note a required entry. |
| 24 | 24 | ||
| 25 | It also checks that the ``push`` and ``pull_request`` lists are the same, and that no ``tools/`` entry names a | ||
| 26 | file that no longer exists. Listing more than the jobs need is allowed on purpose: an extra run costs one | ||
| 27 | queue slot, a missing entry loses the build for a tool the workflow reads. | ||
| 28 | |||
| 29 | Only tracked sources and the workflow are read; no game files, no build tools, no PyYAML. | 25 | Only tracked sources and the workflow are read; no game files, no build tools, no PyYAML. |
| 30 | """ | 26 | """ |
| 31 | import ast | 27 | import ast |
| @@ -235,9 +231,16 @@ class RepositoryRuntimePathsTest(unittest.TestCase): | |||
| 235 | self.assertIn("tools/rdna2spirv.py", found) | 231 | self.assertIn("tools/rdna2spirv.py", found) |
| 236 | self.assertIn("tools/gen_d3d12_stubs.py", found) | 232 | self.assertIn("tools/gen_d3d12_stubs.py", found) |
| 237 | 233 | ||
| 238 | def test_every_tool_the_jobs_read_triggers_the_workflow(self): | 234 | def test_runtime_workflow_is_manual_dispatch_only(self): |
| 239 | issues = problems(ROOT) | 235 | # Legacy C++ runtime/ is deprecated and excluded from automatic CI runs; manual dispatch stays available. |
| 240 | self.assertFalse(issues, f"{WORKFLOW} path filter:\n" + "\n".join(f" {i}" for i in issues)) | 236 | text = read(ROOT, WORKFLOW) |
| 237 | self.assertRegex(text, r"(?m)^ workflow_dispatch:\s*$") | ||
| 238 | for trigger in ("push", "pull_request", "schedule"): | ||
| 239 | self.assertNotRegex( | ||
| 240 | text, | ||
| 241 | rf"(?m)^ {trigger}:", | ||
| 242 | f"{WORKFLOW} must not run automatically on `{trigger}:` while legacy runtime/ is deprecated", | ||
| 243 | ) | ||
| 241 | 244 | ||
| 242 | 245 | ||
| 243 | class SyntheticTreeTest(unittest.TestCase): | 246 | class SyntheticTreeTest(unittest.TestCase): |