Clone and checkout my fork, on travis-CI?

I updated a registered package I need to work with v0.7, and made a pull request. On my fork this is branch julia07fixes.

Can I get Travis-CI to download this version when testing another package of mine? (Which is 0.7 only.)

I tried, very naively, editing .travis.yml like this:

## uncomment the following lines to override the default test script
script:
  - julia -e 'Pkg.clone("https:// github .. me ... ThePackage.jl"); Pkg.checkout("ThePackage", "julia07fixes")' 
  - julia -e 'Pkg.clone(pwd()); Pkg.build("MyPackage7"); Pkg.test("MyPackage7"; coverage=true)'

but this fails. And I now see that Pkg.checkout doesn’t seem to exist on 0.7 at all. What should I try?

Can you just put your fork to the Require file?

But how exactly? Clearly if I just put the package name in REQUIRE then I get the registered version. I’d like to put something like https://github/.../ThePackage.jl#julia07fixes that doesn’t work. Explicitly calling Pkg from inside runtests.jl also doesn’t work, because Pkg.checkout seems not to exist.

Sorry I was wrong you cannot do it. Here is a workaround: How to add unregistered packages to REQUIRE?

Ah I hadn’t thought of that. But how do I call pkg> add https://github/.../ThePackage.jl#julia07fixes without the ]-mode?

OK many thanks, that sounds like the right thing. I made deps/build.jl look like this:

Pkg.rm("ThePackage") ## because it's also in REQUIRE
@info "removed old ThePackage"
Pkg.add(Pkg.PackageSpec(name="ThePackage", url="https://github.com/.../ThePackage.jl", rev="julia07fixes"))
@info "added new ThePackage"

This appears to run (although I only see first @info when I have a typo in Pkg.add – otherwise it’s silent.) But the remainder of the test still seems to see the old package not the new one – I get its warnings, and tests that need it fail.

2 Likes