name: Check build

on:
  push:
    branches:
      - master
    
  pull_request:
    branches:
      - master

  schedule:
    - cron: '0 0 * * *'
  
jobs:
  archlinux:
    name: on Archlinux
    runs-on: ubuntu-20.04
    container: docker.io/library/archlinux:latest
    steps:
      - name: Checkout ukui-media source code
        uses: actions/checkout@v2
      - name: Refresh pacman repository
        run: pacman -Sy
      - name: Install build dependencies
        run: pacman -S --noconfirm base-devel gsettings-qt libmatemixer libqtxdg mate-desktop qt5-svg autoconf-archive intltool mate-common qt5-tools qt5-multimedia qt5-svg libqtxdg libxml2 kwindowsystem
      - name: Configure & Make
        run: |
          ./autogen.sh;
          ./configure;
          make -j$(nproc);
          cd ukui-volume-control-applet-qt;
          qmake .;
          make -j$(nproc);

  debian:
    name: on Debian Sid
    runs-on: ubuntu-20.04
    container: docker.io/library/debian:sid
    env:
      DEBIAN_FRONTEND: noninteractive
    steps:
      - name: Checkout ukui-media source code
        uses: actions/checkout@v2
      - name: Update apt repository
        run: apt-get update -y
      - name: Install build dependcies
        run: apt-get install -y build-essential qt5-default qttools5-dev-tools intltool qtbase5-dev libcanberra-gtk3-dev libgsettings-qt-dev libglib2.0-dev libgtk-3-dev libmate-desktop-dev libmatemixer-dev libxml2-dev mate-common libqt5svg5-dev libqt5xdg-dev libqt5multimedia5-plugins qtmultimedia5-dev libkf5windowsystem-dev
      - name: Configure & Make
        run: |
          ./autogen.sh;
          ./configure;
          make -j$(nproc);
          cd ukui-volume-control-applet-qt;
          qmake .;
          make -j$(nproc);
  
  fedora:
    name: on Fedora 32
    runs-on: ubuntu-20.04
    container: docker.io/library/fedora:32
    steps:
      - name: Checkout ukui-media source code
        uses: actions/checkout@v2
      - name: Install build dependencies
        run: dnf install -y make gcc gcc-c++ which cmake cmake-rpm-macros autoconf automake intltool rpm-build qt5-devel qt5-rpm-macros qt5-qtbase-devel qt5-qttools-devel qt5-qtbase-devel libcanberra-devel gsettings-qt-devel glib2-devel gtk3-devel mate-desktop-devel libmatemixer-devel libxml2-devel mate-common qt5-qtsvg-devel qt5-qtmultimedia-devel qt5-qtx11extras-devel bamf-devel libXrandr-devel libXtst-devel libX11-devel kf5-kwindowsystem-devel
      - name: Configure & Make
        run: |
          ln -sf /usr/bin/lrelease-qt5 /usr/bin/lrelease;
          ln -sf /usr/bin/qmake-qt5 /usr/bin/qmake;
          ./autogen.sh;
          make -j$(nproc);
          cd ukui-volume-control-applet-qt;
          qmake .;
          make -j$(nproc);
  ubuntu:
    name: on Ubuntu 20.04
    runs-on: ubuntu-20.04
    container: docker.io/library/ubuntu:focal
    env:
      DEBIAN_FRONTEND: noninteractive
    steps:
      - name: Checkout ukui-media source code
        uses: actions/checkout@v2
      - name: Update apt repository
        run: apt-get update -y
      - name: Install build dependcies
        run: apt-get install -y build-essential qt5-default qttools5-dev-tools intltool qtbase5-dev libcanberra-gtk3-dev libgsettings-qt-dev libglib2.0-dev libgtk-3-dev libmate-desktop-dev libmatemixer-dev libxml2-dev mate-common libqt5svg5-dev libqt5xdg-dev libqt5multimedia5-plugins qtmultimedia5-dev libkf5windowsystem-dev
      - name: Configure & Make
        run: |
          ./autogen.sh;
          ./configure;
          make -j$(nproc);
          cd ukui-volume-control-applet-qt;
          qmake .;
          make -j$(nproc);
