Skip to content

C++ CI

C++ CI #1203

Workflow file for this run

name: C++ CI
on:
schedule:
- cron: '0 0 * * *'
push:
branches: [ main ]
tags: [ 'v[0-9]+.[0-9]+.[0-9]+' ]
pull_request:
branches: [ main ]
workflow_dispatch:
jobs:
test:
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ windows-latest, macos-latest, ubuntu-latest ]
env:
CTEST_OUTPUT_ON_FAILURE: 1
steps:
- uses: actions/checkout@v3
- name: Install dependencies on ubuntu
if: startsWith(matrix.os, 'ubuntu')
run: |
git clone https://github.com/microsoft/vcpkg build/vcpkg
./build/vcpkg/bootstrap-vcpkg.sh
- name: Install dependencies on macos
if: startsWith(matrix.os, 'macos')
run: |
brew install pkg-config
git clone https://github.com/microsoft/vcpkg build/vcpkg
./build/vcpkg/bootstrap-vcpkg.sh
- name: Install dependencies on windows
if: startsWith(matrix.os, 'windows')
run: |
git clone https://github.com/microsoft/vcpkg build/vcpkg
.\build\vcpkg\bootstrap-vcpkg.bat
- name: Build
shell: bash
run: |
cmake -S . -B build -DCMAKE_TOOLCHAIN_FILE=./build/vcpkg/scripts/buildsystems/vcpkg.cmake
cmake --build build --parallel 4
- name: Test
working-directory: build
run: ctest -j4
coverage:
needs: [ test ]
runs-on: ubuntu-latest
env:
CXXFLAGS: "--coverage -fno-inline"
steps:
- uses: actions/checkout@v3
- name: Install dependencies
run: |
git clone https://github.com/microsoft/vcpkg build/vcpkg
./build/vcpkg/bootstrap-vcpkg.sh
- name: Build
shell: bash
run: |
cmake -S . -B build -DCMAKE_TOOLCHAIN_FILE=./build/vcpkg/scripts/buildsystems/vcpkg.cmake
cmake --build build --parallel 4
- name: Test
working-directory: build
run: ctest -j4
- name: lcov
working-directory: build
run: |
sudo apt install lcov
lcov -c -d . -o cov.info
lcov --remove cov.info */test/* --output-file cov.info
lcov -l cov.info
- name: codecov
working-directory: build
shell: bash
run: bash <(curl -s https://codecov.io/bash) -f cov.info