name: FreeBSD

on: [push, pull_request]

permissions:
  contents: read # to fetch code (actions/checkout)

concurrency:
  group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
  cancel-in-progress: true

jobs:
  test:
    runs-on: ubuntu-latest
    name: A job to run test in FreeBSD
    steps:
    - uses: actions/checkout@v4
      with:
        submodules: 'true'
    - name: Test in FreeBSD
      id: test
      uses: vmactions/freebsd-vm@v1
      with:
        usesh: true
        prepare: |
          pkg install -y cmake git ninja googletest

        run: |
          mkdir build
          cd build
          cmake .. -GNinja -DGOOGLE_TEST=ON
          ninja -v
          ./testxgboost
