From 6322e9015053237d21fc8f5f3f510135a12b4899 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Christoph=20Fr=C3=B6hlich?= Date: Tue, 16 Apr 2024 10:13:40 +0200 Subject: [PATCH] Rework checks and add html-with-errors make target (#266) * Add html-with-errors make target * Check all branches for links and errors * Update badges in README --- .github/workflows/sphinx-check-links-pr.yml | 42 +++++++++++++++++++ .github/workflows/sphinx-check-links.yml | 6 ++- ...ngs-iron.yml => sphinx-check-warnings.yml} | 7 +++- Makefile | 9 +++- README.md | 5 ++- 5 files changed, 63 insertions(+), 6 deletions(-) create mode 100644 .github/workflows/sphinx-check-links-pr.yml rename .github/workflows/{sphinx-check-warnings-iron.yml => sphinx-check-warnings.yml} (89%) diff --git a/.github/workflows/sphinx-check-links-pr.yml b/.github/workflows/sphinx-check-links-pr.yml new file mode 100644 index 00000000000..81512808d52 --- /dev/null +++ b/.github/workflows/sphinx-check-links-pr.yml @@ -0,0 +1,42 @@ +name: "Check Page for Broken Links - PR" +on: + workflow_dispatch: + pull_request: + +jobs: + check-links: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + with: + fetch-depth: 0 + - uses: actions/setup-python@v5 + with: + python-version: '3.10' + cache: 'pip' + - name: Install Python dependencies + run: | + python -m pip install --upgrade pip + pip install --upgrade --requirement requirements.txt + shell: bash + - name: Install generate_parameter_library + run: | + cd + git clone https://github.com/PickNikRobotics/generate_parameter_library.git + cd generate_parameter_library/generate_parameter_library_py/ + python -m pip install . + shell: bash + - name: Install doxygen and graphviz + run: sudo apt-get install -y doxygen graphviz + - name: Restore stats + uses: actions/cache/restore@v4 + with: + key: reviewer-stats-${{ github.run_id }} + restore-keys: | + reviewer-stats + path: ~/reviews + - name: Build page with API and run linkchecker + run: | + git config --local user.email "action@github.com" + git config --local user.name "GitHub Action" + make linkcheck-all-subrepos-with-api diff --git a/.github/workflows/sphinx-check-links.yml b/.github/workflows/sphinx-check-links.yml index 11e3eba1aaf..e290002d213 100644 --- a/.github/workflows/sphinx-check-links.yml +++ b/.github/workflows/sphinx-check-links.yml @@ -7,15 +7,19 @@ on: schedule: # Run every morning to ensure component documentation is up to date on deployment - cron: '23 5 * * *' - pull_request: # only runs up through build of sphinx jobs: check-links: runs-on: ubuntu-latest + strategy: + fail-fast: false + matrix: + BRANCH: [humble, iron, master] steps: - uses: actions/checkout@v4 with: fetch-depth: 0 + ref: ${{ matrix.BRANCH }} - uses: actions/setup-python@v5 with: python-version: '3.10' diff --git a/.github/workflows/sphinx-check-warnings-iron.yml b/.github/workflows/sphinx-check-warnings.yml similarity index 89% rename from .github/workflows/sphinx-check-warnings-iron.yml rename to .github/workflows/sphinx-check-warnings.yml index b4f352549a6..7b895f703b6 100644 --- a/.github/workflows/sphinx-check-warnings-iron.yml +++ b/.github/workflows/sphinx-check-warnings.yml @@ -1,4 +1,4 @@ -name: "Check Page for Warnings Iron" +name: "Check Page for Warnings" on: workflow_dispatch: push: @@ -11,10 +11,15 @@ on: jobs: build-halt-on-warnings: runs-on: ubuntu-latest + strategy: + fail-fast: false + matrix: + BRANCH: [humble, iron, master] steps: - uses: actions/checkout@v4 with: fetch-depth: 0 + ref: ${{ matrix.BRANCH }} - uses: actions/setup-python@v5 with: python-version: '3.10' diff --git a/Makefile b/Makefile index 29590f18099..de0ce3c74c2 100644 --- a/Makefile +++ b/Makefile @@ -12,6 +12,7 @@ BUILDDIR = _build help: @$(SPHINXBUILD) -M help $(SOURCEDIR) $(BUILDDIR) $(SPHINXOPTS) $(O) @echo " html-with-api" + @echo " html-with-errors" @echo " html-all-subrepos" @echo " html-all-subrepos-with-errors" @echo " html-all-subrepos-with-api" @@ -20,8 +21,12 @@ help: @echo " multiversion-with-errors" @echo " linkcheck-all-subrepos-with-api" +html-with-errors: Makefile + @echo Single version without API, no checkout of sub_repos + $(SPHINXBUILD) $(SPHINXOPTS) -W --keep-going $(SOURCEDIR) $(BUILDDIR)/html + html-with-api: Makefile - @echo Single html file with API + @echo Single version with API @echo Step 1: Creating html files $(SPHINXBUILD) $(SPHINXOPTS) $(SOURCEDIR) $(BUILDDIR)/html @echo Step 2: Building API @@ -102,7 +107,7 @@ multiversion-with-api: Makefile @echo Step 5: Create correct index @echo "" > "$(BUILDDIR)"/html/index.html -.PHONY: help Makefile html-with-api multiversion multiversion-with-api multiversion-with-errors html-all-subrepos html-all-subrepos-with-api html-all-subrepos-with-errors linkcheck-all-subrepos-with-api +.PHONY: help Makefile html-with-errors html-with-api multiversion multiversion-with-api multiversion-with-errors html-all-subrepos html-all-subrepos-with-api html-all-subrepos-with-errors linkcheck-all-subrepos-with-api # TODO(denis): Enable this! # # # # Generate the doxygen xml (for Sphinx) and copy the doxygen html to the diff --git a/README.md b/README.md index a82138f89e6..479a36a51c9 100644 --- a/README.md +++ b/README.md @@ -1,7 +1,8 @@ # Status -[![Build & Deploy Page](https://github.com/ros-controls/control.ros.org/actions/workflows/sphinx-make-page.yml/badge.svg)](https://github.com/ros-controls/control.ros.org/actions/workflows/sphinx-make-page.yml)[![Sphinx Warnings](https://github.com/ros-controls/control.ros.org/actions/workflows/sphinx-check-warnings.yml/badge.svg?branch=iron)](https://github.com/ros-controls/control.ros.org/actions/workflows/sphinx-check-warnings.yml)[![Broken Links](https://github.com/ros-controls/control.ros.org/actions/workflows/sphinx-check-links.yml/badge.svg?branch=iron)](https://github.com/ros-controls/control.ros.org/actions/workflows/sphinx-check-links.yml) - +[![Build & Deploy Page](https://github.com/ros-controls/control.ros.org/actions/workflows/sphinx-make-page.yml/badge.svg)](https://github.com/ros-controls/control.ros.org/actions/workflows/sphinx-make-page.yml) +[![Broken Links](https://github.com/ros-controls/control.ros.org/actions/workflows/sphinx-check-links.yml/badge.svg?branch=master)](https://github.com/ros-controls/control.ros.org/actions/workflows/sphinx-check-links.yml) +[![Sphinx Warnings](https://github.com/ros-controls/control.ros.org/actions/workflows/sphinx-check-warnings.yml/badge.svg?branch=master)](https://github.com/ros-controls/control.ros.org/actions/workflows/sphinx-check-warnings.yml) # control.ros.org https://control.ros.org/