5monkeys / cobertura-action

GitHub Action to report cobertura coverage
MIT License
63 stars 69 forks source link

link missing files fails for windows action #86

Open wolframhaussig opened 1 year ago

wolframhaussig commented 1 year ago

We integrated cobertura-action into a github action for .net on windows with the following config:

    - uses: 5monkeys/cobertura-action@master
      with:
        path: ./coverage/**/coverage.cobertura.xml
        skip_covered: false
        show_missing: true
        link_missing_lines: true
        link_missing_lines_source_dir: WinFormsThemes/WinFormsThemes
        minimum_coverage: 80

This works, but the links created by link_missing_lines are broken:

The file seems to be reported as Themes\FileTheme.cs and is used directly in the created url instead of being translated into /.

An example can be found here

Is this a bug or do I need to configure something else?

ryanhendersonabs commented 1 year ago

I'm seeing the same behavior, also on a Windows runner.

wolframhaussig commented 1 year ago

@ryanhendersonabs If you are still looking for a Workaround, this is what we currently use:

    - name: Workaround for backslashes in path https://github.com/5monkeys/cobertura-action/issues/86 
       run: (Get-Content -path ./coverage/**/coverage.cobertura.xml -Raw) -replace '\\','/' | out-file -FilePath ./coverage/**/coverage.cobertura.xml
ryanhendersonabs commented 1 year ago

@wolframhaussig awesome, thanks for sharing!