Skip to content

chore(deps): update actions/checkout action to v6 #5

chore(deps): update actions/checkout action to v6

chore(deps): update actions/checkout action to v6 #5

Workflow file for this run

name: BuildAndTest
on:
# push:
# paths-ignore:
# - 'README.md'
# - '.gitignore'
# - 'LICENSE'
pull_request:
paths-ignore:
- 'README.md'
- '.gitignore'
- 'LICENSE'
jobs:
build:
strategy:
matrix:
include:
- os: ubuntu-latest
type: Debug
cxx: gcc
- os: ubuntu-latest
type: Release
cxx: gcc
coverage: -DCMAKE_CXX_FLAGS=--coverage
- os: ubuntu-latest
type: Debug
cxx: clang
- os: ubuntu-latest
type: Release
cxx: clang
- os: windows-latest
type: Debug
- os: windows-latest
type: Release
- os: macos-latest
type: Debug
- os: macos-latest
type: Release
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v6
- name: install build tools (gcc)
run: |
sudo apt install g++-11 -y
echo "CC=gcc-11" >> $GITHUB_ENV
echo "CXX=g++-11" >> $GITHUB_ENV
sudo update-alternatives --install /usr/bin/gcov gcov /usr/bin/gcov-11 90
if: ${{ startsWith(matrix.os, 'ubuntu') && matrix.cxx == 'gcc' }}
- name: install build tools (clang)
run: |
sudo apt install clang-12 -y
sudo rm -rf /usr/lib/gcc/x86_64-linux-gnu/11 /usr/include/c++/11
echo "CC=clang-12" >> $GITHUB_ENV
echo "CXX=clang++-12" >> $GITHUB_ENV
if: ${{ startsWith(matrix.os, 'ubuntu') && matrix.cxx == 'clang' }}
- name: enable compatibility test (linux)
run: echo "COMPATIBILITY=-DENABLE_COMPATIBILITY_TEST=ON" >> $GITHUB_ENV
if: ${{ startsWith(matrix.os, 'ubuntu') }}
- name: install benchmark deps
run: |
sudo apt install libbenchmark-dev -y
echo "BENCHMARK=-DENABLE_BENCHMARK=ON" >> $GITHUB_ENV
if: ${{ startsWith(matrix.os, 'ubuntu') && matrix.type == 'Release' }}
- name: install build tools (mac)
run: |
echo "CC=`which gcc-11`" >> $GITHUB_ENV
echo "CXX=`which g++-11`" >> $GITHUB_ENV
if: ${{ startsWith(matrix.os, 'macos') }}
- name: install benchmark deps (mac)
run: |
brew install google-benchmark
if: ${{ startsWith(matrix.os, 'macos') && matrix.type == 'Release' }}
- name: install benchmark deps (windows)
run: |
vcpkg install benchmark:x64-windows
echo "BENCHMARK=-DENABLE_BENCHMARK=ON" >> $Env:GITHUB_ENV
if: ${{ startsWith(matrix.os, 'windows') && matrix.type == 'Release' }}
- name: install coverage tools
run: sudo apt install lcov -y
if: ${{ matrix.coverage }}
- name: generate build script
run: cmake $BENCHMARK $COMPATIBILITY -DCMAKE_BUILD_TYPE=${{ matrix.type }} ${{ matrix.coverage }} .
if: ${{ !startsWith(matrix.os, 'windows') }}
- name: generate build script
run: cmake $Env:BENCHMARK $Env:COMPATIBILITY -DCMAKE_TOOLCHAIN_FILE="$Env:VCPKG_INSTALLATION_ROOT\scripts\buildsystems\vcpkg.cmake" -DCMAKE_BUILD_TYPE=${{ matrix.type }} ${{ matrix.coverage }} .
if: ${{ startsWith(matrix.os, 'windows') }}
- name: build project
run: cmake --build . --config ${{ matrix.type }}
- name: run unit testing
run: ctest
- name: capture coverage
run: lcov --directory . --capture --output-file coverage.info
if: ${{ matrix.coverage }}
- name: upload coverage
uses: codecov/codecov-action@v5
with:
file: ./coverage.info
if: ${{ matrix.coverage }}