Skip to content

ci: move the inline workflow scripts into scripts/ and correct the recorded gate budgets #2258

Done

Description

@eric8810

Context

.github/workflows/ci.yml is 554 lines across nine jobs. 208 of those lines (37%) are inline shell or PowerShell. This is a maintainability issue only: it does not cause the cancellations or failures (#2256 is a real test defect, and #1919 covers the platform split, which is already in place).

What is duplicated today

  • actions/checkout ten times, actions/setup-node seven, actions-rust-lang/setup-rust-toolchain four, and the same CARGO_INCREMENTAL / RUSTC_WRAPPER / CARGO_TARGET_DIR block five times.
  • Inline logic that cannot be run or reviewed on its own:
    • Windows bounded target directory, stamp and 12 GiB budget (ci.yml:120-147).
    • Portable CMake/NASM provisioning (ci.yml:155-189).
    • Linux physical-core derivation for DIM_TEST_JOBS / --test-threads (ci.yml:332-357).
    • Python standalone provisioning (ci.yml:434-460).
    • Web staging and generated-declaration check (ci.yml:209-231).
  • The platform matrix is chosen by string truthiness (ci.yml:275): fromJSON(event == 'pull_request' && '["linux"]' || event == 'push' && '["macos"]' || …).

What not to change

The three uses repetitions are not the problem. Keeping the action SHA pins and their inputs at the call site is easier to review than hiding them in a local composite action, and .github/actions/ cannot be used before checkout anyway.

Scope

  1. Move each inline block into scripts/ beside ci-changes.mjs, run-rust-test.mjs, test-windows-native.mjs and test-macos-native.mjs, so it runs locally and its failure messages live in code. ci.yml keeps the wiring, environment and conditions.
  2. Replace the matrix expression with something a reader does not have to evaluate as a boolean chain.
  3. Correct the stale budget records while touching the gates:
    • docs/architecture/build.md:352 says the windows-cli cold compile "may not fit" the fifteen-minute timeout and that no run has measured it. Measured: the whole job takes 2.2–6.8 min and the native-flows step 1.1–4.4 min across 25 sampled runs, all green.
    • The active-gate table still records verify (linux) steady state as "not yet measured at these settings" while the last six runs took 18–30 min.

Acceptance

  • Every check that runs in a job can be run locally by calling one script.
  • ci.yml contains no multi-step shell or PowerShell program.
  • The recorded budgets match measured runs, with the run ids beside them.

Activity

  1. added
    enhancement
    on Nov 27, 2026
  2. eric8810 commented on Nov 27, 2026

    @eric8810
    CollaboratorAuthor

    Provenance of the inline blocks

    No single author; they accumulated over three weeks.

    Block Commit Author Date
    Windows bounded target directory, stamp, 12 GiB 7420e873c eric8810 2026-11-20
    Portable CMake/NASM provisioning 9bbbe31b1 huihui 2026-11-23
    Web staging and generated-declaration check 1e3058ebc zerob13 2026-11-16
    Linux physical-core derivation 1a81f00e5 (after 7420e873c) scotares 2026-11-21
    Python standalone provisioning a72d9b6f8, dc9040fc9, ffd3e1162 eric8810, zerob13, duskzhen 2026-10-24 → 11-20
    Platform matrix expression ffd3e1162 duskzhen 2026-11-20
    Stale windows-cli cold-compile note 41f4ffac09 (build.md:352) huihui 2026-11-25
    Stale verify (linux) budget row c3d519f4a9 (build.md:337) eric8810 2026-11-21

    Order of work: the blocks that can be wrong silently first (core derivation, Python provisioning, web staging check), then the Windows cache and portable tools, then the matrix expression, then the documentation corrections.

  3. eric8810 commented on Nov 27, 2026

    @eric8810
    CollaboratorAuthor

    Landed in #2262: the Windows target directory, the portable CMake/NASM provisioning, the Web staging check and the workspace test concurrency are scripts under scripts/ now, the job matrix takes its platforms from ci-changes.mjs, and the two stale budget records are corrected.

    Still open on this issue: the Python standalone provisioning block, gated by DIM_CI_PYTHON_PLUGINS, which needs a run against the network on Linux and macOS before its extraction counts as verified.

  4. added
    P2
    on Nov 27, 2026
  5. eric8810 commented on Nov 27, 2026

    @eric8810
    CollaboratorAuthor

    Closing with the one item that did not move: the Python standalone provisioning block.

    It is gated on vars.DIM_CI_PYTHON_PLUGINS, and that repository variable is not set (gh variable list holds only NPM_ALPHA_PUBLISH_ENABLED), so the step has never run in CI. Extracting it now would be an unverifiable move of code nothing exercises; the right time is when the variable is turned on.

    Everything else landed in #2262: the Windows target directory, the portable CMake/NASM provisioning, the Web staging check and the workspace test concurrency are scripts under scripts/, the job matrix takes its platforms from ci-changes.mjs, and the recorded budgets match measured runs.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    P2enhancement

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions