name: build

on:
  push:
    branches:
      - main

jobs:
  bsd:
    runs-on: ubuntu-latest
    name: Main build job
    steps:
    - uses: actions/checkout@v4
    - name: FreeBSD job
      id: test
      uses: vmactions/freebsd-vm@v1
      with:
        usesh: true
        sync: sshfs
        prepare: |
          pkg install -y git cmake gmake
        run: |
          mkdir build
          cd build
          cmake ..
          gmake all -j6
    - name: Collect outputs
      run: |
        mkdir _output
        cp build/bin/* _output
    - name: Upload
      uses: actions/upload-artifact@v4
      with:
        name: output_bsd
        path: _output