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

@Tamas_Papp I changed so much in my forked repo (and so lots would be changed if I merged it) that I think it might make the most sense for you to just update the yml file in your repo manually. Here’s the code:

image: julia:1.1                # image comes from Docker hub

before_script:
  # workaround for https://github.com/JuliaDocs/Documenter.jl/issues/686
  - apt-get -qq update; apt-get -y install git
  - julia --project=@. -e "import Pkg; Pkg.build()"

default:
  script:
    - julia --project=@. -e "import Pkg; Pkg.test(; coverage = true)"
    - julia --project=test/coverage -e 'import Pkg; Pkg.instantiate()'
    - julia --project=test/coverage test/coverage/coverage-summary.jl

pages:
  stage: deploy
  script:
    - julia --project=docs -e 'using Pkg; Pkg.instantiate(); Pkg.develop(PackageSpec(path=pwd()))'
    - julia --project=docs --color=yes docs/make.jl
    - mv docs/build public # move to the directory picked up by Gitlab pages
  artifacts:
    paths:
      - public
  only:
  - master

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

As you can see I only had to add the one line. You can find the badge URL in codecov under settings for the project.

2 Likes