coverallsapp / github-action

Coveralls Github Action
https://coveralls.io
MIT License
455 stars 76 forks source link

Mono repo + Windows absolute paths? #169

Closed dcharkes closed 1 year ago

dcharkes commented 1 year ago

When generating coverage, the LCOV files contain absolute paths. How this Coveralls convert these to relative paths?

We have a matrix build that uploads coverage for various builds:

[ ... ]
      - name: Upload coverage
        uses: coverallsapp/github-action@67662d24394fd74bffcf7b462d1b432814159afd
        with:
          flag-name: ${{ matrix.package }}-${{ matrix.os }}
          github-token: ${{ secrets.GITHUB_TOKEN }}
          parallel: true

and in the end we signal we are done:

  coverage-finished:
    needs: [build]
    runs-on: ubuntu-latest
    steps:
      - name: Upload coverage
        uses: coverallsapp/github-action@67662d24394fd74bffcf7b462d1b432814159afd
        with:
          github-token: ${{ secrets.GITHUB_TOKEN }}
          parallel-finished: true

In the coveralls UI, the MacOS/Linux paths are relative to current working directory, but this doesn't seem the case for the Windows build:

An older build seemed to work, but as far as I can see nothing changed in the configuration 🙊

For reference, the GitHub workflow configuration:

Upon inspection, all LCOV files we produce contain absolute paths everywhere. That must mean there is some logic somewhere within Coveralls to convert these to relative paths. How does that logic work?

Should we be emitting LCOV files with relative paths instead to avoid these kinds of issues? Or am I doing something else wrong in the configuration? Feel free to leave a comment on https://github.com/dart-lang/native/pull/16.

mrexox commented 1 year ago

I think there's an issue with replacing the CWD in Windows, since data in LCOV contains slashes D:/a/project/path, but current directory is returned with backslashes D:\a\project\path. I think we can easily fix that, let me come back in 1-2 hours.

mrexox commented 1 year ago

I think I've fixed that with a new release of coverage-reporter. Please, re-run the workflows, now paths should be the same across all OSes.

dcharkes commented 1 year ago

Sweet! https://coveralls.io/builds/59349527

Thanks for the super quick fix! 🚀