Extract from https://github.com/IainNZ/Coverage.jl
Using Coverage.jl with Codecov.io?
- Enable Codecov.io for your repository. If it is public on GitHub and you are using using TravisCI, this is all you need to do. You can sign into Codecov using your Github identity. You will be served a
REPO_TOKEN. You'll need this if you're not using a CI solution.
- You must be using
Julia 0.3or higher, which added the
--code-coveragecommand line argument.
- Use the command line option when you run your tests
- Either with something like
julia --code-coverage test/runtests.jl, or
- with something like
julia -e 'Pkg.test("MyPkg", coverage=true)'
- Add the following to the end of your
.travis.ymlfile. This line downloads this package, collects the per-file coverage data, then bundles it up and submits to Codecov. Coverage.jl assumes that the working directory is the package directory, so it changes to that first (so don't forget to replace
MyPkgwith your package's name!
after_success: - julia -e 'cd(Pkg.dir("MyPkg")); Pkg.add("Coverage"); using Coverage; Codecov.submit(Codecov.process_folder())'
If you're running coverage at home and want to upload results to Codecov, make a bash script like the following:
#!/bin/bash REPO_TOKEN=$YOUR_TOKEN_HERE julia -e 'cd(Pkg.dir("MyPkg")); using Coverage; Codecov.submit_token(Codecov.process_folder())'
We are happy to help if you have any questions. Please contact email our Support at email@example.com