From 0ae0cba37f1b6b0c7bd4e777d1888ab7af7f50cf Mon Sep 17 00:00:00 2001 From: Fred Suter Date: Fri, 24 May 2024 12:50:49 -0400 Subject: [PATCH] swith to CI analysis mode for sonar --- .github/workflows/build.yml | 18 +++++++++++++++++- ...loud.properties => sonar-project.properties | 0 2 files changed, 17 insertions(+), 1 deletion(-) rename .sonarcloud.properties => sonar-project.properties (100%) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 2c83250..f13656b 100755 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -14,13 +14,17 @@ concurrency: jobs: build: runs-on: ubuntu-latest + env: + BUILD_WRAPPER_OUT_DIR: bw-outputs steps: - uses: actions/checkout@master - + with: + fetch-depth: 0 - name: Install prereqs run: | sudo apt-get update sudo apt-get install -y libgraphviz-dev libboost-all-dev + - name: Install SimGrid run: | git clone https://framagit.org/simgrid/simgrid.git @@ -44,6 +48,18 @@ jobs: run: | sudo apt-get -y install lcov + - name: Install sonar-scanner and build-wrapper + uses: SonarSource/sonarcloud-github-c-cpp@v2 + - name: Run build-wrapper + run: | + build-wrapper-linux-x86-64 --out-dir ${{ env.BUILD_WRAPPER_OUT_DIR }} make + - name: Run sonar-scanner + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }} + run: | + sonar-scanner --define sonar.cfamily.compile-commands="${{ env.BUILD_WRAPPER_OUT_DIR }}/compile_commands.json" + - name: Run tests, compute coverage env: CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }} diff --git a/.sonarcloud.properties b/sonar-project.properties similarity index 100% rename from .sonarcloud.properties rename to sonar-project.properties