This is an automated email from the ASF dual-hosted git repository.

xiaoxiang pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/nuttx-website.git


The following commit(s) were added to refs/heads/master by this push:
     new 2cb0d84c9 CI: Fix build dependencies setup for old doc.
2cb0d84c9 is described below

commit 2cb0d84c9ad895300c8d22216214da276a96f9c1
Author: Tomasz 'CeDeROM' CEDRO <[email protected]>
AuthorDate: Thu Sep 19 21:10:21 2024 +0200

    CI: Fix build dependencies setup for old doc.
    
    * CI runner on nuttx-website repo creates main and documentation websites.
    * Documentation build includes current master and previous releases.
    * Documentation uses Sphinx as documentation generator. Sphinx needs Python.
    * Sphinx may have different dependencies for different NuttX release.
    * Python packages are managed with PipEnv per release deinfed in Pipfile.
    * Until now all doc build dependencies were the same, so single build
      environment setup (pipenv install) for Sphinx was okay before build loop.
    * Recently m2r2 package was replaced with myst-parser in #nuttx/86be27b.
    * m2r2 and myst-parser are exclusive Sphinx extensions used for the same
      task, but the build for older releases got broken (requires m2r2).
    * Sphinx PipEnv dependencies (un)install was moved into the build loop
      that will privde packages required by a given release defined in Pipfile.
    * CI builder script was also updated with helpful log messages.
    
    Signed-off-by: Tomasz 'CeDeROM' CEDRO <[email protected]>
---
 .github/workflows/main.yml | 52 +++++++++++++++++++++++++++++++++++++++-------
 1 file changed, 44 insertions(+), 8 deletions(-)

diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml
index a095e66ce..027a2babb 100644
--- a/.github/workflows/main.yml
+++ b/.github/workflows/main.yml
@@ -32,38 +32,74 @@ jobs:
         python-version: '3.8'
     - name: Build docs
       run: |
+        echo "======================================================="
+        echo " Install Pipenv"
+        echo "======================================================="
+
         pip3 install pipenv
-        cd nuttx/Documentation
 
-        # For now install only dependencies from master for all versions
-        # of documentation so far old versions can use these updated pin
-        # but the old pins in old releases cannot always be used.
-        pipenv install
+        echo "======================================================="
+        echo " Setup nuttx/Documentation"
+        echo "======================================================="
 
+        cd nuttx/Documentation
         DOCDIR=../../docs
         rm -rf $DOCDIR
 
+        echo "======================================================="
+        echo " Select nuttx/Documentation version candidates"
+        echo "======================================================="
+
         NUTTX_TAGS=$(git tag -l 'nuttx-1?.*' | fgrep -v RC)
         export NUTTX_VERSIONS=$(echo -n "$NUTTX_TAGS" | sed -r 's|^nuttx-||g' 
| tr '\n' ',')
         
-        echo "Building documentation for nuttx: $NUTTX_VERSIONS (and master)"
+        echo " ==> BUILD NUTTX DOCUMENTATION FOR: $NUTTX_VERSIONS (and 
master)."
 
         for nuttx_version in $NUTTX_TAGS master; do
+
+          echo " ===> BUILDING DOCUMENTATION FOR NuttX $nuttx_version."
+
           git checkout -f $nuttx_version
-          
+
+          # NuttX uses Sphinx as documentation generator. Sphinx needs Python.
+          # Sphinx may have different dependencies for different NuttX release.
+          # Manage Python packages with PipEnv per release deinfed in Pipfile.
+          echo " ====> PIPENV INSTALL."
+
+          pipenv install
+
           if [ "$nuttx_version" = "master" ]; then
             OUTDIR="$DOCDIR/latest"
-         else
+          else
             OUTDIR="$DOCDIR/${nuttx_version#nuttx-}"
           fi
 
+          echo " ====> OUTDIR IS: $OUTDIR."
+
+          echo " ====> STARTING SPHINX BUILD."
+
           pipenv run make html BUILDDIR="$OUTDIR"
+
+          echo " ====> COPY RESULTS."
+
           mv $OUTDIR/html/* $OUTDIR
+
+          echo " ====> BUILD LOCATION CLEANUP."
+
           rm -rf $OUTDIR/{html,doctrees}
+
+          echo " ====> PIPENV CLEANUP."
+
+          # Uninstall pipenv packages (cached packages are preserved).
+          pipenv uninstall --all
+
         done
 
         cd ../..
 
+        echo  " ========== DOCUMENTATION BUILD FINISHED ==========="
+
+
     - name: Install Ruby tools
       run: |
         sudo apt-get -y install rubygems ruby-dev zlib1g-dev

Reply via email to