diff --git a/.github/workflows/build-docs.yml b/.github/workflows/build-docs.yml new file mode 100644 index 00000000..5ce50bac --- /dev/null +++ b/.github/workflows/build-docs.yml @@ -0,0 +1,45 @@ +name: Build Docs + +on: + pull_request: + branches: [ main ] + paths: + # Only build if there has been a change in the following files + - 'src/**.h' + - 'src/**.cpp' + - 'documentation/**.md' + - '.github/workflows/build-docs.yml' + +env: + # Customize the CMake build type here (Release, Debug, RelWithDebInfo, etc.) + BUILD_TYPE: Release + +jobs: + build: + runs-on: ubuntu-latest + env: + CXX: /usr/bin/g++-10 + steps: + - uses: actions/checkout@v2 + + - name: Install Doxygen + # Install doxygen from apt + run: | + sudo apt-get update + sudo apt-get -y install doxygen graphviz + + - name: Configure CMake + # Configure CMake in a 'build' subdirectory. + run: > + cmake -B ${{github.workspace}}/build + -DCMAKE_BUILD_TYPE=${{env.BUILD_TYPE}} + -DCMAKE_CXX_COMPILER=${{ env.CXX }} + -DBUILD_TESTS=OFF + -DBUILD_DOXYGEN=ON + + - name: Build + # Build your program with the given configuration + run: > + cmake --build ${{github.workspace}}/build + --config ${{env.BUILD_TYPE}} + --target doxygen-docs diff --git a/.github/workflows/documentation.yml b/.github/workflows/deploy-docs.yml similarity index 58% rename from .github/workflows/documentation.yml rename to .github/workflows/deploy-docs.yml index 4d3ca3d8..cf1f6fea 100644 --- a/.github/workflows/documentation.yml +++ b/.github/workflows/deploy-docs.yml @@ -7,7 +7,7 @@ on: - 'src/**.h' - 'src/**.cpp' - 'documentation/**.md' - - '.github/workflows/documentation.yml' + - '.github/workflows/deploy_docs.yml' env: # Customize the CMake build type here (Release, Debug, RelWithDebInfo, etc.) @@ -15,9 +15,6 @@ env: jobs: build: - # The CMake configure and build commands are platform agnostic and should work equally well on Windows or Mac. - # You can convert this to a matrix build if you need cross-platform coverage. - # See: https://docs.github.com/en/free-pro-team@latest/actions/learn-github-actions/managing-complex-workflows#using-a-build-matrix runs-on: ubuntu-latest env: CXX: /usr/bin/g++-10 @@ -31,13 +28,20 @@ jobs: sudo apt-get -y install doxygen graphviz - name: Configure CMake - # Configure CMake in a 'build' subdirectory. `CMAKE_BUILD_TYPE` is only required if you are using a single-configuration generator such as make. - # See https://cmake.org/cmake/help/latest/variable/CMAKE_BUILD_TYPE.html?highlight=cmake_build_type - run: cmake -B ${{github.workspace}}/build -DCMAKE_BUILD_TYPE=${{env.BUILD_TYPE}} -DCMAKE_CXX_COMPILER=${{ env.CXX }} -DBUILD_TESTS=OFF + # Configure CMake in a 'build' subdirectory. + run: > + cmake -B ${{github.workspace}}/build + -DCMAKE_BUILD_TYPE=${{env.BUILD_TYPE}} + -DCMAKE_CXX_COMPILER=${{ env.CXX }} + -DBUILD_TESTS=OFF + -DBUILD_DOXYGEN=ON - name: Build # Build your program with the given configuration - run: cmake --build ${{github.workspace}}/build --config ${{env.BUILD_TYPE}} --target doxygen-docs + run: > + cmake --build ${{github.workspace}}/build + --config ${{env.BUILD_TYPE}} + --target doxygen-docs - name: Update Doxygen Pages run: |