Skip to content

Merge pull request #60 from ckormanyos/nightly_build #52

Merge pull request #60 from ckormanyos/nightly_build

Merge pull request #60 from ckormanyos/nightly_build #52

# ------------------------------------------------------------------------------
# Copyright Christopher Kormanyos 2022.
# 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-20.04
defaults:
run:
shell: bash
strategy:
fail-fast: false
matrix:
standard: [ c++14 ]
compiler: [ g++ ]
steps:
- uses: actions/checkout@v3
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-6b.a"
cd jpeg
make all
cd ..
echo "build and run gcov/lcov/genhtml"
${{ matrix.compiler }} -x c++ -c -mtune=native -march=native -O2 -Wall -Wextra -std=${{ matrix.standard }} -fno-inline-functions -fprofile-arcs -ftest-coverage -DMANDELBROT_HAS_COVERAGE -I. -Ijpeg/jpeg-6b-2022 -pthread test/test_mandelbrot.cpp -o test_mandelbrot.o
${{ matrix.compiler }} -mtune=native -march=native -O2 -Wall -Wextra -std=${{ matrix.standard }} -fno-inline-functions -fprofile-arcs -ftest-coverage test_mandelbrot.o -lpthread -ljpeg-6b -Ljpeg/jpeg-6b-2022/obj -o test_mandelbrot.exe
mkdir -p images/tmp
./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@v2
with:
files: ./coverage.info
token: ${{ secrets.CODECOV_TOKEN }}
fail_ci_if_error: true
functionalities: fix