name: Windows (Cygwin)

on:
  push:
  pull_request:
  workflow_dispatch:

jobs:
  build:
    runs-on: windows-latest
    defaults:
      run:
        shell: C:\cygwin\bin\bash.exe --login -o igncr {0}
    steps:
      - name: "Setup git"
        shell: cmd
        run: git config --global core.autocrlf input

      - uses: actions/checkout@v4

      - name: "Setup Cygwin"
        uses: cygwin/cygwin-install-action@v2
        with:
          check-sig: false
          platform: x86_64
          packages: automake make cmake gcc-g++ doxygen graphviz libssl-devel libuuid-devel flex bison

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

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

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