# Is GitHub-only code coverage possible?

**URL:** <https://discourse.julialang.org/t/is-github-only-code-coverage-possible/45070>\
**Category:** Tooling\
**Created:** [August 17, 2020, 12:04am UTC](https://discourse.julialang.org/t/is-github-only-code-coverage-possible/45070 "2020-08-17T00:04:47Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![anon37204545](https://avatars.discourse-cdn.com/v4/letter/a/439d5e/32.png) [@anon37204545](https://discourse.julialang.org/u/anon37204545)\
**Post date:** [August 17, 2020, 12:04am UTC](https://discourse.julialang.org/t/is-github-only-code-coverage-possible/45070/1 "2020-08-17T00:04:47Z")

</div>

Currently if you want to get code coverage report, you need to register on Codecov / Coveralls website and then authorize the service to access your repositories. Those services are essentially third-party to GitHub.

So I’m looking for a GitHub Actions-based alternative to Codecov / Coveralls. Something akin to how Travis can be replaced with GitHub Actions.

Of course I expect it to support Julia, but I’m wondering does it exist in the first place?

---

<div class="post-metadata">

**Author:** ![Amin\_Yahyaabadi](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/amin_yahyaabadi/32/9826_2.png) [@Amin\_Yahyaabadi](https://discourse.julialang.org/u/Amin_Yahyaabadi)\
**Post date:** [August 17, 2020, 12:09am UTC](https://discourse.julialang.org/t/is-github-only-code-coverage-possible/45070/2 "2020-08-17T00:09:43Z")

</div>

The coverage data are generated by Julia itself.

```julia
julia --code-coverage ....

```

So what these external services do are to get these data and show it in a human readable manner. [`Coverage.jl`](https://github.com/JuliaCI/Coverage.jl) does a lot with these data. Probably you can set a simple action to generate a `file tree vs coverage` report.

---

<div class="post-metadata">

**Author:** ![anon37204545](https://avatars.discourse-cdn.com/v4/letter/a/439d5e/32.png) [@anon37204545](https://discourse.julialang.org/u/anon37204545)\
**Post date:** [August 17, 2020, 12:26am UTC](https://discourse.julialang.org/t/is-github-only-code-coverage-possible/45070/3 "2020-08-17T00:26:45Z")

</div>

> [@Amin\_Yahyaabadi](#):
>
> So what these external services do are to get these data and show it in a human readable manner. [`Coverage.jl`](https://github.com/JuliaCI/Coverage.jl) does a lot with these data. Probably you can set a simple action to generate a `file tree vs coverage` report.

Thanks for clarifying this. Now my next question is whether someone came up with a Julia package / GitHub workflow / GitHub app that does what Codecov / Coveralls do, i.e. make a badge and comment on PRs that change coverage?

---

<div class="post-metadata">

**Author:** ![ericphanson](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/ericphanson/32/215186_2.png) [@ericphanson](https://discourse.julialang.org/u/ericphanson)\
**Post date:** [August 17, 2020, 11:34am UTC](https://discourse.julialang.org/t/is-github-only-code-coverage-possible/45070/4 "2020-08-17T11:34:02Z")

</div>

For public repositories, when run via github actions, codecov does not need a token or other special access, but you do need to still run some third party code (their github action). You can audit it though, at least. See [https://github.com/ericphanson/GuessworkQuantumSideInfo.jl/blob/4f20773aa564cc4d54bfb3be5e1e4a93c5a740fe/.github/workflows/ci.yml#L53](https://github.com/ericphanson/GuessworkQuantumSideInfo.jl/blob/4f20773aa564cc4d54bfb3be5e1e4a93c5a740fe/.github/workflows/ci.yml#L53) for an example. PkgTemplates should also configure this when you use Codecov and GitHub actions ([https://github.com/invenia/PkgTemplates.jl/pull/181](https://github.com/invenia/PkgTemplates.jl/pull/181)).

---

<div class="post-metadata">

**Author:** ![anon37204545](https://avatars.discourse-cdn.com/v4/letter/a/439d5e/32.png) [@anon37204545](https://discourse.julialang.org/u/anon37204545)\
**Post date:** [August 17, 2020, 11:37am UTC](https://discourse.julialang.org/t/is-github-only-code-coverage-possible/45070/5 "2020-08-17T11:37:50Z")

</div>

> [@ericphanson](#):
>
> but you do need to still run some third party code (their github action). You can audit it though, at least.

That part is not problematic, but does it still require you to have a Codecov account and authorize it to access GitHub data?

---

<div class="post-metadata">

**Author:** ![ericphanson](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/ericphanson/32/215186_2.png) [@ericphanson](https://discourse.julialang.org/u/ericphanson)\
**Post date:** [August 17, 2020, 11:52am UTC](https://discourse.julialang.org/t/is-github-only-code-coverage-possible/45070/6 "2020-08-17T11:52:10Z")

</div>

I thought you did not need to authorize it to access your GitHub account with the new github action, but I haven’t actually tested that myself (since I already had authorized them from the previous way of doing it), so I am not totally sure. Likewise I’m not sure if you need to create a codecov account or not, but that seems less of an issue as well.

---

<div class="post-metadata">

**Author:** ![YongHee-Kim](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/yonghee-kim/32/5965_2.png) [@YongHee-Kim](https://discourse.julialang.org/u/YongHee-Kim)\
**Post date:** [September 12, 2020, 9:46am UTC](https://discourse.julialang.org/t/is-github-only-code-coverage-possible/45070/7 "2020-09-12T09:46:47Z")

</div>

Yeah it is possible. I’ve got it working with [ReportGenerator](https://github.com/danielpalme/ReportGenerator-GitHub-Action) you can create report and deploy via github pages.

See [JSONPointer.jl](https://github.com/devsisters/JSONPointer.jl) and [XLSXasJSON.jl](https://github.com/devsisters/XLSXasJSON.jl) for example

It seems having coverage history graph is possible as well, but I didn’t get it working yet.
