Skip to content

Commit 1493b14

Browse files
committed
Fix CI for nightly
1 parent 6390cdb commit 1493b14

File tree

1 file changed

+18
-5
lines changed

1 file changed

+18
-5
lines changed

test/Nesting.jl

Lines changed: 18 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,31 @@
11
using Test, Sandbox, Scratch, Pkg, Base.BinaryPlatforms
22

3-
function get_nestable_julia(target_arch = arch(HostPlatform()), version=v"1.8.1")
4-
julia_dir = @get_scratch!("julia-$(target_arch)-$(version)")
5-
if !isfile(joinpath(julia_dir, "julia-$(version)", "bin", "julia"))
3+
curr_version() = VersionNumber(VERSION.major, VERSION.minor, VERSION.patch)
4+
function get_nestable_julia(target_arch = arch(HostPlatform()), version=VERSION)
5+
function get_julia_url()
66
arch_folder = target_arch
77
if target_arch == "x86_64"
88
arch_folder = "x64"
99
elseif target_arch == "i686"
1010
arch_folder = "x86"
1111
end
12-
url = "https://julialang-s3.julialang.org/bin/linux/$(arch_folder)/$(version.major).$(version.minor)/julia-$(version)-linux-$(target_arch).tar.gz"
12+
13+
if !isempty(version.prerelease)
14+
# Get the latest version in this major.minor series:
15+
return "https://julialangnightlies-s3.julialang.org/bin/linux/$(target_arch)/$(version.major).$(version.minor)/julia-latest-linux-$(target_arch).tar.gz"
16+
else
17+
return "https://julialang-s3.julialang.org/bin/linux/$(arch_folder)/$(version.major).$(version.minor)/julia-$(version)-linux-$(target_arch).tar.gz"
18+
end
19+
end
20+
21+
sanitized_version = VersionNumber(version.major, version.minor, version.patch)
22+
julia_dir = @get_scratch!("julia-$(target_arch)-$(sanitized_version)")
23+
if !isfile(joinpath(julia_dir, "julia-$(sanitized_version)", "bin", "julia"))
24+
url = get_julia_url()
25+
rm(julia_dir; force=true, recursive=true)
1326
Pkg.PlatformEngines.download_verify_unpack(url, nothing, julia_dir; ignore_existence=true, verbose=true)
1427
end
15-
return joinpath(julia_dir, "julia-$(version)")
28+
return joinpath(julia_dir, only(readdir(julia_dir)))
1629
end
1730

1831
@testset "Nesting Sandbox.jl" begin

0 commit comments

Comments
 (0)