Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add doxygen to the cmake build and add doxygen build to CI. #759

Merged
merged 19 commits into from
Jan 19, 2024
Merged
Show file tree
Hide file tree
Changes from 18 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 15 additions & 9 deletions .github/workflows/GCC.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,10 @@ jobs:

steps:

- name: install-doxygen
run: |
sudo apt-get install doxygen graphviz

- name: checkout-fv3atm
uses: actions/checkout@v3
with:
Expand All @@ -37,7 +41,7 @@ jobs:
uses: actions/cache@v3
with:
path: ${{ github.workspace }}/spack-develop
key: spack-${{ hashFiles('fv3atm/ci/spack.yaml') }}-gcc${{ matrix.gcc_ver }}-2
key: spack-${{ hashFiles('fv3atm/ci/spack.yaml') }}-gcc${{ matrix.gcc_ver }}-2-${{ matrix.cmake_opts }}-${{ matrix.mpich }}

# Building dependencies takes 40+ min
- name: spack-install
Expand All @@ -55,13 +59,6 @@ jobs:
spack concretize |& tee ${SPACK_ENV}/log.concretize
spack install -j2 --fail-fast

- name: cache-save
uses: actions/cache/save@v3
if: ${{ always() }}
with:
path: ${{ github.workspace }}/spack-develop
key: spack-${{ hashFiles('fv3atm/ci/spack.yaml') }}-gcc${{ matrix.gcc_ver }}-2

- name: build-fv3atm
run: |
. ${GITHUB_WORKSPACE}/spack-develop/share/spack/setup-env.sh
Expand All @@ -71,13 +68,22 @@ jobs:
git clone https://github.com/NOAA-EMC/CMakeModules
git clone --recurse-submodules https://github.com/NOAA-PSL/stochastic_physics stochastic_physics_repo
mkdir ${GITHUB_WORKSPACE}/build
sed -i 's/doc /upp_doc /' upp/docs/CMakeLists.txt
cd ${GITHUB_WORKSPACE}/build
cmake ${GITHUB_WORKSPACE}/fv3atm -DBUILD_TESTING=ON ${{ matrix.cmake_opts }}
cmake ${GITHUB_WORKSPACE}/fv3atm -DBUILD_TESTING=ON ${{ matrix.cmake_opts }} -DENABLE_DOCS=ON
make -j2
ls -l /home/runner/work/fv3atm/fv3atm/fv3atm/io

- uses: actions/upload-artifact@v3
with:
name: docs
path: |
build/docs/html

- name: debug-artifacts
uses: actions/upload-artifact@v3
if: ${{ failure() }}
with:
name: ccpp_prebuild_logs
path: ${{ github.workspace }}/build/ccpp/ccpp_prebuild.*

14 changes: 14 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,17 @@
# This is the main CMake file for fv3atm.
#
# Dusan Jovic, Alex Richert
cmake_minimum_required(VERSION 3.19)
junwang-noaa marked this conversation as resolved.
Show resolved Hide resolved

# Handle user build options.
option(ENABLE_DOCS "Enable generation of doxygen-based documentation." OFF)

# Determine whether or not to generate documentation.
if(ENABLE_DOCS)
find_package(Doxygen REQUIRED)
add_subdirectory(docs)
endif()

# Enable CI build & unit testing:
if(BUILD_TESTING)
cmake_minimum_required(VERSION 3.19)
Expand Down
17 changes: 17 additions & 0 deletions docs/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
# This is the CMake file for building the docs directory of fv3atm.
#
# Ed Hartnett 12/28/23

IF(ENABLE_DOCS)

# Create doxyfile.
SET(abs_top_srcdir "${CMAKE_SOURCE_DIR}")
SET(abs_top_builddir "${CMAKE_BINARY_DIR}")
CONFIGURE_FILE(${CMAKE_CURRENT_SOURCE_DIR}/Doxyfile.in ${CMAKE_CURRENT_BINARY_DIR}/Doxyfile @ONLY)
ADD_CUSTOM_TARGET(doxygen_doc ALL
${DOXYGEN_EXECUTABLE} ${CMAKE_CURRENT_BINARY_DIR}/Doxyfile
WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}
COMMENT "Generating API Documentation with Doxygen" VERBATIM)

ENDIF(ENABLE_DOCS)

Loading