diff options
| author | Natalia <124304+nessita@users.noreply.github.com> | 2026-02-27 11:19:20 -0300 |
|---|---|---|
| committer | Natalia <124304+nessita@users.noreply.github.com> | 2026-03-02 15:07:30 -0300 |
| commit | 659bacfe54c2a28eb2e0589c1c721f1a99720ad2 (patch) | |
| tree | 532576a71a90147d9e5a9dc71a1c43d3e194be29 | |
| parent | e65c412241578ead6dc17e9dc7280630a180d1c0 (diff) | |
[6.0.x] Aligned docs checks between GitHub Actions and local development.
Backport of 3f21cb06e76044ad753055700395e54a1fc4f1e9 from main.
| -rw-r--r-- | .github/workflows/docs.yml | 61 | ||||
| -rw-r--r-- | docs/Makefile | 29 |
2 files changed, 35 insertions, 55 deletions
diff --git a/.github/workflows/docs.yml b/.github/workflows/docs.yml index bfa4f9cb52..188dbd5359 100644 --- a/.github/workflows/docs.yml +++ b/.github/workflows/docs.yml @@ -22,7 +22,9 @@ permissions: jobs: docs: runs-on: ubuntu-24.04 - name: spelling + defaults: + run: + working-directory: docs timeout-minutes: 60 steps: - name: Checkout @@ -35,51 +37,12 @@ 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 -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@v5 - with: - persist-credentials: false - - name: Set up Python - uses: actions/setup-python@v6 - 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 - - lint-docs: - runs-on: ubuntu-latest - name: lint-docs - timeout-minutes: 60 - steps: - - name: Checkout - uses: actions/checkout@v5 - with: - persist-credentials: false - - name: Set up Python - uses: actions/setup-python@v6 - with: - python-version: '3.14' - - run: python -m pip install sphinx-lint - - name: Build docs - run: | - cd docs - make lint + - 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: Lint + run: make lint + - name: Black + run: make black + - name: Spelling + run: SPHINXOPTS="-q -W" make spelling diff --git a/docs/Makefile b/docs/Makefile index 3545332a40..41ed522daf 100644 --- a/docs/Makefile +++ b/docs/Makefile @@ -171,16 +171,33 @@ 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 lint: $(PYTHON) lint.py @echo @echo "Documentation lint complete." -check: spelling black lint - @echo - @echo "Style and spelling checks completed." +check: + @echo "=== Spelling check ==="; \ + $(MAKE) --no-print-directory SPHINXOPTS="-q -W" spelling; SPELLING=$$?; \ + echo ""; \ + echo "=== Code formatting check ==="; \ + $(MAKE) --no-print-directory black; BLACK=$$?; \ + echo ""; \ + echo "=== Lint check ==="; \ + $(MAKE) --no-print-directory lint; LINT=$$?; \ + echo ""; \ + if [ $$SPELLING -ne 0 ] || [ $$BLACK -ne 0 ] || [ $$LINT -ne 0 ]; then \ + echo "Some checks failed."; \ + exit 1; \ + fi; \ + echo "All style and spelling checks passed." |
