How to submit code coverage results to codecov/coveralls via GitLab CI?

Alright! I got it figured out. Turns out even though Coverage.jl doesn’t have support for GitLab, you can still publish results to codecov.io by adding this:

after_script:
  - julia -e 'using Pkg; Pkg.add("Coverage"); using Coverage; Codecov.submit_local(process_folder())

to the .gitlab-ci.yml file, and making sure you’ve added an environment variable to your gitlab project under settings :arrow_forward: CI/CD :arrow_forward: variables with key “CODECOV_TOKEN” and value set to the repository upload token provided by codecov. Make sure you don’t put quotes around the value either!

@Tamas_Papp If you want I can fork your GitLab example repo and put in a merge request with the necessary additions (but you’ll need to add the codecov token).

5 Likes