Skip to content

Introduce code coverage support #1

Introduce code coverage support

Introduce code coverage support #1

Workflow file for this run

name: Coverage
on:
push:
branches: [main]
pull_request:
branches: [main]
jobs:
job:
name: ${{ matrix.platform }}
runs-on: ${{ matrix.run-on }}
strategy:
fail-fast: false
matrix:
run-on: [ubuntu-latest]
include:
- run-on: ubuntu-latest
triplet: x64-linux-release
platform: linux
env:
VCPKG_DEFAULT_TRIPLET: ${{ matrix.triplet }}
VCPKG_GIT_COMMIT_ID: "f6a5d4e8eb7476b8d7fc12a56dff300c1c986131"
steps:
- name: Install gcc-13
run: |
wget --no-verbose http://kayari.org/gcc-latest/gcc-latest_13.0.1-20230326git55bc61a75a68.deb
sudo dpkg -i gcc-latest_13.0.1-20230326git55bc61a75a68.deb
echo "/opt/gcc-latest/bin" >> $GITHUB_PATH
echo "LD_RUN_PATH=/opt/gcc-latest/lib64" >> $GITHUB_ENV
- name: Install clang-17(dev)
run: |
wget -O - https://apt.llvm.org/llvm-snapshot.gpg.key | sudo apt-key add -
sudo add-apt-repository 'deb http://apt.llvm.org/jammy/ llvm-toolchain-jammy main'
sudo apt update
sudo apt install clang-17 llvm-17-dev
echo "CC=clang-17" >> $GITHUB_ENV
echo "CXX=clang++-17" >> $GITHUB_ENV
echo "CFLAGS=--gcc-toolchain=/opt/gcc-latest" >> $GITHUB_ENV
echo "CXXFLAGS=--gcc-toolchain=/opt/gcc-latest" >> $GITHUB_ENV
- uses: actions/checkout@v3
- uses: lukka/get-cmake@latest
with:
cmakeVersion: "~3.25.0"
ninjaVersion: "^1.11.1"
- name: Setup vcpkg
uses: lukka/run-vcpkg@v11
with:
vcpkgGitCommitId: "${{ env.VCPKG_GIT_COMMIT_ID }}"
- name: Build & Test project
uses: lukka/run-cmake@v10
with:
configurePreset: "ci"
configurePresetAdditionalArgs: "['-DCMAKE_BUILD_TYPE=Debug', '-DVCPKG_TARGET_TRIPLET=${{ matrix.triplet }}', '-DLLVM_DIR=/usr/lib/llvm-17/lib/cmake/llvm/']"
buildPreset: "ci"
testPreset: "ci"
- name: Coverage Report
run: ninja code_coverage_report
- name: Coverage Export
run: ninja code_coverage_export_lcov
- name: Upload coverage reports to Codecov
uses: codecov/codecov-action@v3
with:
token: ${{ secrets.CODECOV_TOKEN }}
files: coverage.info