name: Testing

on:
  push:
  pull_request:

jobs:
  build:
    runs-on: ${{ matrix.os }}
    strategy:
      matrix:
        os: [ubuntu-latest, macos-latest, windows-latest]
    defaults:
      run:
        shell: bash -l {0}

    steps:
    - uses: actions/checkout@v2

    - name: Configure
      run: |
        cmake -S. -Bbuild -DCMAKE_BUILD_TYPE=Debug

    - name: Build
      run: |
        cmake --build build --config Debug

    - name: Test
      run: |
        cd build
        ctest -C Debug --output-on-failure --verbose

    - name: Setup python
      uses: actions/setup-python@v2
      with:
        python-version: 3.8

    - name: Upload code coverage to coveralls
      if: contains(matrix.os, 'ubuntu')
      env:
        COVERALLS_REPO_TOKEN: ${{ secrets.COVERALLS_REPO_TOKEN }}
      run: |
        python -m venv foo
        source foo/bin/activate
        pip install --upgrade pip setuptools cpp-coveralls
        coveralls -E ".*CMakeFiles.*" -E ".*test/.*.cpp.*" --exclude "foo" --exclude "build/_deps"

name: Testing

on:
  push:
  pull_request:

jobs:
  build:
    runs-on: ${{ matrix.os }}
    strategy:
      matrix:
        os: [ubuntu-latest, macos-latest, windows-latest]
    defaults:
      run:
        shell: bash -l {0}

    steps:
    - uses: actions/checkout@v2

    - name: Configure
      run: |
        cmake -S. -Bbuild -DCMAKE_BUILD_TYPE=Debug

    - name: Build
      run: |
        cmake --build build --config Debug

    - name: Test
      run: |
        cd build
        ctest -C Debug --output-on-failure --verbose

    - name: Setup python
      uses: actions/setup-python@v2
      if: contains(matrix.os, 'ubuntu')
      with:
        python-version: 3.8

    - name: Upload code coverage to coveralls
      if: contains(matrix.os, 'ubuntu')
      env:
        COVERALLS_REPO_TOKEN: ${{ secrets.COVERALLS_REPO_TOKEN }}
      run: |
        python -m venv foo
        source foo/bin/activate
        pip install --upgrade pip setuptools cpp-coveralls
        coveralls -E ".*CMakeFiles.*" -E ".*test/.*.cpp.*" --exclude "foo" --exclude "build/_deps"

Set up Python only on Ubuntu
Set up Python only on Ubuntu
