Skip to content

Commit

Permalink
Sonar: update version, enable coverage
Browse files Browse the repository at this point in the history
  • Loading branch information
bogdro authored Nov 20, 2023
1 parent 302d145 commit 4539184
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions .github/workflows/sonarcloud.yml
Original file line number Diff line number Diff line change
Expand Up @@ -50,8 +50,10 @@ jobs:
with:
fetch-depth: 0 # Shallow clones should be disabled for a better relevancy of analysis

- name: Install requirements
run: sudo apt-get -y install check
- name: Install sonar-scanner and build-wrapper
uses: SonarSource/sonarcloud-github-c-cpp@v1
uses: SonarSource/sonarcloud-github-c-cpp@v2
- name: Run build-wrapper
run: |
#autoreconf --install
Expand All @@ -60,13 +62,17 @@ jobs:
./configure
sleep 1
touch doc/libhideip.info
build-wrapper-linux-x86-64 --out-dir ${{ env.BUILD_WRAPPER_OUT_DIR }} make all
build-wrapper-linux-x86-64 --out-dir ${{ env.BUILD_WRAPPER_OUT_DIR }} make all check CFLAGS='-fprofile-abs-path --coverage -O0'
mkdir coverage-dir
cd coverage-dir
find .. -name '*.o' | xargs gcov --preserve-paths
cd ..
- name: Run sonar-scanner
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }} # Put the name of your token here
run: |
sonar-scanner -X --define sonar.sources=src --define sonar.projectKey=bogdro_libhideip --define sonar.organization=bogdro --define sonar.cfamily.cache.enabled=false --define sonar.cfamily.build-wrapper-output="${{ env.BUILD_WRAPPER_OUT_DIR }}"
sonar-scanner -X --define sonar.sources=src --define sonar.projectKey=bogdro_libhideip --define sonar.organization=bogdro --define sonar.cfamily.build-wrapper-output="${{ env.BUILD_WRAPPER_OUT_DIR }}" --define sonar.cfamily.gcov.reportsPath="coverage-dir"
#- name: Analyze with SonarCloud

Expand Down

0 comments on commit 4539184

Please sign in to comment.