You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@logging.apache.org by sw...@apache.org on 2025/01/31 02:18:09 UTC
(logging-log4cxx) branch update_sonar_cloud_version created (now 2d6f40bc)
This is an automated email from the ASF dual-hosted git repository.
swebb2066 pushed a change to branch update_sonar_cloud_version
in repository https://gitbox.apache.org/repos/asf/logging-log4cxx.git
at 2d6f40bc Update to latest SonarQube scanner version
This branch includes the following new commits:
new 2d6f40bc Update to latest SonarQube scanner version
The 1 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails. The revisions
listed as "add" were already present in the repository and have only
been added to this reference.
(logging-log4cxx) 01/01: Update to latest SonarQube scanner version
Posted by sw...@apache.org.
This is an automated email from the ASF dual-hosted git repository.
swebb2066 pushed a commit to branch update_sonar_cloud_version
in repository https://gitbox.apache.org/repos/asf/logging-log4cxx.git
commit 2d6f40bc4756289a9aadbfd5ca2052a6591a989c
Author: Stephen Webb <sw...@gmail.com>
AuthorDate: Fri Jan 31 13:17:48 2025 +1100
Update to latest SonarQube scanner version
---
.github/workflows/sonarcloud.yml | 41 ++++++++++++++++------------------------
1 file changed, 16 insertions(+), 25 deletions(-)
diff --git a/.github/workflows/sonarcloud.yml b/.github/workflows/sonarcloud.yml
index f2d5a732..7454eacc 100644
--- a/.github/workflows/sonarcloud.yml
+++ b/.github/workflows/sonarcloud.yml
@@ -20,15 +20,15 @@ on:
- master
- next_stable
- sonar*
-# pull_request:
-# types: [opened, synchronize, reopened]
+ pull_request:
+ types: [opened, synchronize, reopened]
jobs:
build:
name: Build
runs-on: ubuntu-latest
env:
- SONAR_SCANNER_VERSION: 5.0.1.3006
+ SONAR_ACTION_VERSION: v4.2.1
SONAR_SERVER_URL: "https://sonarcloud.io"
BUILD_WRAPPER_OUT_DIR: build_wrapper_output_directory # Directory where build-wrapper output will be placed
steps:
@@ -57,22 +57,10 @@ jobs:
sudo apt-get update
sudo apt-get install -y libapr1-dev libaprutil1-dev
- - name: Download and set up sonar-scanner
+ - name: Install Build Wrapper
+ uses: SonarSource/sonarqube-scan-action/install-build-wrapper@${{ env.SONAR_ACTION_VERSION }}
env:
- SONAR_SCANNER_DOWNLOAD_URL: https://binaries.sonarsource.com/Distribution/sonar-scanner-cli/sonar-scanner-cli-${{ env.SONAR_SCANNER_VERSION }}-linux.zip
- run: |
- 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/
- 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
- 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/
- echo "$HOME/.sonar/build-wrapper-linux-x86" >> $GITHUB_PATH
+ SONAR_HOST_URL: ${{ secrets.SONAR_HOST_URL }}
- name: Run build-wrapper
run: |
@@ -92,13 +80,16 @@ jobs:
gcovr --version
gcovr --sonarqube -r ../../../../ --verbose --gcov-ignore-parse-errors --exclude '../../../../src/test/' --exclude '../../../../src/examples' -o ../../../coverage.xml
- - name: Run sonar-scanner
+ - name: SonarQube Scan
+ uses: SonarSource/sonarqube-scan-action@${{ env.SONAR_ACTION_VERSION }}
env:
- GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- SONAR_TOKEN: ${{ secrets.SONARCLOUD_TOKEN }}
- run: |
- cd main
- sonar-scanner \
+ SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
+ SONAR_HOST_URL: ${{ secrets.SONAR_HOST_URL }}
+ SONAR_ROOT_CERT: ${{ secrets.SONAR_ROOT_CERT }}
+ with:
+ # Consult https://docs.sonarsource.com/sonarqube-server/latest/analyzing-source-code/scanners/sonarscanner/ for more information and options
+ args: >
--define sonar.host.url="${{ env.SONAR_SERVER_URL }}" \
- --define sonar.cfamily.build-wrapper-output="${{ env.BUILD_WRAPPER_OUT_DIR }}" \
+ --define sonar.cfamily.compile-commands="${{ env.BUILD_WRAPPER_OUT_DIR }}/compile_commands.json"
--define sonar.coverageReportPaths=build/coverage.xml
+