github-action icon indicating copy to clipboard operation
github-action copied to clipboard

Action expects `lcov` to be run in `runner` environment/file system.

Open zfields opened this issue 3 years ago • 1 comments

If unit-tests and lcov are run inside a container, they end up with a path like, /github/workspace/src/SourceFile.cpp. However, if the unit-tests and lcov are executed using the run: tag (natively in the runner), they have a path like, /home/runner/work/<repo>/<repo>/src/SourceFile.cpp.

I was unable to discover an option that could be passed to lcov to satisfy the Coveralls GitHub action requirement. I was able to introduce a workflow step to workaround this issue (shown below), but my goal would be to remove this step in favor of an updated Coveralls acton.

- name: Coveralls Action Bug Workaround
  id: coveralls_bug_workaround
  run: sudo sed -i 's/github\/workspace/home\/runner\/work\/<repo>\/<repo>/g' ./coverage/lcov.info

My expectation is that the Coveralls GitHub action would be compatible with tests executed in both native and docker actions.

zfields avatar Nov 03 '21 03:11 zfields

This is working for me. I build and run the test in a container like this:

 ctest:
    runs-on: ubuntu-latest
    container: barabas5532/shrapnel:3

The input lcov file paths, and verbose prints from this Action with NODE_COVERALLS_DEBUG: 1 look like this:

SF:/__w/ShrapnelMonorepo/ShrapnelMonorepo/firmware/components/audio_param/include/audio_param.h

The actual payload send to coveralls is this:

{"source_files":[{"name":"firmware/components/audio_param/include/audio_param.h",

Looks like it's handled by the coveralls library function convertLcovToCoveralls. Here is their test. Although, it's not clear how the getOptions call gets the correct library path in the context of this Action.

Barabas5532 avatar Feb 26 '22 10:02 Barabas5532