diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 7a7654a..51c998f 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -10,12 +10,21 @@ on: jobs: scala: - runs-on: ubuntu-latest strategy: + fail-fast: false # remove when PR is finished, just to make sure we don't make regression matrix: JDK: [ 8, 17 ] + os: + - ubuntu-latest + - windows-latest + runs-on: ${{ matrix.os }} steps: + - name: Ignore line ending differences in git + if: contains(runner.os, 'windows') + shell: bash + run: git config --global core.autocrlf false + - name: checkout the repo uses: actions/checkout@v4 with: diff --git a/src/main/scala/org/scoverage/coveralls/CoberturaMultiSourceReader.scala b/src/main/scala/org/scoverage/coveralls/CoberturaMultiSourceReader.scala index 084871b..aec5f57 100644 --- a/src/main/scala/org/scoverage/coveralls/CoberturaMultiSourceReader.scala +++ b/src/main/scala/org/scoverage/coveralls/CoberturaMultiSourceReader.scala @@ -114,7 +114,7 @@ class CoberturaMultiSourceReader( protected def lineCoverage(sourceFile: String) = { val filenamePath = - splitPath(new File(sourceFile))._2.replace(File.separator, "/") + splitPath(new File(sourceFile))._2 lineCoverageMap(filenamePath) } @@ -130,9 +130,7 @@ class CoberturaMultiSourceReader( val lineHitMap = lineCoverage(source) val fullLineHit = (0 until lineCount).map(i => lineHitMap.get(i + 1)) - val sourceNormalized = source.replace(File.separator, "/") - - SourceFileReport(sourceNormalized, fullLineHit.toList) + SourceFileReport(source, fullLineHit.toList) } } diff --git a/src/main/scala/org/scoverage/coveralls/CoverallPayloadWriter.scala b/src/main/scala/org/scoverage/coveralls/CoverallPayloadWriter.scala index afc1518..65f4ee7 100644 --- a/src/main/scala/org/scoverage/coveralls/CoverallPayloadWriter.scala +++ b/src/main/scala/org/scoverage/coveralls/CoverallPayloadWriter.scala @@ -95,8 +95,7 @@ class CoverallPayloadWriter( } def addSourceFile(report: SourceFileReport) = { - val repoRootDirStr = - repoRootDir.getCanonicalPath.replace(File.separator, "/") + "/" + val repoRootDirStr = repoRootDir.getCanonicalPath + File.separator // create a name relative to the project root (rather than the module root) // this is needed so that coveralls can find the file in git.