forked from eclipse-wakaama/wakaama
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
This will give us details coverage and static and static code analysis for every push. To enable the integration, take the following steps: - Log in to https://sonarcloud.io/ using your GitHub account - Visit https://sonarcloud.io/projects/create, add Wakaama (fairly self-explanatory) - Create a PR in your repository to verify the integration PRs do not get checked because it is tricky to do it in a secure fashion: - https://jira.sonarsource.com/browse/MMF-1371 - https://securitylab.github.com/research/github-actions-preventing-pwn-requests/ Signed-off-by: Reto Schneider <code@reto-schneider.ch>
- Loading branch information
1 parent
dc42ea4
commit 866e505
Showing
3 changed files
with
104 additions
and
15 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,58 @@ | ||
name: SonarCloud | ||
|
||
on: [push] | ||
|
||
jobs: | ||
sonarcloud: | ||
runs-on: ubuntu-20.04 | ||
|
||
steps: | ||
- name: Checkout code including full history and submodules | ||
uses: actions/checkout@v2 | ||
with: | ||
submodules: true | ||
fetch-depth: 0 | ||
|
||
- name: Install dependencies from APT repository | ||
run: | | ||
sudo apt-get update | ||
sudo apt-get install gcovr libcunit1-dev wget unzip | ||
- name: Install CMake | ||
uses: lukka/get-cmake@latest | ||
|
||
- name: Install Ninja | ||
uses: seanmiddleditch/gha-setup-ninja@master | ||
|
||
- name: Setup SonarScanner | ||
uses: warchant/setup-sonar-scanner@v3 | ||
with: | ||
version: 4.6.0.2311 | ||
|
||
- name: Install Build Wrapper | ||
run: | | ||
wget https://sonarcloud.io/static/cpp/build-wrapper-linux-x86.zip -O /tmp/build-wrapper-linux-x86.zip | ||
mkdir ~/opt/ | ||
unzip /tmp/build-wrapper-linux-x86.zip -d ~/opt/ | ||
- name: Collect test coverage data | ||
run: | | ||
tools/ci/run_ci.sh \ | ||
--all \ | ||
--sonarqube ~/opt/build-wrapper-linux-x86/build-wrapper-linux-x86-64 | ||
- name: Run SonarCloud Scan | ||
run: | | ||
sonar-scanner \ | ||
-Dsonar.branch.name="${GITHUB_REF_NAME}" \ | ||
-Dsonar.cfamily.build-wrapper-output=build-wakaama/sonar-cloud-build-wrapper-output \ | ||
-Dsonar.cfamily.cache.enabled=false \ | ||
-Dsonar.cfamily.gcov.reportsPath=build-wakaama \ | ||
-Dsonar.cfamily.threads=2 \ | ||
-Dsonar.exclusions="build-wakaama-*/**, .git/**" \ | ||
-Dsonar.host.url=https://sonarcloud.io \ | ||
-Dsonar.login=${{ secrets.SONAR_TOKEN }} \ | ||
-Dsonar.organization=${{ github.repository_owner }} \ | ||
-Dsonar.projectKey="$(echo ${{ github.repository }} | tr / _)" \ | ||
-Dsonar.sourceEncoding=UTF-8 \ | ||
-Dsonar.sources=. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -37,3 +37,6 @@ core/cmake_install.cmake | |
lwm2mclient | ||
lwm2mserver | ||
tlvdecode | ||
|
||
# SonarQube default work directory | ||
.scannerwork |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters