Skip to content

Commit e6a8ba5

Browse files
authored
backport: use the custom sysimage when running documentation (and doctests) as well (#1227)
(cherry picked from commit f781708)
1 parent e7da19f commit e6a8ba5

File tree

5 files changed

+30
-17
lines changed

5 files changed

+30
-17
lines changed

.ci/create_sysimage.jl

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
using PackageCompiler, Libdl
2+
3+
function create_sysimage_linear_algebra()
4+
sysimage = tempname() * "." * Libdl.dlext
5+
6+
if haskey(ENV, "BUILDKITE")
7+
ncores = Sys.CPU_THREADS
8+
else
9+
ncores = ceil(Int, Sys.CPU_THREADS / 2)
10+
end
11+
12+
withenv("JULIA_IMAGE_THREADS" => ncores) do
13+
create_sysimage(["LinearAlgebra", "Test", "Distributed", "Dates", "Printf", "Random"]; sysimage_path=sysimage, incremental=false, filter_stdlibs=true)
14+
end
15+
return sysimage, ncores
16+
end

.ci/create_sysimage_and_run_docs.jl

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
include("create_sysimage.jl")
2+
sysimage, ncores = create_sysimage_linear_algebra()
3+
doc_file = joinpath(@__DIR__, "..", "docs", "make.jl")
4+
withenv("JULIA_NUM_THREADS" => 1) do
5+
run(`$(Base.julia_cmd()) --sysimage=$sysimage --project=$(dirname(doc_file)) $doc_file`)
6+
end

.ci/create_sysimage_and_run_tests.jl

Lines changed: 2 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,5 @@
1-
using PackageCompiler, Libdl
2-
3-
sysimage = tempname() * "." * Libdl.dlext
4-
5-
if haskey(ENV, "BUILDKITE")
6-
ncores = Sys.CPU_THREADS
7-
else
8-
ncores = ceil(Int, Sys.CPU_THREADS / 2)
9-
end
10-
11-
withenv("JULIA_IMAGE_THREADS" => ncores) do
12-
create_sysimage(["LinearAlgebra", "Test", "Distributed", "Dates", "Printf", "Random"]; sysimage_path=sysimage, incremental=false, filter_stdlibs=true)
13-
end
14-
1+
include("create_sysimage.jl")
2+
sysimage, ncores = create_sysimage_linear_algebra()
153
current_dir = @__DIR__
164
cmd = """Base.runtests(["LinearAlgebra"]; propagate_project=true, ncores=$ncores)"""
175
withenv("JULIA_NUM_THREADS" => 1) do

.github/workflows/ci.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,9 +21,9 @@ jobs:
2121
version: 'nightly'
2222
- name: Generate docs
2323
run: |
24-
julia --project --color=yes -e ''
25-
julia --project --color=yes -e 'using Pkg; Pkg.respect_sysimage_versions(false); Pkg.activate("docs"); Pkg.develop(PackageSpec(path = pwd()))'
26-
julia --project=docs --color=yes docs/make.jl
24+
julia --color=yes --project=.ci -e 'using Pkg; Pkg.instantiate()'
25+
julia --color=yes --project=docs -e 'using Pkg; Pkg.instantiate()'
26+
julia --color=yes --project=.ci .ci/create_sysimage_and_run_docs.jl
2727
env:
2828
DOCUMENTER_KEY: ${{ secrets.DOCUMENTER_KEY }}
2929
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

docs/Project.toml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
11
[deps]
22
Documenter = "e30172f5-a6a5-5a46-863b-614d45cd2de4"
33
LinearAlgebra = "37e2e46d-f89d-539d-b4ee-838fcccc9c8e"
4+
5+
[sources]
6+
LinearAlgebra = {path = ".."}

0 commit comments

Comments
 (0)