# GitHub actions CI using CodeCov code coverage

**URL:** <https://discourse.julialang.org/t/github-actions-ci-using-codecov-code-coverage/50487>\
**Category:** General Usage\
**Tags:** question, codecov, ci, github-actions\
**Created:** [November 20, 2020, 11:05am UTC](https://discourse.julialang.org/t/github-actions-ci-using-codecov-code-coverage/50487 "2020-11-20T11:05:38Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![jhbdiehl](https://avatars.discourse-cdn.com/v4/letter/j/8491ac/32.png) [@jhbdiehl](https://discourse.julialang.org/u/jhbdiehl)\
**Post date:** [November 20, 2020, 11:05am UTC](https://discourse.julialang.org/t/github-actions-ci-using-codecov-code-coverage/50487/1 "2020-11-20T11:05:39Z")

</div>

I am currently trying to shift my Julia CI from Travis to GitHub actions (and am pretty new to the topic of CI). Any working workflow for implementing **[codecov.io](http://codecov.io)** usage for **GitHub actions** in a j **ulia** project is highly appreciated, I couldn’t find any.  
Below you can find my current workflow. My main problems come from the interplay of

```julia
 julia --code-coverage test/runtests.jl

```

and

```julia
bash <(curl -s https://codecov.io/bash) 

```

The current `--code-coverage` option produces `.cov` files in the src directory. However the bash version of the codecov upload does not seem to find these files:

```julia
==> GitHub Actions detected.
    project root: .
    Yaml found at: .codecov.yml
--> token set from yaml
==> Running gcov in . (disable via -X gcov)
==> Python coveragepy not found
==> Searching for coverage reports in:
    + .
--> No coverage report found.
    Please visit http://docs.codecov.io/docs/supported-languages

```

I already tried to do this with the `Coverage.jl` package, which seemed to give a faulty upload url for some reason. I am aware of different out of the box actions for codecov or julia testing, but none worked in my combined use case.

Thanks in advance for your help!

```julia
name: CI
on:
  - push
  - pull_request

jobs:
  test:
    name: Julia ${{ matrix.version }} - ${{ matrix.os }} - ${{ matrix.arch }} - ${{ github.event_name }}
    runs-on: ${{ matrix.os }}
    strategy:
      fail-fast: false
      matrix:
        version:
          - '1.5'
        os:
          - ubuntu-latest
        arch:
          - x64
    steps:
      - uses: actions/checkout@v2
      - uses: julia-actions/setup-julia@v1
        with:
          version: ${{ matrix.version }}
          arch: ${{ matrix.arch }}
      - uses: actions/cache@v1
        env:
          cache-name: cache-artifacts
        with:
          path: ~/.julia/artifacts
          key: ${{ runner.os }}-test-${{ env.cache-name }}-${{ hashFiles('**/Project.toml') }}
          restore-keys: |
            ${{ runner.os }}-test-${{ env.cache-name }}-
            ${{ runner.os }}-test-
            ${{ runner.os }}-
      - uses: julia-actions/julia-buildpkg@v1
      - run: julia --code-coverage test/runtests.jl
      - uses: codecov/codecov-action@v1
      - run: bash <(curl -s https://codecov.io/bash) 
        shell: bash
  docs:
    name: Documentation
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v2
      - uses: julia-actions/setup-julia@v1
        with:
          version: '1'
      - run: |
          julia --project=docs -e '
            using Pkg
            Pkg.develop(PackageSpec(path=pwd()))
            Pkg.instantiate()'
      - run: julia --project=docs docs/make.jl
        env:
          GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
          DOCUMENTER_KEY: ${{ secrets.DOCUMENTER_KEY }}

```

---

<div class="post-metadata">

**Author:** ![DrChainsaw](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/drchainsaw/32/8497_2.png) [@DrChainsaw](https://discourse.julialang.org/u/DrChainsaw)\
**Post date:** [November 20, 2020, 11:22am UTC](https://discourse.julialang.org/t/github-actions-ci-using-codecov-code-coverage/50487/2 "2020-11-20T11:22:22Z")

</div>

I managed to get the config suggested here to work pretty much otb: [Easy workflow file for setting up GitHub Actions CI for your Julia package](https://discourse.julialang.org/t/easy-workflow-file-for-setting-up-github-actions-ci-for-your-julia-package/49765)

I didnt compare your config to the one in there so sorry if this is what you already tried.

---

<div class="post-metadata">

**Author:** ![jhbdiehl](https://avatars.discourse-cdn.com/v4/letter/j/8491ac/32.png) [@jhbdiehl](https://discourse.julialang.org/u/jhbdiehl)\
**Post date:** [November 20, 2020, 12:49pm UTC](https://discourse.julialang.org/t/github-actions-ci-using-codecov-code-coverage/50487/3 "2020-11-20T12:49:21Z")

</div>

That worked, thank you very much!  
It seems I did not include `julia-actions/julia-processcoverage@v1` in my code previously, which is why it did not work. Don’t know why I didn’t find this blog post earlier. Sorry!
