Hey @mickaelcaro After trying different things, I could solve it. Not sure why https://github.com/SonarSource/sonarcloud-github-action is not working (maybe there is an issue with sbt or scala, not sure). Using the following sbt plugin https://sonar-scala.com/docs/setup/sbt-sonar/ was the only thing that worked. I have to generate a token in sonar cloud and add a new key named SONAR_TOKEN to my secrets in my github repo. This is how my github workflow yaml file looks
name: Continious Integration
on:
pull_request:
branches:
- master
paths-ignore:
- '**.md'
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2
with:
fetch-depth: 0
- name: Cache SBT
uses: actions/cache@v2
with:
path: |
~/.ivy2/cache
~/.sbt
key: ${{ runner.os }}-sbt-${{ hashFiles('**/build.sbt') }}
- name: Setup Scala
uses: actions/setup-java@v1
with:
java-version: 11
- name: Test with Coverage / Static code analyse / Code style
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
run: |
sbt \
-Dsonar.host.url=https://sonarcloud.io \
-Dsonar.organization=gastonschabas \
-Dsonar.projectKey=gastonschabas_rumble-on-scala \
-Dsonar.sources=src/main/scala \
-Dsonar.tests=src/test/scala \
-Dsonar.scala.scalastyle.reportPaths=target/scalastyle-result.xml \
-Dsonar.scala.scapegoat.reportPaths=target/scala-2.12/scapegoat-report/scapegoat-scalastyle.xml \
-Dsonar.scala.coverage.reportPaths=target/scala-2.12/scoverage-report/scoverage.xml \
clean compile coverage test coverageReport scapegoat scalastyle scalafmtCheckAll scalafmtSbtCheck sonarScan
Thanks for your help and sorry for my late answer