Skip to content

👷 Test with different environments #81

👷 Test with different environments

👷 Test with different environments #81

Workflow file for this run

on:
pull_request:
push:
branches:
- master
- main
- develop
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
ctest:
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [ ubuntu-latest ]
compiler:
- g++-11
- g++-12
- g++-13
- clang++-12
- clang++-13
- clang++-14
- clang++-15
std:
- 11
- 14
- 17
- 20
- 23
stdlib:
- libstdc++
- libc++
generator: [ Ninja ]
exclude:
- os: ubuntu-latest
compiler: g++-13
- compiler: clang++-12
stdlib: libc++
- compiler: clang++-13
stdlib: libc++
- compiler: clang++-15
stdlib: libc++
include:
- os: ubuntu-latest
compiler: g++
coverage: true
generator: Ninja
- os: windows-latest
- os: macos-latest
steps:
- uses: actions/checkout@v4
with:
submodules: 'recursive'
- name: Setup Ninja
if: ${{ matrix.generator == 'Ninja' }}
uses: seanmiddleditch/gha-setup-ninja@v4
- name: Setup Depenedencies
if: ${{ startsWith(matrix.os, 'ubuntu') }}
shell: bash
run: |
sudo apt-get update
sudo apt-get install -y ${{ matrix.compiler }}
- uses: actions/cache@v4
with:
path: build/_deps/*-src
key: cmake-dependency-src-${{ hashFiles('**/CMakeLists.txt') }}
restore-keys: |
cmake-dependency-src-
- uses: actions/cache@v4
with:
path: |
build/_deps/*-build
build/_deps/*-subbuild
key: cmake-dependency-builds-${{ runner.os }}-${{ matrix.compiler }}-${{ matrix.std }}-${{ hashFiles('**/CMakeLists.txt') }}
restore-keys: |
cmake-dependency-builds-${{ runner.os }}-${{ matrix.compiler }}-
cmake-dependency-builds-${{ runner.os }}-
- name: Configure and Build Project
uses: threeal/[email protected]
with:
run-build: true
args: >-
-DCMAKE_BUILD_TYPE=Debug
-DCMAKE_VERBOSE_MAKEFILE=ON
-DENABLE_COVERAGE=${{ matrix.coverage == true && 'ON' || 'OFF' }}
${{ matrix.std && format('-DCMAKE_CXX_STANDARD={0}', matrix.std) || '' }}
cxx-compiler: ${{ matrix.compiler }}
cxx-flags: >-
${{ matrix.std && format('-std=c++{0}', matrix.std) || '' }}
${{ matrix.stdlib && format('-stdlib={0}', matrix.stdlib) || '' }}
- name: Test Project
uses: threeal/[email protected]
with:
build-config: Debug
- name: Check Coverage
if: ${{ matrix.coverage == true }}
uses: threeal/gcovr-action@xml-out
with:
xml-out: './build/coverage.xml'
coveralls-out: './build/coveralls.json'
excludes: |
build/*
test/*
- name: Upload coverage reports to Codecov
if: ${{ matrix.coverage == true }}
uses: codecov/codecov-action@v4
env:
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
with:
fail_ci_if_error: true
files: ./build/coverage.xml
disable_search: true