name: freebsd_cmake

on:
  workflow_dispatch:

permissions:
  contents: read

jobs:
  freebsd_cmake:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v4
      - name: FreeBSD-with-cmake
        uses: cross-platform-actions/action@v0.23.0
        with:
          operating_system: freebsd
          sync_files: runner-to-vm
          version:  '14.0'
          run: |
            uname -a
            freebsd-version
            echo $SHELL
            sudo pkg install -y python3 bash cmake ninja pkgconf
            sudo pkg install -y gmake binutils lzlib zstd
            mkdir builddir && cd builddir
            cmake -G Ninja -DDO_TESTING=YES -DBUILD_NON_SHARED=YES -DBUILD_SHARED=NO -DBUILD_DWARFEXAMPLE=ON ../CMakeLists.txt
            ninja
            ninja test

