Merge pull request #163 from ckormanyos/add_image #270
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
# ------------------------------------------------------------------------------ | |
# 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: clone-submods-bootstrap-headers-boost-develop | |
run: | | |
git clone -b develop --depth 1 https://github.com/boostorg/boost.git ../boost-root | |
cd ../boost-root | |
git submodule update --init tools | |
git submodule update --init libs/array | |
git submodule update --init libs/assert | |
git submodule update --init libs/concept_check | |
git submodule update --init libs/config | |
git submodule update --init libs/container | |
git submodule update --init libs/container_hash | |
git submodule update --init libs/core | |
git submodule update --init libs/describe | |
git submodule update --init libs/detail | |
git submodule update --init libs/filesystem | |
git submodule update --init libs/functional | |
git submodule update --init libs/gil | |
git submodule update --init libs/integer | |
git submodule update --init libs/io | |
git submodule update --init libs/iterator | |
git submodule update --init libs/lexical_cast | |
git submodule update --init libs/move | |
git submodule update --init libs/mp11 | |
git submodule update --init libs/mpl | |
git submodule update --init libs/multiprecision | |
git submodule update --init libs/numeric/conversion | |
git submodule update --init libs/preprocessor | |
git submodule update --init libs/range | |
git submodule update --init libs/smart_ptr | |
git submodule update --init libs/static_assert | |
git submodule update --init libs/system | |
git submodule update --init libs/throw_exception | |
git submodule update --init libs/type_traits | |
git submodule update --init libs/utility | |
git submodule update --init libs/variant2 | |
./bootstrap.sh | |
./b2 headers | |
- 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 -fprofile-arcs -ftest-coverage -O1 -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 -DMANDELBROT_HAS_COVERAGE -Ijpeg/jpeg-6b-2022 -I../boost-root -pthread test/test_mandelbrot.cpp -o test_mandelbrot.o | |
${{ matrix.compiler }} -x none -finline-functions -march=native -mtune=native -fprofile-arcs -ftest-coverage -O1 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 }}/mandelbrot/.gcov/make/coverage.info | |
token: ${{ secrets.CODECOV_TOKEN }} | |
fail_ci_if_error: true | |
verbose: false |