version: 2

submodules:
  include: all
  recursive: true

build:
  os: ubuntu-22.04
  tools:
    python: "3.11"
  jobs:
    post_checkout:
      # Skip docs build if the commit message contains "skip ci"
      - (git --no-pager log --pretty="tformat:%s -- %b" -1 | grep -viq "skip ci") || exit 183
      # Skip docs build if there are no changes related to docs
      - |
        if [ "$READTHEDOCS_VERSION_TYPE" = "external" ] && git diff --quiet origin/main -- docs/ .readthedocs.yaml src/mqt/ .github/contributing* .github/workflows/support*;
        then
          exit 183;
        fi

sphinx:
  configuration: docs/conf.py

python:
  install:
    - method: pip
      path: .
      extra_requirements:
        - docs
