Merge pull request #97 from LedgerHQ/fix/LIVE-11792 (B2CA-1859) #351
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Sonarcloud | |
on: | |
push: | |
branches: | |
- master | |
- develop | |
pull_request: | |
jobs: | |
sonarcloud: | |
runs-on: ubuntu-latest | |
container: | |
image: ghcr.io/ledgerhq/ledger-app-builder/ledger-app-builder-legacy:latest | |
env: | |
BUILD_WRAPPER_OUT_DIR: build_wrapper_output_directory # Directory where build-wrapper output will be placed | |
steps: | |
- uses: actions/checkout@v3 | |
with: | |
# Disabling shallow clone is recommended for improving relevancy of reporting | |
fetch-depth: 0 | |
- name: Install dependencies | |
run: | | |
apt-get update -y | |
apt-get upgrade -y | |
DEBIAN_FRONTEND=noninteractive apt-get install -y tzdata | |
apt-get install -y libcmocka-dev gcovr unzip | |
- name: Install sonar-scanner and build-wrapper | |
uses: sonarsource/sonarcloud-github-c-cpp@v2 | |
- name: Generate code coverage | |
working-directory: libsol | |
run: | | |
make COVERAGE=1 | |
gcovr --root .. --sonarqube ../coverage.xml | |
- name: Run build-wrapper | |
run: | | |
build-wrapper-linux-x86-64 --out-dir ${{ env.BUILD_WRAPPER_OUT_DIR }} make clean all | |
- name: Run sonar-scanner | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }} | |
run: sonar-scanner --define sonar.cfamily.build-wrapper-output="${{ env.BUILD_WRAPPER_OUT_DIR }}" #Consult https://docs.sonarcloud.io/advanced-setup/ci-based-analysis/sonarscanner-cli/ for more information and options |