Skip to content

Commit

Permalink
Updated sonar integration so that scanner and build-wrapper are insta…
Browse files Browse the repository at this point in the history
…lled using the official github action
  • Loading branch information
PhilInTheGaps committed Nov 3, 2023
1 parent e39711f commit 0063ca4
Showing 1 changed file with 5 additions and 24 deletions.
29 changes: 5 additions & 24 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -124,6 +124,8 @@ jobs:
matrix:
qt-version: ["6.5.2"]
compiler: ["gcc_64"]
env:
QT_QPA_PLATFORM: "offscreen"
steps:
- name: Checkout Repository
uses: actions/checkout@v3
Expand Down Expand Up @@ -192,14 +194,11 @@ jobs:
- name: Make
run: |
export QT_QPA_PLATFORM="offscreen"
cd build
cmake --build . -j2
- name: Tests
run: |
export QT_QPA_PLATFORM="offscreen"
cd build
ctest --output-on-failure
Expand Down Expand Up @@ -243,8 +242,7 @@ jobs:
qt-version: ["6.5.2"]
compiler: ["gcc_64"]
env:
SONAR_SCANNER_VERSION: 4.8.0.2856
SONAR_SERVER_URL: "https://sonarcloud.io"
QT_QPA_PLATFORM: "offscreen"
steps:
- name: Checkout Repository
uses: actions/checkout@v3
Expand Down Expand Up @@ -282,22 +280,8 @@ jobs:
key: ${{ runner.os }}-sonar
restore-keys: ${{ runner.os }}-sonar

- name: Download and set up sonar-scanner
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
- name: Install sonar-scanner and build-wrapper
uses: SonarSource/sonarcloud-github-c-cpp@v1

- name: Install cget
run: sudo pip3 install wheel cget
Expand All @@ -321,15 +305,12 @@ jobs:
- name: Run build-wrapper
run: |
export QT_QPA_PLATFORM="offscreen"
cd build
cmake .. -D CMAKE_BUILD_TYPE=Debug -D CMAKE_INSTALL_PREFIX=AppDir/usr -DIS_RUNNING_IN_CI=ON -DENABLE_CODE_COVERAGE=ON
build-wrapper-linux-x86-64 --out-dir bw-output cmake --build . -j2
- name: Tests
run: |
export QT_QPA_PLATFORM="offscreen"
cd build
ctest --output-on-failure
Expand Down

0 comments on commit 0063ca4

Please sign in to comment.