Skip to content

Try restoring sonar build #194

Try restoring sonar build

Try restoring sonar build #194

# ------------------------------------------------------------------------------
# Copyright Christopher Kormanyos 2022 - 2024.
# Distributed under the Boost Software License,
# Version 1.0. (See accompanying file LICENSE_1_0.txt
# or copy at http://www.boost.org/LICENSE_1_0.txt)
# ------------------------------------------------------------------------------
name: mandelbrot_codecov
on:
push:
branches:
- main
pull_request:
types: [opened, synchronize, reopened]
jobs:
gcc-gcov-native:
runs-on: ubuntu-latest
defaults:
run:
shell: bash
strategy:
fail-fast: false
matrix:
standard: [ c++14 ]
compiler: [ g++ ]
steps:
- uses: actions/checkout@v4
with:
fetch-depth: '0'
- name: update-tools
run: sudo apt install lcov
- name: install Boost
run: |
sudo apt-get update --quiet
sudo apt-get install --no-install-recommends --quiet --yes libboost-dev
- name: gcc-gcov-native
run: |
echo "query GCC version"
g++ -v
echo "build libjpeg"
cd jpeg
make all
cd ..
echo "build libpng"
cd png/libpng
make all
cd ../..
echo "build libz"
cd png/zlib
make all
cd ../..
mkdir -p images/tmp
echo "build and run gcov/lcov/genhtml"
${{ matrix.compiler }} -x c++ -c -finline-functions -march=native -mtune=native -O3 -Wall -Wextra -Wmissing-include-dirs -std=c++20 -I. -Ipng/zlib/zlib-1.3.1.1-2024 -Ipng/libpng/libpng-1.6.44.git-2024 -Ijpeg/jpeg-6b-2022 -I../boost-root -pthread test/test_mandelbrot.cpp -o test_mandelbrot.o
${{ matrix.compiler }} -x none test_mandelbrot.o ./png/libpng/libpng-1.6.44.git-2024/obj/libpng16.a ./png/zlib/zlib-1.3.1.1-2024/obj/libz.a ./jpeg/jpeg-6b-2022/obj/libjpeg-6b.a -lpthread -o test_mandelbrot.exe
./test_mandelbrot.exe
gcov --object-directory . --demangled-names ./test_mandelbrot.cpp
lcov -c --directory . --output-file coverage_unfiltered.info
lcov --remove coverage_unfiltered.info '/usr/*' '*boost/*' '*concurrency/*' '*/cfg/*' '*test_mandelbrot.cpp' '*mandelbrot_color.h' --output-file coverage.info
genhtml coverage.info --demangle-cpp --output-directory report
- name: upload-codecov
uses: codecov/codecov-action@v4
with:
plugin: gcov
file: ${{ runner.workspace }}/wide-integer/.gcov/make/coverage.info
token: ${{ secrets.CODECOV_TOKEN }}
fail_ci_if_error: true
verbose: false