Skip to content

Failed to resolve files with SonarQube in GitHub Actions #448

Open
@Israphel

Description

@Israphel

I have an installation of SonarQube 8.9.6 Developer Edition.

I’m trying to upload a coverage report for a scala project, by using the scoverage plugin.

I run sonar-scanner via Github Actions by using the aciton SonarSource/sonarcloud-github-action@v1.6, with the following config:

- name: SonarQube Scan
  uses: SonarSource/sonarcloud-github-action@v1.6
  env:
    SONAR_TOKEN: ${{ secrets.SONARQUBE_TOKEN }}
  with:
    projectBaseDir: .
    args: >
     -Dsonar.host.url=${{ secrets.SONARQUBE_HOST }}
     -Dsonar.projectName=${{ github.event.repository.name }}
     -Dsonar.projectKey=${{ github.event.repository.name }}
     -Dsonar.sources=src/main/scala
     -Dsonar.tests=src/test/scala
     -Dsonar.scala.version=2.12
     -Dsonar.scala.coverage.reportPaths="target/scala-2.12/scoverage-report/scoverage.xml"

the report was generated in the step before, by running:

sbt compile coverage test assembly
sbt coverageAggregate

and I can confirm the report is there, and it shows the proper values.

However, when the action is executed in Github, I get:

INFO: Sensor Scoverage sensor for Scala coverage [sonarscala]
INFO: Importing /github/workspace/target/scala-2.12/scoverage-report/scoverage.xml
WARN: Fail to resolve 6 file(s). No coverage data will be imported on the following file(s): /home/runner/work/spark-td/spark-td/src/main/scala/io/split/td/mtks/CustomQueryListener.scala;/home/runner/work/spark-td/spark-td/src/main/scala/io/split/td/mtks/Sink.scala;/home/runner/work/spark-td/spark-td/src/main/scala/io/split/td/mtks/SinkConfig.scala;/home/runner/work/spark-td/spark-td/src/main/scala/io/split/td/util/config/StatsDInitializer.scala;/home/runner/work/spark-td/spark-td/src/main/scala/io/split/td/util/config/ssm.scala;/home/runner/work/spark-td/spark-td/src/main/scala/io/split/td/util/infra/metadata.scala

I have tried running a local copy of SonarQube comunity edition in a docker container, and push the report with sonar-scanner, and I get the expected results.

Is there a problem with this tool in Github Actions in particular?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions