name: CI
on:
  - push
  - pull_request

permissions:
  contents: read

jobs:
  build-linux:
    name: Linux-autoTests
    runs-on: ubuntu-latest
    steps:
    - name: Checkout
      uses: actions/checkout@v6
      
    - name: Updates
      run: sudo apt-get update

    - name: Dependencies
      run: sudo apt-get install cmake qtbase5-dev qt5-qmake libqt5svg5-dev qtdeclarative5-dev qttools5-dev libqt5svg5-dev zlib1g-dev pkg-config libhunspell-dev libquazip5-dev

    - name: Configure
      run: cmake -DTEXSTUDIO_ENABLE_TESTS=ON -DTEXSTUDIO_BUILD_ADWAITA=OFF -DCMAKE_BUILD_TYPE=Debug .

    - name: Build
      run: make -j 4

    - name: Test
      run: QT_QPA_PLATFORM=offscreen ./texstudio --auto-tests


