name: freebsd-ci
on:
  push:
    branches:
      - master
  pull_request: {}

defaults:
  run:
    shell: bash

jobs:
  build:
    # This job intentionally is using macOS because at the time of the writing
    # Linux and Windows environments don't have the necessary virtualization features.
    # See https://github.com/vmactions/freebsd-vm#under-the-hood.
    runs-on: macos-latest
    steps:
    - uses: actions/checkout@v2.3.4
    - name: Test
      id: build-freebsd
      uses: vmactions/freebsd-vm@v0.1.4
      with:
        usesh: true
        mem: 4096
        prepare: pkg install -y ghc hs-cabal-install git
        # Virtual machine does not allow to leverage cache
        # and is quite slow, so only tests are run.
        run: |
          cabal update
          cabal test --test-show-details=direct
