Skip to content

Commit b7e4d9a

Browse files
committed
Simplify package matching.
1 parent fd591b7 commit b7e4d9a

File tree

1 file changed

+5
-15
lines changed

1 file changed

+5
-15
lines changed

test/runtests.jl

Lines changed: 5 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,9 @@
1-
# GPUArrays development often happens in lockstep with other packages, so try to match branches
1+
# development often happens in lockstep with other packages,
2+
# so check-out the master branch of those packages.
23
using Pkg
3-
function match_package(package, var)
4-
try
5-
branch = ENV[var]
6-
Pkg.add(PackageSpec(name=package, rev=branch))
7-
@info "Installed $package from branch $branch"
8-
catch ex
9-
@warn "Could not install $package from $branch branch, trying master" exception=ex
10-
Pkg.add(PackageSpec(name=package, rev="master"))
11-
@info "Installed $package from master"
12-
end
4+
if haskey(ENV, "TRAVIS") || haskey(ENV, "APPVEYOR") || haskey(ENV, "GITLAB_CI")
5+
Pkg.add(PackageSpec(name="Adapt", rev="master"))
136
end
14-
haskey(ENV, "TRAVIS") && match_package("Adapt", "TRAVIS_PULL_REQUEST_BRANCH")
15-
haskey(ENV, "APPVEYOR") && match_package("Adapt", "APPVEYOR_PULL_REQUEST_HEAD_REPO_BRANCH")
16-
haskey(ENV, "GITLAB_CI") && match_package("Adapt", "CI_COMMIT_REF_NAME")
177

188
using GPUArrays, Test
199

@@ -22,7 +12,7 @@ using GPUArrays, Test
2212
end
2313

2414
if haskey(ENV, "GITLAB_CI")
25-
match_package("CuArrays", "CI_COMMIT_REF_NAME")
15+
Pkg.add(PackageSpec(name="CuArrays", rev="master"))
2616
@testset "CuArray" begin
2717
Pkg.test("CuArrays")
2818
end

0 commit comments

Comments
 (0)