name: MacOS

on:
  push:
  pull_request:
  workflow_dispatch:

jobs:
  build:
    runs-on: macos-latest
    steps:
      - uses: actions/checkout@v4

      - name: "Setup python"
        uses: actions/setup-python@v4
        with:
          python-version: '3.x'

      - name: "Setup flex, bison"
        run: |
          brew install flex bison
          echo "/usr/local/opt/flex/bin" >> $GITHUB_PATH
          echo "/usr/local/opt/bison/bin" >> $GITHUB_PATH

      - name: "Setup cmake"
        run: cmake --version

      - name: "Setup gil"
        run: |
          pip3 install gil
          gil update

      - name: "Build"
        run: |
          cd build
          ./unix.sh
