name: ghactions-ci-build
on: [pull_request, push]

jobs:
  cmake-msvc2019:
    timeout-minutes: 2
    runs-on: windows-2019
    steps:
    - name: Checkout
      uses: actions/checkout@v2
      with:
        fetch-depth: 10

    - name: Create build dir
      shell: cmd
      run: mkdir build

    - name: Configure
      working-directory: build
      shell: cmd
      run: cmake -G"Visual Studio 16 2019" ..

    - name: Build
      working-directory: build
      shell: cmd
      run: cmake --build . --config Release --parallel 4

    - name: Test
      working-directory: build
      shell: cmd
      run: ctest --output-on-failure --parallel 4

  cmake-ubuntu:
    timeout-minutes: 2
    runs-on: ubuntu-latest
    steps:
      - name: Checkout
        uses: actions/checkout@v2
        with:
          fetch-depth: 10

      - name: Create build dir
        shell: bash
        run: mkdir build

      - name: Configure
        working-directory: build
        shell: bash
        run: cmake -DCMAKE_BUILD_TYPE=Release ..

      - name: Build
        working-directory: build
        shell: bash
        run: cmake --build . --config Release --parallel 4

      - name: Test
        working-directory: build
        shell: bash
        run: ctest --output-on-failure --parallel 4

  cmake-macos:
    timeout-minutes: 2
    runs-on: macos-latest
    steps:
      - name: Checkout
        uses: actions/checkout@v2
        with:
          fetch-depth: 10

      - name: Create build dir
        shell: bash
        run: mkdir build

      - name: Configure
        working-directory: build
        shell: bash
        run: cmake -DCMAKE_BUILD_TYPE=Release ..

      - name: Build
        working-directory: build
        shell: bash
        run: cmake --build . --config Release --parallel 4

      - name: Test
        working-directory: build
        shell: bash
        run: ctest --output-on-failure --parallel 4

Add GitHub Actions CI build and test for Ubuntu, macOS and MSVC 2019
Add GitHub Actions CI build and test for Ubuntu, macOS and MSVC 2019
