name: Feature matrix

on:
  push:
  pull_request:

jobs:
  build:
    strategy:
      matrix:
        feature: ["-DWITH_SDL=OFF", "-DWITH_TTS=OFF", "-DWITH_BABEL=OFF", "-DSOUND=QT"]

    runs-on: ubuntu-20.04
    container:
      image: amd64/ubuntu:20.04
      options: --privileged

    env:
      CC: gcc-9
      CXX: g++-9

    steps:
      - name: Checkout
        uses: actions/checkout@v2

      - name: Update packages
        run: apt update

      - name: Install packages
        run: DEBIAN_FRONTEND=noninteractive apt install -y
          build-essential
          cmake
          git
          libfontconfig1-dev
          libfreetype-dev
          libjpeg-dev
          libmpg123-dev
          libopenmpt-dev
          libsdl2-mixer-dev
          libsndfile-dev
          libspeechd-dev
          qtbase5-dev
          qtbase5-dev-tools
          qtmultimedia5-dev

      - name: Configure
        run: |
          mkdir build
          cd build
          cmake .. -DCMAKE_INSTALL_PREFIX=/usr ${{ matrix.feature }} -DWITH_INTERPRETERS=OFF -DWITH_LAUNCHER=OFF

      - name: Build
        run: |
          cd build
          make -j`nproc`
          make install DESTDIR=/tmp/gargoyle
