From 7df72cc95ae92d38767da0001b63dc7fc80bf831 Mon Sep 17 00:00:00 2001 From: Rafael Fontenelle Date: Tue, 22 Oct 2024 16:23:04 -0300 Subject: [PATCH 1/6] ci: add test for documentation --- .github/workflows/doc.yml | 40 +++++++++++++++++++++++++++++++++++++++ 1 file changed, 40 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..552cb3e --- /dev/null +++ b/.github/workflows/doc.yml @@ -0,0 +1,40 @@ +name: Docs +on: + push: + paths: + - 'doc/' + pull_request: + paths: + - 'doc/' + +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: 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' From e5fa3304c5771937d471b3889defad5effb6e742 Mon Sep 17 00:00:00 2001 From: Rafael Fontenelle Date: Tue, 22 Oct 2024 16:23:52 -0300 Subject: [PATCH 2/6] Add sphinx-lint to doc/requirements.txt --- doc/requirements.txt | 1 + 1 file changed, 1 insertion(+) diff --git a/doc/requirements.txt b/doc/requirements.txt index 8fbe6f7..e141e04 100644 --- a/doc/requirements.txt +++ b/doc/requirements.txt @@ -1,3 +1,4 @@ sphinx sphinx_rtd_theme>=1.3 sphinx-click +sphinx-lint From 0b90c321291f593a4aaeb9067b16f67e4b9a862b Mon Sep 17 00:00:00 2001 From: Rafael Fontenelle Date: Tue, 22 Oct 2024 16:29:20 -0300 Subject: [PATCH 3/6] ci: add workflow_dispatch to doc.yml Allows to call manually the workflow, which is helpful for linkcheck --- .github/workflows/doc.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/doc.yml b/.github/workflows/doc.yml index 552cb3e..142fbe6 100644 --- a/.github/workflows/doc.yml +++ b/.github/workflows/doc.yml @@ -6,6 +6,7 @@ on: pull_request: paths: - 'doc/' + workflow_dispatch: concurrency: group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.sha }} From f88c69958c48547f1aa1eaaf2724ba0ca4f5aeea Mon Sep 17 00:00:00 2001 From: Rafael Fontenelle Date: Tue, 5 Nov 2024 00:58:22 -0300 Subject: [PATCH 4/6] Add workflow file to event trigger paths --- .github/workflows/doc.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/doc.yml b/.github/workflows/doc.yml index 142fbe6..0304d79 100644 --- a/.github/workflows/doc.yml +++ b/.github/workflows/doc.yml @@ -3,9 +3,11 @@ on: push: paths: - 'doc/' + - '.github/workflows/doc.yml' pull_request: paths: - 'doc/' + - '.github/workflows/doc.yml' workflow_dispatch: concurrency: From 113dcb39e9c6742a8d2e4cf6999e0b3c61ccaddb Mon Sep 17 00:00:00 2001 From: Rafael Fontenelle Date: Tue, 5 Nov 2024 16:22:07 -0300 Subject: [PATCH 5/6] Add self to doc/requirements.txt Needed due to a import of sphinx-intl in doc/conf.py --- doc/requirements.txt | 1 + 1 file changed, 1 insertion(+) diff --git a/doc/requirements.txt b/doc/requirements.txt index e141e04..66ef164 100644 --- a/doc/requirements.txt +++ b/doc/requirements.txt @@ -2,3 +2,4 @@ sphinx sphinx_rtd_theme>=1.3 sphinx-click sphinx-lint +. From 8db59f55d7a7b7ca66775d885644e573184bbedc Mon Sep 17 00:00:00 2001 From: Rafael Fontenelle Date: Tue, 5 Nov 2024 16:30:30 -0300 Subject: [PATCH 6/6] Annotate error messages from doc.yml --- .github/workflows/doc.yml | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/.github/workflows/doc.yml b/.github/workflows/doc.yml index 0304d79..99f87fa 100644 --- a/.github/workflows/doc.yml +++ b/.github/workflows/doc.yml @@ -20,20 +20,26 @@ jobs: 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/