Skip to content

Upgrade to lcov 2.5 #2124

Upgrade to lcov 2.5

Upgrade to lcov 2.5 #2124

Workflow file for this run

#
# Copyright 2023 Antony Peacock
#
# Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated
# documentation files (the "Software"), to deal in the Software without restriction, including without limitation the
# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit
# persons to whom the Software is furnished to do so, subject to the following conditions:
#
# The above copyright notice and this permission notice shall be included in all copies or substantial portions of the
# Software.
#
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
# WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
# COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
# OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
#
name: Code Coverage
on:
schedule:
- cron: "0 2 * * *" # Every day at 02:00 UTC
push:
branches: [main]
pull_request:
branches: [main]
env:
LCOV_VERSION: 2.5
jobs:
build:
runs-on: ${{ matrix.settings.os }}
strategy:
matrix:
configuration: [ "Debug" ]
settings:
- {
os: ubuntu-latest,
compiler: { type: GCC, version: 14, conan: "gcc", cc: "gcc-14", cxx: "g++-14", std: 23 },
lib: "libstdc++11"
}
steps:
- uses: actions/checkout@v6.0.2
- name: Install Latest GCC
shell: bash
run: |
sudo apt install -y g++-${{ matrix.settings.compiler.version }}
sudo rm -f /usr/bin/gcc /usr/bin/g++ /usr/bin/gcov
sudo ln -s /usr/bin/gcov-${{ matrix.settings.compiler.version }} /usr/bin/gcov
sudo ln -s /usr/bin/gcc-${{ matrix.settings.compiler.version }} /usr/bin/gcc
sudo ln -s /usr/bin/g++-${{ matrix.settings.compiler.version }} /usr/bin/g++
- name: Setup Python
uses: ./.github/actions/setup-python
- name: Install Sphinx
run: |
sudo apt-get install -y python3-sphinx python3-sphinx-rtd-theme
- name: Install Lcov
shell: bash
run: |
wget https://github.com/linux-test-project/lcov/archive/refs/tags/v${{ env.LCOV_VERSION }}.tar.gz
tar -xvf v${{ env.LCOV_VERSION }}.tar.gz
cd lcov-${{ env.LCOV_VERSION }} && sudo make install && cd ..
sudo perl -MCPAN -e 'install Capture::Tiny'
sudo apt-get install -y libdatetime-perl
- name: Cache Conan Restore
uses: ./.github/actions/conan-cache-restore
with:
os: ${{ matrix.settings.os }}
build-type: ${{ matrix.configuration }}
conan-compiler: ${{ matrix.settings.compiler.conan }}
compiler-version: ${{ matrix.settings.compiler.version }}
stdlib: ${{ matrix.settings.lib }}
- name: Setup Conan
uses: ./.github/actions/setup-conan
with:
build-type: ${{ matrix.configuration }}
compiler-type: ${{ matrix.settings.compiler.type }}
compiler-version: ${{ matrix.settings.compiler.version }}
conan-compiler: ${{ matrix.settings.compiler.conan }}
stdlib: ${{ matrix.settings.lib }}
cppstd: ${{ matrix.settings.compiler.std }}
- name: Conan Install
shell: bash
run: |
conan install "${{ github.workspace }}" --build missing
- name: Configure CMake
shell: bash
run: |
if [ -f build/generators/conanbuild.sh ]; then
source build/generators/conanbuild.sh
fi
cmake --preset ${{ env.CONAN_CONFIGURE_PRESET }} -DENABLE_CODE_COVERAGE=1
- name: Build
shell: bash
run: |
if [ -f build/generators/conanbuild.sh ]; then
source build/generators/conanbuild.sh
fi
cmake --build --preset ${{ env.CONAN_BUILD_PRESET }}
- name: Test
shell: bash
run: |
if [ -f build/generators/conanbuild.sh ]; then
source build/generators/conanbuild.sh
fi
ctest --preset ${{ env.CONAN_BUILD_PRESET }} --rerun-failed --output-on-failure
- name: Generate Coverage Reports
shell: bash
run: |
if [ -f build/generators/conanbuild.sh ]; then
source build/generators/conanbuild.sh
fi
cmake --build --preset ${{ env.CONAN_BUILD_PRESET }} --target coverage
cmake --build --preset ${{ env.CONAN_BUILD_PRESET }} --target coverage-lcov
cmake --build --preset ${{ env.CONAN_BUILD_PRESET }} --target coverage-cobertura
- name: Upload coverage to Codecov
uses: codecov/codecov-action@v7.0.0
env:
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
with:
files: ${{ github.workspace }}/build/${{ matrix.configuration }}/coverage/cobertura_coverage.xml
fail_ci_if_error: true
verbose: true
- name: Cache Conan Save
uses: ./.github/actions/conan-cache-save