c9s / r3

libr3 is a high-performance path dispatching library. It compiles your route paths into a prefix tree (trie). By using the constructed prefix trie in the start-up time, you may dispatch your routes with efficiency
http://c9s.github.com/r3/bench.html
MIT License
813 stars 83 forks source link

Use recommended Coveralls GitHub action in CI #146

Closed bjosv closed 2 years ago

bjosv commented 2 years ago

Coverage reporting using cpp-coveralls seems not to work as expected in Github Actions.

In Travis there is built-in support for Coveralls and jobs are provided a needed Coveralls token. In Github the token needs to be provided via an environment variable COVERALLS_REPO_TOKEN, and to avoid making the token public it can be provided via a secret. The drawback of using secrets is that jobs triggered by forks will not be given the secret for security reasons, i.e coverage will not be collected for PRs.

This PR uses an alternative way by collecting the coverage using lcov, and pushing the result to the Coveralls site using their supported Github Action.

c9s commented 2 years ago

Thanks!

c9s commented 2 years ago

@bjosv I added an environment with that environment variable COVERALLS_REPO_TOKEN configured with the coverall token. could you please take a look and see if it's correctly configured? thank you

bjosv commented 2 years ago

@c9s My understanding of the added action is that it uses the the github token instead of a specified coveralls token. The github token automatically exists when running a job.

It looks like the last CI run on the 2.0 branch was able to push the coverage using the github token, but its red due to that coveralls report it as a failure via https://coveralls.io/builds/43843036 The coverage changed from 87.46 (2016) to 70.95 (now) and it was probably bigger than the threshold configured in coveralls, so therefor reported as red/fail (described here). I think the next commit should be fine.