Skip to content

Commit

Permalink
Fix install/build script for Travis CI
Browse files Browse the repository at this point in the history
  • Loading branch information
tkf committed May 17, 2019
1 parent bf70fc6 commit 71efc85
Show file tree
Hide file tree
Showing 3 changed files with 42 additions and 7 deletions.
5 changes: 4 additions & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,9 @@ git:
#before_script: # homebrew for mac
# - if [ $TRAVIS_OS_NAME = osx ]; then brew install gcc; fi

install:
- ci/install.jl

script:
# Ignore "Warning: `using A: B`" from julia 0.7:
- if [ "$TRAVIS_JULIA_VERSION" = "0.7" ];
Expand All @@ -36,7 +39,7 @@ script:
depwarn=error;
fi
- echo "$depwarn"
- julia --color=yes --depwarn="$depwarn" ci/test.jl
- ci/test.jl --depwarn="$depwarn"

after_success:
# push coverage results to Coveralls
Expand Down
29 changes: 29 additions & 0 deletions ci/install.jl
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
#!/bin/bash
# -*- mode: julia -*-
#=
JULIA="${JULIA:-julia --color=yes --startup-file=no}"
exec ${JULIA} "$@" "${BASH_SOURCE[0]}"
=#

JL_PKG = "InteractiveCodeSearch"
VERSION >= v"0.7.0-DEV.5183" && using Pkg

if isfile("Project.toml") || isfile("JuliaProject.toml")
if VERSION < v"0.7.0-DEV.5183"
Pkg.clone(pwd())
Pkg.build(JL_PKG)
elseif VERSION >= v"1.1.0-rc1"
Pkg.build(verbose=true)
else
Pkg.build()
end
else
Pkg.clone(pwd())
if VERSION >= v"1.1.0-rc1"
Pkg.build(JL_PKG; verbose=true)
else
Pkg.build(JL_PKG)
end
end

# https://github.com/travis-ci/travis-build/blob/master/lib/travis/build/script/julia.rb
15 changes: 9 additions & 6 deletions ci/test.jl
100644 → 100755
Original file line number Diff line number Diff line change
@@ -1,7 +1,10 @@
@static if VERSION >= v"0.7.0-DEV"
using Pkg
end
#!/bin/bash
# -*- mode: julia -*-
#=
JULIA="${JULIA:-julia --color=yes --startup-file=no}"
exec ${JULIA} "$@" "${BASH_SOURCE[0]}"
=#

Pkg.clone(pwd())
Pkg.build("InteractiveCodeSearch")
Pkg.test("InteractiveCodeSearch"; coverage=true)
JL_PKG = "InteractiveCodeSearch"
VERSION >= v"0.7.0-DEV.5183" && using Pkg
Pkg.test(JL_PKG; coverage=true)

0 comments on commit 71efc85

Please sign in to comment.