From 18134b414ce1b82802bcb9b2ec33a2f6f74a2a6f Mon Sep 17 00:00:00 2001 From: Alex Richert Date: Fri, 6 Oct 2023 17:26:42 -0700 Subject: [PATCH] Build pdoc --- .github/workflows/developer.yml | 13 ++++++++++--- docs/user_guide.md | 2 +- python/CMakeLists.txt | 1 + 3 files changed, 12 insertions(+), 4 deletions(-) diff --git a/.github/workflows/developer.yml b/.github/workflows/developer.yml index e83a978c..a297f439 100644 --- a/.github/workflows/developer.yml +++ b/.github/workflows/developer.yml @@ -25,7 +25,7 @@ jobs: run: | sudo apt-get update sudo apt-get install doxygen - sudo python3 -m pip install -U gcovr + sudo python3 -m pip install -U gcovr pdoc - name: checkout uses: actions/checkout@v3 @@ -45,7 +45,7 @@ jobs: cd bufr mkdir build cd build - cmake -DTEST_FILE_DIR=/home/runner/data -DCMAKE_INSTALL_PREFIX=./install -DCMAKE_Fortran_FLAGS="-Werror -g -fprofile-arcs -ftest-coverage -fprofile-abs-path -O0 -fsanitize=address -fno-omit-frame-pointer" -DCMAKE_C_FLAGS="-Werror -g -fprofile-arcs -ftest-coverage -fprofile-abs-path -O0 -fsanitize=address -fno-omit-frame-pointer" -DCMAKE_BUILD_TYPE=Debug -DENABLE_DOCS=On .. + cmake -DTEST_FILE_DIR=/home/runner/data -DCMAKE_INSTALL_PREFIX=./install -DCMAKE_Fortran_FLAGS="-Werror -g -fprofile-arcs -ftest-coverage -fprofile-abs-path -O0 -fsanitize=address -fno-omit-frame-pointer" -DCMAKE_C_FLAGS="-Werror -g -fprofile-arcs -ftest-coverage -fprofile-abs-path -O0 -fsanitize=address -fno-omit-frame-pointer" -DCMAKE_BUILD_TYPE=Debug -DENABLE_DOCS=OFF .. make -j2 VERBOSE=1 make install @@ -55,6 +55,13 @@ jobs: ctest --verbose --output-on-failure --rerun-failed gcovr --root .. -v --html-details --exclude ../test --exclude CMakeFiles --print-summary --exclude-unreachable-branches --exclude-throw-branches --decisions -o test-coverage.html + - name: build-docs + run: | + mkdir bufr/build-docs + cd build-docs + cmake -DBUILD_TESTING=OFF -DCMAKE_INSTALL_PREFIX=./install -DCMAKE_BUILD_TYPE=Debug -DENABLE_DOCS=ON -DENABLE_PYTHON=ON .. + make doc python_docs + - name: cache-data if: steps.cache-data.outputs.cache-hit != 'true' run: | @@ -72,4 +79,4 @@ jobs: with: name: docs path: | - bufr/build/docs/html + bufr/build-docs/docs/html diff --git a/docs/user_guide.md b/docs/user_guide.md index e501cd0e..a7bbfa1d 100644 --- a/docs/user_guide.md +++ b/docs/user_guide.md @@ -10,7 +10,7 @@ ## Documentation for the Python API for NCEPLIBS-bufr -* [The Python API documentation](https://noaa-emc.github.io/NCEPLIBS-bufr/python/index.html) +* [The Python API documentation](python/index.html) ## Introduction diff --git a/python/CMakeLists.txt b/python/CMakeLists.txt index 65780eb7..7fdbe840 100644 --- a/python/CMakeLists.txt +++ b/python/CMakeLists.txt @@ -37,6 +37,7 @@ if(ENABLE_DOCS) ${CMAKE_COMMAND} -E env PYTHONPATH=${_lib_dir}:$ENV{PYTHONPATH} ${PDOC_EXECUTABLE} -o ../docs/html/python ./ncepbufr ) + add_dependencies(python_docs doc python_mod) endif() install(DIRECTORY ${_lib_dir} DESTINATION ${CMAKE_INSTALL_FULL_LIBDIR}/python${_PYVER})