nuttx/.github/workflows/doc.yml
Marco Casaroli eba1d9561b ci: Build the documentation from its lock file.
The documentation job installs with `pipenv install`, which does not honour
the committed Pipfile.lock.  Every run in the logs prints "Locking
dependencies..." and "Updated Pipfile.lock" and then installs from the set it
has just re-resolved, so each build takes whatever PyPI resolves that day
rather than what the lock file names.

On the evening of 2026-08-03 that resolution produced a virtualenv without
packaging, and four unrelated pull requests failed identically, before Sphinx
had read a single file:

  File ".../sphinx/extension.py", line 7, in <module>
      from packaging.version import InvalidVersion, Version
  ModuleNotFoundError: No module named 'packaging'

`pipenv sync` installs exactly what Pipfile.lock names and never re-resolves,
which is what the lock file is for.  The committed lock covers all fourteen
packages the Pipfile asks for, packaging included, so it is complete enough to
install from as it stands.

The workflow also ran only for changes under Documentation/, so a change to the
documentation build was never exercised by the build it changed.  It now
triggers on its own path as well, which is what tests this commit.

Assisted-by: Claude Opus 5 (1M context) <noreply@anthropic.com>
Signed-off-by: Marco Casaroli <marco.casaroli@gmail.com>
2026-08-04 17:28:41 -03:00

57 lines
1.5 KiB
YAML

# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#
---
name: "Build Documentation"
on:
push:
branches:
- master
paths:
- 'Documentation/**'
- '.github/workflows/doc.yml'
pull_request:
paths:
- 'Documentation/**'
- '.github/workflows/doc.yml'
concurrency:
group: docs-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true
permissions:
contents: read
jobs:
build-html:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v7
- uses: actions/setup-python@v7
with:
python-version: '3.10'
- name: Generate Documentation
run: |
cd Documentation/
sudo apt update
sudo apt install plantuml
pip3 install pipenv
pipenv sync
pipenv run make html
- uses: actions/upload-artifact@v7.0.1
with:
name: sphinx-docs
path: |
Documentation/_build/html/
Documentation/_build/latex/*.pdf