From 2ad874d6bf05b27cba56f33177f7c85b9fe89248 Mon Sep 17 00:00:00 2001 From: Rafael Fontenelle Date: Wed, 6 Nov 2024 01:48:11 -0300 Subject: [PATCH] Add CI test for sphinx-intl's doc (#107) * ci: add test for documentation * Add sphinx-lint to doc/requirements.txt * ci: add workflow_dispatch to doc.yml Allows to call manually the workflow, which is helpful for linkcheck * Add workflow file to event trigger paths * Add self to doc/requirements.txt Needed due to a import of sphinx-intl in doc/conf.py * Annotate error messages from doc.yml --- .github/workflows/doc.yml | 49 +++++++++++++++++++++++++++++++++++++++ doc/requirements.txt | 2 ++ 2 files changed, 51 insertions(+) create mode 100644 .github/workflows/doc.yml diff --git a/.github/workflows/doc.yml b/.github/workflows/doc.yml new file mode 100644 index 0000000..99f87fa --- /dev/null +++ b/.github/workflows/doc.yml @@ -0,0 +1,49 @@ +name: Docs +on: + push: + paths: + - 'doc/' + - '.github/workflows/doc.yml' + pull_request: + paths: + - 'doc/' + - '.github/workflows/doc.yml' + workflow_dispatch: + +concurrency: + group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.sha }} + cancel-in-progress: true + +jobs: + doc: + runs-on: ubuntu-latest + steps: + - name: Checkout code + uses: actions/checkout@v4 + + - name: Setup python binary + uses: actions/setup-python@v5 + with: + python-version: '3' + cache: 'pip' + cache-dependency-path: 'doc/requirements.txt' + + - name: Install dependencies + run: pip install -r doc/requirements.txt + + - name: Add sphinx-build problem matcher + uses: sphinx-doc/github-problem-matcher@v1.1 + + - name: Add sphinx-lint problem matcher + uses: rffontenelle/sphinx-lint-problem-matcher@v1.0.0 + + - name: Build docs + run: make -C doc html O='--keep-going --fail-on-warning --nitpicky' + + - name: Lint docs + if: always() + run: sphinx-lint doc/ + + - name: Check links + if: always() + run: make -C doc linkcheck O='--keep-going' diff --git a/doc/requirements.txt b/doc/requirements.txt index 8fbe6f7..66ef164 100644 --- a/doc/requirements.txt +++ b/doc/requirements.txt @@ -1,3 +1,5 @@ sphinx sphinx_rtd_theme>=1.3 sphinx-click +sphinx-lint +.