Coverage generation on Travis

I have some PkgDev generated lines in my .travis.yml files to submit coverage info,

after_success:
  # push coverage results to Coveralls
  - julia -e 'cd(Pkg.dir("MyPkg")); Pkg.add("Coverage"); using Coverage; Coveralls.submit(Coveralls.process_folder())'
  # push coverage results to Codecov
  - julia -e 'cd(Pkg.dir("MyPkg")); Pkg.add("Coverage"); using Coverage; Codecov.submit(Codecov.process_folder())'

and I wonder what the best way is to update for Pkg(3) (just to clarify: the above works, just gives warnings).

In 0.7 and above, you don’t need the cd(Pkg.dir(...)), but you do need import Pkg. So something like:

'if VERSION < v"0.7-"; cd(Pkg.dir("MyPkg")); else; import Pkg; end; Pkg.add("Coverage"); using Coverage; Coveralls.submit(process_folder())'

seems to work on all versions.

2 Likes

This is the :cool: version: Literate.jl/.travis.yml at ef3b6bf305af829e7844b07e6288c44bd34e1e62 · fredrikekre/Literate.jl · GitHub

2 Likes