Skip to content

Commit

Permalink
fix sq?
Browse files Browse the repository at this point in the history
  • Loading branch information
derselbst committed Aug 12, 2023
1 parent 782c3ac commit e959315
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 18 deletions.
28 changes: 11 additions & 17 deletions .github/workflows/sonarcloud.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ env:
# Customize the CMake build type here (Release, Debug, RelWithDebInfo, etc.)
# Use Debug build for better code coverage results
BUILD_TYPE: Debug
BUILD_WRAPPER_OUT_DIR: build_wrapper_output_directory # Directory where build-wrapper output will be placed

name: SonarCloud Workflow
jobs:
Expand Down Expand Up @@ -60,20 +61,23 @@ jobs:
shell: bash
working-directory: ${{github.workspace}}/build
run: cmake -DCMAKE_BUILD_TYPE=$BUILD_TYPE -Werror=dev -Denable-portaudio=1 -Denable-ladspa=1 -Denable-coverage=1 -DNO_GUI=1 $GITHUB_WORKSPACE

- name: Install sonar-scanner and build-wrapper
uses: SonarSource/sonarcloud-github-c-cpp@v1

- name: Build
working-directory: ${{github.workspace}}/build
shell: bash
# Execute the build. You can specify a specific target with "--target <NAME>"
run: |
./build-wrapper-linux-x86-64 --out-dir bw-output make
build-wrapper-linux-x86-64 --out-dir ${{ env.BUILD_WRAPPER_OUT_DIR }} make
- name: Test
working-directory: ${{github.workspace}}/build
shell: bash
# Execute tests defined by the CMake configuration.
run: |
./build-wrapper-linux-x86-64 --out-dir bw-output make coverage
build-wrapper-linux-x86-64 --out-dir ${{ env.BUILD_WRAPPER_OUT_DIR }} make coverage
# sonar-scanner does not like utf8 filenames
- name: Prepare for Sonar
Expand All @@ -90,21 +94,11 @@ jobs:
distribution: 'temurin' # See 'Supported distributions' for available options
java-version: '17'

# The official sonarsource/sonarcloud-github-action@v1.5 action does not work properly.
# It keeps complaining that the build-wrapper.json cannot be found.
# Hence, use a third party action to download and add sonar-scanner to PATH and then run it manually.
- name: Setup sonarqube
uses: warchant/setup-sonar-scanner@v6

- name: Run sonarqube
- name: Run sonar-scanner
working-directory: ${{github.workspace}}/build
env:
# to get access to secrets.SONAR_TOKEN, provide GITHUB_TOKEN
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: sonar-scanner
-Dsonar.login=${{ secrets.SONAR_TOKEN }}
-Dsonar.cfamily.build-wrapper-output=${{ github.workspace }}/build/bw-output
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
run: |
sonar-scanner --define sonar.cfamily.build-wrapper-output="${{ env.BUILD_WRAPPER_OUT_DIR }}"
-Dsonar.coverageReportPaths=build/coverage/sonarqube.report
-Dsonar.verbose=true
-Dsonar.host.url=https://sonarcloud.io/
-Dsonar.organization=fluidsynth
-Dsonar.projectKey=FluidSynth_fluidsynth
2 changes: 1 addition & 1 deletion sonar-project.properties
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
sonar.projectKey=FluidSynth_fluidsynth
sonar.organization=fluidsynth

sonar.cfamily.threads=4
sonar.cfamily.threads=2
sonar.cfamily.cache.enabled=false


Expand Down

0 comments on commit e959315

Please sign in to comment.