name: Documentation workflow

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

jobs:
  build:
    runs-on: ${{ matrix.os }}
    strategy:
      fail-fast: False
      matrix:
        python: ['3.11']
        os: [ubuntu-22.04]

    steps:
      - uses: actions/checkout@v4
        with:
          submodules: 'true'
      - name: Setup Python
        uses: actions/setup-python@v5
        with:
          python-version: ${{ matrix.python }}

      - name: Install linux system dependencies
        run: sudo apt-get install -y libxkbcommon-x11-0

      - name: Install Tox
        run: pip install tox

      - name: Build documentation
        run: tox -e build_doc
        env:
          QT_QPA_PLATFORM: offscreen
