name: Build on macOS
on:
  # Triggers the workflow on push or pull request events
  pull_request:
  # Allows you to run this workflow manually from the Actions tab
  workflow_dispatch:
    inputs:
      debug_enabled:
        description: 'Run the build with tmate debugging enabled (https://github.com/marketplace/actions/debugging-with-tmate)'
        required: false
        default: false

jobs:
  build:
    runs-on: macos-11
    steps:
      - name: Setup xcode
        uses: maxim-lobanov/setup-xcode@v1
        with:
          xcode-version: '12.4.0'
      - name: Install lemon
        run: |
          wget http://lemon.cs.elte.hu/pub/sources/lemon-1.3.1.tar.gz
          tar -xf lemon-1.3.1.tar.gz
          cd lemon-1.3.1
          cmake -B build .
          cmake --build build -j --target install
      - name: Install brew dependencies
        run: |
          brew install bison boost eigen flex git libomp pyqt5 python spdlog
          brew install swig tcl-tk zlib
      - name: Check out repository code
        uses: actions/checkout@v2
        with:
          submodules: 'recursive'
      - name: Build OpenROAD
        run: |
          export PATH="/usr/local/opt/bison/bin:$PATH"
          export PATH="/usr/local/opt/flex/bin:$PATH"
          export PATH="/usr/local/opt/tcl-tk/bin:$PATH"
          export PKG_CONFIG_PATH="/usr/local/opt/tcl-tk/lib/pkgconfig"
          export MY_QT_PATH=$(find /usr/local/Cellar/qt@5/ -type d -iwholename "*cmake/Qt5")
          echo "MY_QT_PATH = $MY_QT_PATH"
          mkdir build
          cd build
          cmake ..  -D TCL_LIB_PATHS=/usr/local/opt/tcl-tk/lib \
                    -D TCL_NO_DEFAULT_PATH=TRUE \
                    -D Qt5_DIR=${MY_QT_PATH}
          make -j
      # Enable tmate debugging of manually-triggered workflows
      # if the input option was provided
      - name: Setup tmate session
        uses: mxschmitt/action-tmate@v3
        if: ${{ github.event_name == 'workflow_dispatch' && github.event.inputs.debug_enabled }}

Add macOS action to build OR
Add macOS action to build OR

Signed-off-by: Vitor Bandeira <d423c7032fd7dc7038b71b75a63883f2acf13678@gmail.com>
