summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNatalia <124304+nessita@users.noreply.github.com>2026-02-27 11:19:20 -0300
committerNatalia <124304+nessita@users.noreply.github.com>2026-03-02 15:10:49 -0300
commit1db60ed34f869c3f5aa3f7f861532813a46cc9d8 (patch)
treeee3284950f59e1e7fa5841983f6bc923879f1ff9
parent703777cbbc268f62083c703fa27fa582b54bcc93 (diff)
[5.2.x] Aligned docs checks between GitHub Actions and local development.
Backport of 3f21cb06e76044ad753055700395e54a1fc4f1e9 from main.
-rw-r--r--.github/workflows/docs.yml40
-rw-r--r--docs/Makefile11
2 files changed, 18 insertions, 33 deletions
diff --git a/.github/workflows/docs.yml b/.github/workflows/docs.yml
index a21f9398bc..385493fa9b 100644
--- a/.github/workflows/docs.yml
+++ b/.github/workflows/docs.yml
@@ -22,7 +22,9 @@ permissions:
jobs:
docs:
runs-on: ubuntu-24.04
- name: docs
+ defaults:
+ run:
+ working-directory: docs
timeout-minutes: 60
steps:
- name: Checkout
@@ -35,32 +37,10 @@ jobs:
python-version: '3.14'
cache: 'pip'
cache-dependency-path: 'docs/requirements.txt'
- - run: python -m pip install -r docs/requirements.txt
- - name: Build docs
- run: |
- cd docs
- sphinx-build -b spelling -n -q -W --keep-going -d _build/doctrees -D language=en_US -j auto . _build/spelling
-
- blacken-docs:
- runs-on: ubuntu-latest
- name: blacken-docs
- timeout-minutes: 60
- steps:
- - name: Checkout
- uses: actions/checkout@v4
- with:
- persist-credentials: false
- - name: Set up Python
- uses: actions/setup-python@v5
- with:
- python-version: '3.14'
- - run: python -m pip install blacken-docs
- - name: Build docs
- run: |
- cd docs
- make black
- RESULT=`cat _build/black/output.txt`
- if [ "$RESULT" -gt 0 ]; then
- echo "💥 📢 Code blocks in documentation must be reformatted with blacken-docs 📢 💥"
- fi;
- exit $RESULT
+ - name: Install system spell checker
+ run: sudo apt update && sudo apt install -y aspell aspell-en
+ - run: python -m pip install -r requirements.txt
+ - name: Black
+ run: make black
+ - name: Spelling
+ run: SPHINXOPTS="-q -W" make spelling
diff --git a/docs/Makefile b/docs/Makefile
index 9935ad09e5..98fdfc8cb7 100644
--- a/docs/Makefile
+++ b/docs/Makefile
@@ -170,10 +170,15 @@ spelling:
black:
@mkdir -p $(BUILDDIR)/black
- find . -name "*.txt" -not -path "./_build/*" -not -path "./_theme/*" \
+ @find . -name "*.txt" -not -path "./_build/*" -not -path "./_theme/*" \
| xargs blacken-docs --rst-literal-block; echo $$? > "$(BUILDDIR)/black/output.txt"
- @echo
- @echo "Code blocks reformatted"
+ @RESULT=`cat $(BUILDDIR)/black/output.txt`; \
+ if [ "$$RESULT" -gt 0 ]; then \
+ echo "💥 📢 Code blocks in documentation must be reformatted with blacken-docs 📢 💥"; \
+ exit $$RESULT; \
+ else \
+ echo "Code blocks in documentation are properly formatted ✅"; \
+ fi
check: spelling black
@echo