github-actions test-coverage fails on one package but passes on another?

I don't understand why in my Delaporte package the test-coverage action fails with an Error in file(con, "r") : cannot open the connection but in the revss package the test works. In both cases the R-Cmd-check yaml completes its workflow. Could it be the compiled code? The yamls are bit-identical. Thank you.

This problem has already been listed here without an answer:

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.

If you have a query related to it or one of the replies, start a new topic and refer back with a link.

Thank you, Jim, that worked! I'll keep that in mind when I convert my fourth package to Github actions. It needs Rcpp, so if it fails on macOS I'll switch to ubuntu right away. Thank you again!!

In that repository the case when they received the error the package did not have any tests or R code, https://github.com/hirenp-waferwire/RLint/runs/1065893143#step:8:9, https://github.com/hirenp-waferwire/RLint/tree/2657a20e1f27214aed6b5ee6b746ac9db1c98e18

The issue with Delaporte seems to be that the package uses FORTRAN code, which requires gfortran, but the default C compiler on macOS is clang. The gcov formats between gcc and clang are different, so I think you would need to compile both the FORTRAN and C code with the same toolchain (and use the gcc gcov binary) to get the expected results. I can reproduce the same issue outside of GitHub Actions on macOS and see a more informative error with covr::package_coverage(quiet = FALSE).

Probably the easiest solution is for you to run the coverage action on a linux runner rather than a macOS one, which has gcc as the default toolchain. We default to using macOS because of CRAN supplied package binaries, but it is clearly causing friction in this case.

I opened a pull request with the necessary change at https://github.com/aadler/Delaporte/pull/1

1 Like