From c2431cdd0aea3df750ab13e1481c156c9cb8a2db Mon Sep 17 00:00:00 2001 From: Meagan Lang Date: Tue, 9 Jan 2024 21:42:49 -0500 Subject: [PATCH] Refactor run script so that error is not raised when doxygen doesn't exist and --docs not specified Re-enable explicit installation of msys2 packages for mingw windows job Only run step to build docs on unix builds (and not ubuntu if doxygen installed via apt because the version is 1.9.1) --- .github/workflows/test-suite.yml | 5 +++-- run_tests.sh | 24 +++++++++++++----------- 2 files changed, 16 insertions(+), 13 deletions(-) diff --git a/.github/workflows/test-suite.yml b/.github/workflows/test-suite.yml index 3a50fc0e..059053f7 100644 --- a/.github/workflows/test-suite.yml +++ b/.github/workflows/test-suite.yml @@ -269,7 +269,7 @@ jobs: shell: bash -l {0} run: | mamba install m2w64-gcc m2w64-gcc-fortran m2w64-toolchain_win-64 libpython -c msys2 -y # winpthreads - # mamba install m2w64-gcc-libs m2w64-gcc-libs-core m2w64-gcc-libgfortran m2w64-libwinpthread-git msys2-conda-epoch -c msys2 -y + mamba install m2w64-gcc-libs m2w64-gcc-libs-core m2w64-gcc-libgfortran m2w64-libwinpthread-git msys2-conda-epoch -c msys2 -y - name: Install MinGW on windows for Fortran (msvc) if: matrix.os == 'windows-latest' && matrix.python-install == 'conda' && matrix.windows-compiler == 'msvc' shell: bash -l {0} @@ -588,9 +588,10 @@ jobs: ./run_tests.sh --rebuild --speed --config Release ${{ env.CMAKE_ARGS_BASE }} ${{ env.CMAKE_ARGS_NO_PYTHON }} --verbose ################################### - # Speed tests + # Docs tests ################################### - name: Build docs + if: matrix.os != 'windows-latest' && (matrix.os == 'macos-latest' || matrix.python-install == 'conda') shell: bash -l {0} run: | ./run_tests.sh --docs diff --git a/run_tests.sh b/run_tests.sh index 19ccc3ee..9e510349 100755 --- a/run_tests.sh +++ b/run_tests.sh @@ -376,16 +376,18 @@ if [ -n "$DO_SYMBOLS" ]; then fi fi -path_to_doxygen=$(which doxygen) -if [ -n "$DO_DOCS" ] && [ -x "$path_to_doxygen" ]; then - echo "BUILDING DOCS" - if [ ! -d "build" ]; then - mkdir build +if [ -n "$DO_DOCS" ]; then + path_to_doxygen=$(which doxygen) + if [ -x "$path_to_doxygen" ]; then + echo "BUILDING DOCS" + if [ ! -d "build" ]; then + mkdir build + fi + cd build + cmake .. $CMAKE_FLAGS -DYGG_BUILD_DOCS=ON -DBUILD_CPP_LIBRARY=OFF -DBUILD_FORTRAN_LIBRARY=OFF + cmake --build . $CONFIG_FLAGS --target docs + # Need install here to ensure that cmake config files are in place + cmake --install . --prefix "$INSTALL_DIR" $CONFIG_FLAGS + cd .. fi - cd build - cmake .. $CMAKE_FLAGS -DYGG_BUILD_DOCS=ON -DBUILD_CPP_LIBRARY=OFF -DBUILD_FORTRAN_LIBRARY=OFF - cmake --build . $CONFIG_FLAGS --target docs - # Need install here to ensure that cmake config files are in place - cmake --install . --prefix "$INSTALL_DIR" $CONFIG_FLAGS - cd .. fi