name: compile_mac

on: [push]

env:
  BUILD_TYPE: Release

jobs:
  compile_mac:
    runs-on: macos-latest

    steps:
    - name: Checkout_git
      uses: actions/checkout@v2
      with:
        # We must fetch at least the immediate parents so that if this is
        # a pull request then we can checkout the head.
        fetch-depth: 15
    - name: install_packages
      run: |
           export PATH=$PATH:/usr/local/opt/gettext/bin
           export HOMEBREW_NO_AUTO_UPDATE=1
           set -e
           brew upgrade cmake
           brew install gettext libomp ninja pandoc wxwidgets
           brew link cmake
           set +e
    - name: configure
      run: |
           export CXXFLAGS="-Wall -Wextra -ansi -std=c++11"
           export LANG=en_US.UTF-8
           mkdir build
           touch build build/build.ninja
           cd build
           cmake -G "Ninja" -DCMAKE_UNITY_BUILD=YES -DCMAKE_BUILD_TYPE=debug -DCMAKE_UNITY_BUILD_BATCH_SIZE=8 -DWXM_UNIT_TESTS=YES ..
           cd ..
    - name: compile
      run: |
           cd build
           cmake --build .
           cd ..
