From: Jérôme Benoit Date: Sat, 21 Aug 2021 11:02:09 +0000 (+0200) Subject: Add sonarcloud to GitHub actions X-Git-Tag: v1.0.39~4 X-Git-Url: https://git.piment-noir.org/?a=commitdiff_plain;h=613dc1b79b181fc8d14b87e452a7c51848043cd5;p=e-mobility-charging-stations-simulator.git Add sonarcloud to GitHub actions Signed-off-by: Jérôme Benoit --- diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 47a8f675..5396c211 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -4,6 +4,7 @@ on: branches: - master pull_request: + types: [opened, synchronize, reopened] branches: - master jobs: @@ -33,4 +34,16 @@ jobs: run: | cd docker make SUBMODULES_INIT=false + sonarcloud: + name: SonarCloud + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + with: + fetch-depth: 0 # Shallow clones should be disabled for a better relevancy of analysis + - name: SonarCloud Scan + uses: SonarSource/sonarcloud-github-action@master + env: + GITHUB_TOKEN: ${{ secrets.USER_TOKEN }} # Needed to get PR information, if any + SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }} diff --git a/sonar-project.properties b/sonar-project.properties new file mode 100644 index 00000000..66831a54 --- /dev/null +++ b/sonar-project.properties @@ -0,0 +1,12 @@ +sonar.projectKey=jerome-benoit_ev-simulator +sonar.organization=jerome-benoit + +# This is the name and version displayed in the SonarCloud UI. +#sonar.projectName=ev-simulator +#sonar.projectVersion=1.0 + +# Path is relative to the sonar-project.properties file. Replace "\" by "/" on Windows. +#sonar.sources=. + +# Encoding of the source code. Default is default system encoding +#sonar.sourceEncoding=UTF-8