name: macOS

on:
  push:
    branches:
      - main
  pull_request:

jobs:
  xcode:
    name: Build on MacOS
    runs-on: macos-latest
    steps:
      - uses: actions/checkout@v2
      - uses: maxim-lobanov/setup-xcode@v1
        with:
          xcode-version: latest-stable
      - name: cmake
        run: cmake -S . -B build -D CMAKE_BUILD_TYPE=Release
      - name: build
        run: cmake --build build --parallel 2
      - name: test
        run: cd build && ctest -j 2 --output-on-failure