I noticed that testing of my package on Travis is broken with Julia 1.0/nightly (using the travis.yml that was recommended in the past):
$ julia -e ‘Pkg.clone(pwd()); Pkg.build(“FortranFiles”); Pkg.test(“FortranFiles”; coverage=true)’
ERROR: UndefVarError: Pkg not defined
Of course this is easy to fix, just need to add using Pkg. But then the Travis script will not work on Julia 0.6. I’m not very familiar with Travis, so what’s the best way to run different test scripts for different Julia versions?
I can’t help much but it seems to be something else than just a missing using Pkg
because I just get the expected warnings:
Julia for Travis-CI is not officially supported, but is community maintained.
Please file any issues using the following link Sign in to GitHub · GitHub
and mention @travis-ci/julia-maintainersin the issue
Julia-install
Installing Julia
0.01s$ CURL_USER_AGENT=“Travis-CI (curl --version | head -n 1)"
0.01s mkdir -p ~/julia
6.59s$ curl -A “CURL_USER_AGENT" -s -L --retry 7 'https://julialangnightlies-s3.julialang.org/bin/linux/x64/julia-latest-linux64.tar.gz' | tar -C ~/julia -x -z --strip-components=1 -f -
0.00s export PATH=”{PATH}:{HOME}/julia/bin”
$ julia -e ‘versioninfo()’
WARNING: Base.versioninfo is deprecated: it has been moved to the standard library package InteractiveUtils.
Add using InteractiveUtils to your imports.
in module Main
Julia Version 1.0.0-DEV.14
Commit 1dfc4d1fb0 (2018-08-04 07:20 UTC)
Platform Info:
OS: Linux (x86_64-pc-linux-gnu)
…
The command “if [[ -a .git/shallow ]]; then git fetch --unshallow; fi” exited with 0.
27.30s$ julia -e ‘Pkg.clone(pwd()); Pkg.build(“NormalizeQuantiles”); Pkg.test(“NormalizeQuantiles”; coverage=true)’;
WARNING: Base.Pkg is deprecated, run using Pkg instead
in module Main
Warning: Pkg.clone is only kept for legacy CI script reasons, please use add
…
script:
- if [[ -a .git/shallow ]]; then git fetch --unshallow; fi
- julia -e 'if VERSION >= v"0.7.0-" using Pkg; end; Pkg.clone(pwd()); Pkg.build("NormalizeQuantiles"); Pkg.test("NormalizeQuantiles"; coverage=true)';
Thanks, this seems to be working. I was thinking there may be a way to have Travis run different scripts for different Julia versions, but having the switch inside the Julia script will do for now.