File tree Expand file tree Collapse file tree 1 file changed +7
-3
lines changed Expand file tree Collapse file tree 1 file changed +7
-3
lines changed Original file line number Diff line number Diff line change @@ -7,12 +7,15 @@ using Pkg
7
7
GPUArrays. test (JLArray)
8
8
end
9
9
10
- function test_package (package)
10
+ function test_package (package, branch = nothing )
11
11
mktempdir () do devdir
12
12
withenv (" JULIA_PKG_DEVDIR" => devdir) do
13
13
# try to install from the same branch of GPUArrays
14
14
try
15
- branch = chomp (read (` git -C $(@__DIR__ ) rev-parse --abbrev-ref HEAD` , String))
15
+ if branch === nothing
16
+ branch = chomp (read (` git -C $(@__DIR__ ) rev-parse --abbrev-ref HEAD` , String))
17
+ branch == " HEAD" && error (" in detached HEAD state" )
18
+ end
16
19
Pkg. add (PackageSpec (name= package, rev= String (branch)))
17
20
@info " Installed $package from $branch branch"
18
21
catch ex
@@ -26,7 +29,8 @@ function test_package(package)
26
29
end
27
30
28
31
if haskey (ENV , " GITLAB_CI" )
32
+ branch = ENV [" CI_COMMIT_REF_NAME" ]
29
33
@testset " CuArray" begin
30
- test_package (" CuArrays" )
34
+ test_package (" CuArrays" , branch )
31
35
end
32
36
end
You can’t perform that action at this time.
0 commit comments