name: Build

on: [push]

jobs:

  LinuxCuda:
    runs-on: ubuntu-latest
    container: stitchem/stitchem:latest
    steps:
    - uses: actions/checkout@v1
    - name: CMake
      run: mkdir ../build && cd ../build && cmake -DCMAKE_BUILD_TYPE=Release -DRTMP_NVENC=OFF -DCUDA_TARGET_ARCH="50" -DGPU_BACKEND_CUDA=ON -DGPU_BACKEND_OPENCL=OFF -DDISABLE_OPENCL_SPIR=ON -G Ninja ../stitchEm
    - name: Build
      run: cd ../build && ninja

  LinuxOpenCL:
    runs-on: ubuntu-latest
    container: stitchem/stitchem:latest
    steps:
    - uses: actions/checkout@v1
    - name: CMake
      run: mkdir ../build && cd ../build && cmake -DCMAKE_BUILD_TYPE=Release -DGPU_BACKEND_CUDA=OFF -DGPU_BACKEND_OPENCL=ON -DDISABLE_OPENCL_SPIR=ON -G Ninja ../stitchEm
    - name: Build
      run: cd ../build && ninja

  MacOpenCL:
    runs-on: macos-latest
    steps:
    - uses: actions/checkout@v1
    - name: Deps
      run: brew install bison ceres-solver CMake doxygen faac faad2 ffmpeg glew glfw glm jpeg libpng libtiff ninja opencv qt yasm
    - name: CMake
      run: mkdir build && cd build && PATH="/usr/local/opt/bison/bin:${PATH}" cmake -DCREATE_BOX_PACKAGE=OFF -DGPU_BACKEND_CUDA=OFF -DGPU_BACKEND_OPENCL=ON -DMACPORTS=OFF -DQt5_DIR=/usr/local/opt/qt/lib/cmake/Qt5 -G Ninja ..
    - name: Build
      run: cd build && ninja

  WindowsCuda:
    runs-on: windows-latest
    steps:
      - uses: actions/checkout@v1
