Skip to content

Feature/fix appveyor #269

Feature/fix appveyor

Feature/fix appveyor #269

Workflow file for this run

name: SonarCloud
on:
push:
branches:
- main
- develop
pull_request:
types: [opened, synchronize, reopened]
workflow_dispatch:
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
sonarcloud:
name: SonarCloud
runs-on: ubuntu-latest
env:
BUILD_WRAPPER_OUT_DIR: build_wrapper_output_directory # Directory where build-wrapper output will be placed
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Setup
run: |
sudo apt update
sudo apt-get install build-essential automake autoconf autoconf-archive texinfo libtool-bin yasm ninja-build ccache lcov
- name: Setup GCC
uses: pkgxdev/setup@v2
with:
+: gcc@14
- run: gcc --version
- name: Install sonar-scanner and build-wrapper
uses: sonarsource/sonarcloud-github-c-cpp@v3
- name: Restore artifacts or setup vcpkg
uses: lukka/run-vcpkg@v11
with:
vcpkgGitCommitId: ${{ vars.VCPKG_GIT_COMMIT_ID }}
- name: Configure
run: cmake -G Ninja -D CMAKE_BUILD_TYPE=RelWithDebInfo -D ENABLE_TESTING:BOOL=TRUE -D ENABLE_COVERAGE:BOOL=TRUE -S . -B build
- name: Build
run: build-wrapper-linux-x86-64 --out-dir ${{ env.BUILD_WRAPPER_OUT_DIR }} cmake --build build
- name: Test
working-directory: build
continue-on-error: true
run: ctest --rerun-failed --output-on-failure -j 2
- name: Generate coverage info
working-directory: build
continue-on-error: true
run: |
mkdir gcov-reports
pushd gcov-reports
for f in `find ../tests/CMakeFiles/CDT_test.dir -name '*.o'`; do
echo "Processing $f file..."
gcov -o ${f} x
done
ls | wc -l
popd
- name: Run sonar-scanner
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # Needed to get PR info, if any
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
run: sonar-scanner --define sonar.cfamily.build-wrapper-output="${{ env.BUILD_WRAPPER_OUT_DIR }}"