docs.yml 1.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960
  1. name: Docs
  2. on:
  3. pull_request:
  4. paths:
  5. - 'docs/**'
  6. - '.github/workflows/docs.yml'
  7. push:
  8. branches:
  9. - main
  10. paths:
  11. - 'docs/**'
  12. - '.github/workflows/docs.yml'
  13. concurrency:
  14. group: ${{ github.workflow }}-${{ github.ref }}
  15. cancel-in-progress: true
  16. permissions:
  17. contents: read
  18. jobs:
  19. docs:
  20. runs-on: ubuntu-24.04
  21. name: docs
  22. steps:
  23. - name: Checkout
  24. uses: actions/checkout@v4
  25. - name: Set up Python
  26. uses: actions/setup-python@v5
  27. with:
  28. python-version: '3.13'
  29. cache: 'pip'
  30. cache-dependency-path: 'docs/requirements.txt'
  31. - run: python -m pip install -r docs/requirements.txt
  32. - name: Build docs
  33. run: |
  34. cd docs
  35. sphinx-build -b spelling -n -q -W --keep-going -d _build/doctrees -D language=en_US -j auto . _build/spelling
  36. blacken-docs:
  37. runs-on: ubuntu-latest
  38. name: blacken-docs
  39. steps:
  40. - name: Checkout
  41. uses: actions/checkout@v4
  42. - name: Set up Python
  43. uses: actions/setup-python@v5
  44. with:
  45. python-version: '3.13'
  46. - run: python -m pip install blacken-docs
  47. - name: Build docs
  48. run: |
  49. cd docs
  50. make black
  51. RESULT=`cat _build/black/output.txt`
  52. if [ "$RESULT" -gt 0 ]; then
  53. echo "💥 📢 Code blocks in documentation must be reformatted with blacken-docs 📢 💥"
  54. fi;
  55. exit $RESULT