Skip to content

feat: add auto-precompile input to the reusable test workflows - #125

Merged
ChrisRackauckas merged 1 commit into
SciML:masterfrom
ChrisRackauckas-Claude:agent/reusable-tests-auto-precompile
Aug 10, 2026
Merged

feat: add auto-precompile input to the reusable test workflows#125
ChrisRackauckas merged 1 commit into
SciML:masterfrom
ChrisRackauckas-Claude:agent/reusable-tests-auto-precompile

Conversation

@ChrisRackauckas-Claude

Copy link
Copy Markdown
Member

Note

Draft — please ignore until reviewed by @ChrisRackauckas.

Problem

A job that calls a reusable workflow with uses: may not carry an env: map. GitHub's schema allows only name, uses, with, secrets, needs, if, and permissions there. Adding env: doesn't just get ignored — it makes the whole workflow file invalid, so GitHub creates zero jobs for it and reports a bare startup failure.

That is exactly what happened in SciML/ModelingToolkit.jl#4867, which tried to set JULIA_PKG_PRECOMPILE_AUTO: "0" at the call sites of grouped-tests.yml and sublibrary-project-tests.yml:

$ actionlint .github/workflows/Tests.yml .github/workflows/SublibraryCI.yml
.github/workflows/Tests.yml:30:5: when a reusable workflow is called with "uses", "env" is not available.
  only following keys are allowed: "name", "uses", "with", "secrets", "needs", "if", and "permissions" in job "tests" [syntax-check]
.github/workflows/SublibraryCI.yml:27:5: ... in job "sublibrary-ci" [syntax-check]

The result on that PR: no Tests and no Sublibrary CI checks at all, just two runs listed by file path with no jobs ("This run likely failed because of a workflow file issue"). There is currently no supported way for a consumer to control this env var.

Change

Expose it as an input instead.

  • tests.yml — new boolean input auto-precompile (default true), applied as a job-level env: so it covers julia-buildpkg's instantiate/build as well as the julia-runtest step:
    env:
      JULIA_PKG_PRECOMPILE_AUTO: "${{ inputs.auto-precompile && '1' || '0' }}"
  • grouped-tests.yml — same input, forwarded to the root-matrix test job.
  • sublibrary-project-tests.yml — same input, forwarded from all four shard jobs.

Default true is Pkg's normal behavior, so this is a no-op for every existing consumer. Setting auto-precompile: false defers compilation to load time in the test process, which is the escape hatch for dependency trees that OOM the 4vCPU/8GB runners during Pkg's eager parallel precompilation.

Testing

$ actionlint .github/workflows/*.yml
(exit 0)

$ julia --project=. test/runtests.jl
...
Test Summary:                                                 | Pass  Total  Time
auto-precompile input is plumbed to JULIA_PKG_PRECOMPILE_AUTO |    9      9  0.0s

Full suite passes. The new testset asserts the input exists on all three workflows, that tests.yml sets the env var above steps: (job-level, not step-level), and that all four shards forward it. Verified non-vacuous by deleting one shard's forward:

Expression: count("auto-precompile: \${{ inputs.auto-precompile }}", subs) == 4
 Evaluated: 3 == 4

Runic-clean on test/runtests.jl.

Follow-up

v1 only moves when a vX.Y.Z release tag is pushed (major-version-tag.yml), so consumers on @v1 won't see this input until a release is cut. The ModelingToolkit side is being fixed in two steps: drop the invalid env: blocks now to unblock CI, then pass auto-precompile: false once v1 carries this.

Alternative considered

A generic env-vars multiline input piped into $GITHUB_ENV would cover future vars without another PR here, but it's a broader surface for a narrow need. Happy to switch if you'd prefer that shape.

🤖 Generated with Claude Code

https://claude.ai/code/session_0172My4BE5TgvJmuYxkBuvxU

A job that calls a reusable workflow with `uses:` may not carry an `env:`
map, so a consumer cannot set JULIA_PKG_PRECOMPILE_AUTO at its call site --
adding one there makes the workflow file invalid and GitHub refuses to
create any jobs for it at all. Expose it as an input instead: tests.yml
sets it job-level (covering buildpkg's instantiate/build as well as the
test run), and grouped-tests.yml / sublibrary-project-tests.yml forward it
so both the root matrix and every sublibrary shard can opt out of Pkg's
eager parallel precompilation.

Co-Authored-By: Chris Rackauckas <accounts@chrisrackauckas.com>
@ChrisRackauckas
ChrisRackauckas marked this pull request as ready for review August 10, 2026 02:17
@ChrisRackauckas
ChrisRackauckas merged commit f1d4a7b into SciML:master Aug 10, 2026
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants