Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions .github/workflows/grouped-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,11 @@ on:
default: false
required: false
type: boolean
auto-precompile:
description: "Value of JULIA_PKG_PRECOMPILE_AUTO for each test job (true -> 1, false -> 0). Set false for packages whose dependency tree OOMs the runner during Pkg's eager parallel precompilation."
default: true
required: false
type: boolean

jobs:
detect:
Expand Down Expand Up @@ -123,4 +128,5 @@ jobs:
apt-packages: "${{ inputs.apt-packages }}"
container: "${{ inputs.container }}"
cache: ${{ inputs.cache }}
auto-precompile: ${{ inputs.auto-precompile }}
secrets: "inherit"
9 changes: 9 additions & 0 deletions .github/workflows/sublibrary-project-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,11 @@ on:
default: false
required: false
type: boolean
auto-precompile:
description: "Value of JULIA_PKG_PRECOMPILE_AUTO for each sublibrary test job (true -> 1, false -> 0). Set false for sublibraries whose dependency tree OOMs the runner during Pkg's eager parallel precompilation."
default: true
required: false
type: boolean

jobs:
detect:
Expand Down Expand Up @@ -163,6 +168,7 @@ jobs:
coverage: ${{ inputs.coverage }}
coverage-directories: "${{ matrix.project }}/src,${{ matrix.project }}/ext"
cache: ${{ inputs.cache }}
auto-precompile: ${{ inputs.auto-precompile }}
secrets: "inherit"

test-2:
Expand All @@ -187,6 +193,7 @@ jobs:
coverage: ${{ inputs.coverage }}
coverage-directories: "${{ matrix.project }}/src,${{ matrix.project }}/ext"
cache: ${{ inputs.cache }}
auto-precompile: ${{ inputs.auto-precompile }}
secrets: "inherit"

test-3:
Expand All @@ -211,6 +218,7 @@ jobs:
coverage: ${{ inputs.coverage }}
coverage-directories: "${{ matrix.project }}/src,${{ matrix.project }}/ext"
cache: ${{ inputs.cache }}
auto-precompile: ${{ inputs.auto-precompile }}
secrets: "inherit"

test-4:
Expand All @@ -235,4 +243,5 @@ jobs:
coverage: ${{ inputs.coverage }}
coverage-directories: "${{ matrix.project }}/src,${{ matrix.project }}/ext"
cache: ${{ inputs.cache }}
auto-precompile: ${{ inputs.auto-precompile }}
secrets: "inherit"
10 changes: 10 additions & 0 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -106,6 +106,11 @@ on:
default: false
required: false
type: boolean
auto-precompile:
description: "Value of JULIA_PKG_PRECOMPILE_AUTO for the whole job (true -> 1, false -> 0). Set false for packages whose dependency tree OOMs the runner during Pkg's eager parallel precompilation."
default: true
required: false
type: boolean
dotgithub-ref:
description: "Ref of SciML/.github to source the develop-sources helper script from"
default: "v1"
Expand All @@ -126,6 +131,11 @@ jobs:
runs-on: ${{ (inputs.apt-packages != '' || inputs.container != '') && fromJSON('["ubuntu-24.04"]') || (inputs.runner != '' && fromJson(inputs.runner) || (inputs.self-hosted && 'self-hosted' || inputs.os)) }}
container: ${{ inputs.container }}
timeout-minutes: ${{ inputs.timeout-minutes }}
env:
# Job-level so it covers buildpkg (instantiate/build) as well as the test
# run. A caller cannot set this at its own call site: a job that uses a
# reusable workflow may not carry an `env:` map, so it has to be an input.
JULIA_PKG_PRECOMPILE_AUTO: "${{ inputs.auto-precompile && '1' || '0' }}"
steps:
- uses: actions/checkout@v7

Expand Down
27 changes: 27 additions & 0 deletions test/runtests.jl
Original file line number Diff line number Diff line change
Expand Up @@ -600,3 +600,30 @@ end
root = make_sources_fixture()
@test isempty(collect_source_paths(joinpath(root, "Leaf")))
end

@testset "auto-precompile input is plumbed to JULIA_PKG_PRECOMPILE_AUTO" begin
wf(p) = read(joinpath(@__DIR__, "..", ".github", "workflows", p), String)

tests = wf("tests.yml")
# Declared as a boolean input, defaulting to Pkg's normal eager behavior.
@test occursin("auto-precompile:", tests)
# Job-level (not step-level) so buildpkg's instantiate/build is covered too.
precompile_at = findfirst("JULIA_PKG_PRECOMPILE_AUTO", tests)
steps_at = findfirst("\n steps:", tests)
@test precompile_at !== nothing && steps_at !== nothing
@test first(precompile_at) < first(steps_at)
@test occursin("JULIA_PKG_PRECOMPILE_AUTO: \"\${{ inputs.auto-precompile && '1' || '0' }}\"", tests)

# Both fan-out workflows expose the input and forward it, or a caller has no
# way to set it: a job that `uses:` a reusable workflow may not carry `env:`.
for p in ("grouped-tests.yml", "sublibrary-project-tests.yml")
txt = wf(p)
@test occursin("auto-precompile:", txt)
@test occursin("auto-precompile: \${{ inputs.auto-precompile }}", txt)
end

# sublibrary-project-tests fans out over four shards; every one must forward
# it, otherwise the setting silently applies to only part of the matrix.
subs = wf("sublibrary-project-tests.yml")
@test count("auto-precompile: \${{ inputs.auto-precompile }}", subs) == 4
end
Loading