From e39895cf6f6195ba4e36dee709da2d4193ac51c1 Mon Sep 17 00:00:00 2001 From: Edgar Date: Mon, 16 May 2022 12:15:26 +0200 Subject: [PATCH] :wrench: Updated sonarscan output --- .github/workflows/sonarcloud.yml | 16 ++++++---------- sonar-project.properties | 4 +++- 2 files changed, 9 insertions(+), 11 deletions(-) diff --git a/.github/workflows/sonarcloud.yml b/.github/workflows/sonarcloud.yml index 54b02fd..fdee025 100644 --- a/.github/workflows/sonarcloud.yml +++ b/.github/workflows/sonarcloud.yml @@ -12,8 +12,6 @@ jobs: runs-on: ubuntu-latest env: SONAR_SCANNER_VERSION: 4.7.0.2747 - SONAR_SERVER_URL: "https://sonarcloud.io" - BUILD_WRAPPER_OUT_DIR: sonar-out # Directory where build-wrapper output will be placed steps: - uses: actions/checkout@v3 with: @@ -30,11 +28,13 @@ jobs: mkdir -p $HOME/.sonar curl -sSLo $HOME/.sonar/sonar-scanner.zip ${{ env.SONAR_SCANNER_DOWNLOAD_URL }} unzip -o $HOME/.sonar/sonar-scanner.zip -d $HOME/.sonar/ + wget -nv https://cdn.anotherfoxguy.com/sonar-scanner/mofilereader -O run-sonar-scanner + sudo chmod 777 run-sonar-scanner echo "$HOME/.sonar/sonar-scanner-${{ env.SONAR_SCANNER_VERSION }}-linux/bin" >> $GITHUB_PATH - name: Download and set up build-wrapper env: - BUILD_WRAPPER_DOWNLOAD_URL: ${{ env.SONAR_SERVER_URL }}/static/cpp/build-wrapper-linux-x86.zip + BUILD_WRAPPER_DOWNLOAD_URL: https://sonarcloud.io/static/cpp/build-wrapper-linux-x86.zip run: | curl -sSLo $HOME/.sonar/build-wrapper-linux-x86.zip ${{ env.BUILD_WRAPPER_DOWNLOAD_URL }} unzip -o $HOME/.sonar/build-wrapper-linux-x86.zip -d $HOME/.sonar/ @@ -44,8 +44,7 @@ jobs: run: cmake -DCMAKE_BUILD_TYPE=RelWithDebInfo -DBUILD_TEST=ON -DENABLE_COVERAGE=ON . - name: Run build-wrapper - run: | - build-wrapper-linux-x86-64 --out-dir ${{ env.BUILD_WRAPPER_OUT_DIR }} make -j4 + run: build-wrapper-linux-x86-64 --out-dir bw-output make -j4 - name: Test run: ctest --output-on-failure . @@ -56,8 +55,5 @@ jobs: - name: Run sonar-scanner env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }} - run: | - sonar-scanner \ - --define sonar.host.url="${{ env.SONAR_SERVER_URL }}" \ - --define sonar.cfamily.build-wrapper-output="${{ env.BUILD_WRAPPER_OUT_DIR }}" + SONAR_SCANNER_EXE: /home/runner/.sonar/sonar-scanner-${{ env.SONAR_SCANNER_VERSION }}-linux/bin/sonar-scanner + run: ./run-sonar-scanner diff --git a/sonar-project.properties b/sonar-project.properties index dd46daa..7420ef2 100644 --- a/sonar-project.properties +++ b/sonar-project.properties @@ -1,3 +1,4 @@ +sonar.host.url=https://sonarcloud.io sonar.projectKey=AnotherFoxGuy_MofileReader sonar.organization=anotherfoxguy-github @@ -11,4 +12,5 @@ sonar.sources=. # Encoding of the source code. Default is default system encoding #sonar.sourceEncoding=UTF-8 -sonar.cfamily.gcov.reportsPath=test \ No newline at end of file +sonar.cfamily.gcov.reportsPath=test +sonar.cfamily.build-wrapper-output=bw-output \ No newline at end of file