on:
  pull_request:
    types: [opened, synchronize, reopened]

  push:
    branches:
      - 'master'

jobs:
  actions:
    strategy:
      matrix:
        - version: [9.6, 9.4, 8]

    runs-on: docker
    container:
      image: haskell:${{ matrix.version }}

    steps:
      - name: apt ${{ matrix.version }}
        run: |
          apt-get update
          apt-get install -y xorg-dev libxrandr-dev libpango1.0-dev
          apt-get install -y libasound2-dev libxpm-dev libmpd-dev
          apt-get install -y hspec-discover hlint
      - name: hlint ${{ matrix.version }}
        run: hlint ./src
      - name: cabal tests ${{ matrix.version }}
        run: |
          cabal update
          cabal test --enable-tests -fall_extensions
          cabal test --enable-tests -fall_extensions -f-with_xrender
