diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml new file mode 100644 index 0000000..6627fd7 --- /dev/null +++ b/.github/workflows/build.yml @@ -0,0 +1,26 @@ +name: Build +on: + push: + branches: + - master + pull_request: + types: [opened, synchronize, reopened] +jobs: + sonarcloud: + name: SonarCloud + runs-on: macos-latest + steps: + - uses: actions/checkout@v2 + with: + fetch-depth: 0 # Shallow clones should be disabled for a better relevancy of analysis + - name: Build wrapper + run: | + curl -s --create-dirs -o ./wrapper.zip https://sonarcloud.io/static/cpp/build-wrapper-macosx-x86.zip + unzip -q -o wrapper.zip + mv build-wrapper-macosx-x86 wrapper + ./wrapper/build-wrapper-macosx-x86 --out-dir bw-output make config all + - name: SonarCloud Scan + uses: SonarSource/sonarcloud-github-action@master + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_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 0000000..f3d7a5f --- /dev/null +++ b/sonar-project.properties @@ -0,0 +1,14 @@ +sonar.projectKey=ladislas_mbed-cmake-template +sonar.organization=ladislas + +# This is the name and version displayed in the SonarCloud UI. +sonar.projectName=mbed-cmake-template +sonar.projectVersion=1.0 + +# Path is relative to the sonar-project.properties file. Replace "\" by "/" on Windows. +sonar.cfamily.build-wrapper-output=bw-output +sonar.sources=src,spikes,libs +sonar.tests=test + +# Encoding of the source code. Default is default system encoding +sonar.sourceEncoding=UTF-8