# This task tries to verify if the documentation will build properly on RTD
steps:
- task: UsePythonVersion@0
  inputs:
    versionSpec: '3.8'

- script: |
    pip install  --exists-action=w --no-cache-dir -r test-requirements.txt -r .azure/doc-requirements.txt
  displayName: 'Install requirements'

- script: |
    python -m sphinx -T -b readthedocs -d _build/doctrees-readthedocs -D language=en doc build/html
  displayName: 'Check documentation'

- task: CopyFiles@2
  inputs:
    contents: 'build/html/**'
    targetFolder: $(Build.ArtifactStagingDirectory)

- task: PublishBuildArtifacts@1
  inputs:
    pathToPublish: $(Build.ArtifactStagingDirectory)
    artifactName: documentation

