Skip to content

More ranges

More ranges #204

Workflow file for this run

name: SonarCloud
on: [push, pull_request, workflow_dispatch]
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@v3
with:
fetch-depth: 0
- name: Setup Java
uses: actions/setup-java@v3
with:
distribution: 'oracle'
java-version: '17'
- name: Setup GCC
uses: egor-tensin/setup-gcc@v1
with:
version: 11
platform: x64
- 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: Install sonar-scanner and build-wrapper
uses: sonarsource/sonarcloud-github-c-cpp@v1
- name: Restore artifacts or setup vcpkg
uses: lukka/run-vcpkg@v11
with:
vcpkgGitCommitId: c6d6efed3e9b4242765bfe1b5c5befffd85f7b92
- 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 }}"