From 613dc1b79b181fc8d14b87e452a7c51848043cd5 Mon Sep 17 00:00:00 2001 From: =?utf8?q?J=C3=A9r=C3=B4me=20Benoit?= Date: Sat, 21 Aug 2021 13:02:09 +0200 Subject: [PATCH] Add sonarcloud to GitHub actions MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Signed-off-by: Jérôme Benoit --- .github/workflows/build.yml | 13 +++++++++++++ sonar-project.properties | 12 ++++++++++++ 2 files changed, 25 insertions(+) create mode 100644 sonar-project.properties 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 -- 2.34.1