rgithub-actionsopenmpr-packagecovr

Disable OpenMP for code coverage of an R package on Github actions


I have an R package with C++ code and I'm using GitHub actions to run unit tests and code coverage with covr. Everything is working.

However, code coverage does not work with parallelized blocks of C++ code. Thus, significant portions of the code are nonexistent from the coverage point of view (not missed, not hit, just nonexistent).

Consequently, my plan it to disable OpenMP specifically on Github for the coverage action and compile the code without support of OpenMP. I see 2 options:


Solution

  • I found a third option. I'm running the coverage on macOS instead of Linux because it has no native support of OpenMP.