name: No-Exceptions

on:
  push:
    paths-ignore:
      - 'README.md'
      - 'doc/**'
  pull_request:
    paths-ignore:
      - 'README.md'
      - 'doc/**'

jobs:
  no-exceptions:
    strategy:
      fail-fast: false
      matrix:
        compiler: [g++, clang++]
        build_type: [Debug, Release]

    runs-on: ubuntu-latest

    env:
      CXX: ${{ matrix.compiler }}

    steps:
    - uses: actions/checkout@v2

    - run: cmake -E make_directory build

    - working-directory: build/
      run: cmake $GITHUB_WORKSPACE -DCMAKE_BUILD_TYPE=${{ matrix.build_type }} -DCMAKE_CXX_FLAGS="-fno-exceptions"

    - working-directory: build/
      run: cmake --build .

    - working-directory: build/
      run: ctest --output-on-failure
