diff --git a/.github/workflows/c.yaml b/.github/workflows/c.yaml index f96432d78..766e25518 100644 --- a/.github/workflows/c.yaml +++ b/.github/workflows/c.yaml @@ -197,38 +197,3 @@ jobs: cmake -G "${{ matrix.generator }}" -S c/test_package -B c/test_package/build -DCMAKE_PREFIX_PATH="${{ github.workspace }}/install" cmake --build c/test_package/build - codecov: - name: C Code Coverage - runs-on: ubuntu-22.04 - steps: - - uses: actions/checkout@v2 - with: - submodules: recursive - fetch-depth: 0 - - name: Install sonar-scanner and build-wrapper - uses: SonarSource/sonarcloud-github-c-cpp@v2 - - name: Setup - run: | - sudo apt-get install llvm -y - - name: Build and Run Tests - env: - CC: clang - CXX: clang++ - run: | - cmake -S c -B build -DCODE_COVERAGE=ON -DCMAKE_C_FLAGS=--coverage -DCMAKE_CXX_FLAGS=--coverage && - build-wrapper-linux-x86-64 --out-dir ./bw-output cmake --build build -j8 --target ccov-all-export - - name: Run sonar-scanner - uses: sonarsource/sonarcloud-github-action@master - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - SONAR_TOKEN: ${{ secrets.SONAR_TOKEN_C }} - with: - args: - -Dsonar.organization=swift-nav - -Dsonar.projectName=libsbp-c - -Dsonar.projectKey=swift-nav_libsbp_c - -Dsonar.verbose=true - -Dsonar.login=${{ secrets.SONAR_TOKEN_C }} - -Dsonar.cfamily.threads=4 - -Dsonar.cfamily.llvm-cov.reportPath=./build/ccov/coverage.txt - -Dsonar.cfamily.compile-commands=./build/compile_commands.json diff --git a/.github/workflows/sonarcloud.yml b/.github/workflows/sonarcloud.yml index b05cb8447..c62e4e39a 100644 --- a/.github/workflows/sonarcloud.yml +++ b/.github/workflows/sonarcloud.yml @@ -26,3 +26,42 @@ jobs: -Dsonar.exclusions=java/** -Dsonar.verbose=true -Dsonar.c.file.suffixes=- -Dsonar.cpp.file.suffixes=- + + C: + name: C Code Coverage + runs-on: ubuntu-22.04 + steps: + - uses: actions/checkout@v2 + with: + submodules: recursive + fetch-depth: 0 + - name: Install sonar-scanner and build-wrapper + uses: SonarSource/sonarcloud-github-c-cpp@v2 + - name: Setup + run: | + sudo apt-get install llvm -y + - name: Build and Run Tests + env: + CC: clang + CXX: clang++ + run: | + cmake -S c -B build -DCODE_COVERAGE=ON -DCMAKE_C_FLAGS=--coverage -DCMAKE_CXX_FLAGS=--coverage && + build-wrapper-linux-x86-64 --out-dir ./bw-output cmake --build build -j8 --target ccov-all-export + - name: Run sonar-scanner + uses: sonarsource/sonarcloud-github-action@master + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + SONAR_TOKEN: ${{ secrets.SONAR_TOKEN_C }} + with: + args: + -Dsonar.organization=swift-nav + -Dsonar.projectName=libsbp-c + -Dsonar.projectKey=swift-nav_libsbp_c + -Dsonar.verbose=true + -Dsonar.login=${{ secrets.SONAR_TOKEN_C }} + -Dsonar.cfamily.threads=4 + -Dsonar.cfamily.llvm-cov.reportPath=./build/ccov/coverage.txt + -Dsonar.cfamily.compile-commands=./build/compile_commands.json + -Dsonar.sources=c + -Dsonar.inclusions=c/src/**/*,c/include/**/* + -Dsonar.exclusions=c/text/**/*