Clean-up dependencies #419
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Documentation | |
on: | |
push: | |
branches: [ development ] | |
pull_request: | |
branches: [ development ] | |
if: github.event.pull_request.draft == false | |
workflow_dispatch: | |
inputs: | |
debug_enabled: | |
description: 'Run the build with tmate debugging enabled (https://github.com/marketplace/actions/debugging-with-tmate)' | |
required: false | |
default: false | |
env: | |
CONAN_PRINT_RUN_COMMANDS: 1 | |
CONAN_REVISIONS_ENABLED: 1 | |
OMP_NUM_THREADS: 2 | |
CONAN_CPU_COUNT: 2 | |
USE_CONAN: 0 | |
jobs: | |
make-documentation: | |
runs-on: ubuntu-22.04 | |
steps: | |
- name: Check out sopt | |
uses: actions/checkout@v3 | |
with: | |
submodules: recursive | |
# Enable tmate debugging of manually-triggered workflows if the input option was provided | |
- name: Setup tmate session | |
uses: mxschmitt/action-tmate@v3 | |
if: ${{ github.event_name == 'workflow_dispatch' && github.event.inputs.debug_enabled }} | |
# Note that we are installing doxygen with apt here, and with conan in the Configure step. | |
# This is because there is no easy way of extracting the path to the doxygen executable from conan. | |
# the apt installed doxygen is used in the Make Docweb step to build the html files, | |
# while the conan installed version is used in the build step. | |
# The version we install from apt is older than the 1.9.4 we install from conan, but | |
# it is not causing any issues at the moment. | |
- name: Install dependencies | |
run: | | |
sudo apt update | |
sudo apt install openmpi-bin libopenmpi-dev libyaml-cpp-dev doxygen graphviz ccache | |
if [[ "$USE_CONAN" = 0 ]]; then | |
sudo apt install libeigen3-dev libspdlog-dev | |
fi | |
- name: Checkout Catch2 repo | |
uses: actions/checkout@v3 | |
if: env.USE_CONAN != '1' | |
with: | |
repository: catchorg/Catch2.git | |
path: Catch2 | |
ref: v3.4.0 | |
- name: Build Catch2 | |
if: env.USE_CONAN != '1' | |
run: | | |
mkdir Catch2/build | |
cd Catch2/build | |
cmake .. -DBUILD_TESTING=OFF -DCMAKE_INSTALL_PREFIX=${PWD} | |
make -j | |
make -j install | |
cd - | |
- name: Install Conan | |
id: conan | |
if: env.USE_CONAN != '0' | |
uses: turtlebrowser/get-conan@main | |
with: | |
version: 1.60.2 | |
#version: 2.0.9 | |
- name: Install Tensorflow API on Ubuntu | |
uses: UCL/install-tensorflow-action@main | |
with: | |
version: 2.11.0 | |
os: linux | |
- name: Checkout cppflow repo | |
uses: actions/checkout@v3 | |
with: | |
repository: UCL/cppflow.git | |
path: cppflow | |
#ref: master | |
ref: cg_cmake_tweaks | |
- name: Create cppflow package | |
run: | | |
if [[ "$USE_CONAN" = 1 ]]; then | |
#conan profile detect | |
#sed -i'' -e "s|generators|#generators|1" ./cppflow/conanfile.py | |
conan create ./cppflow/ -pr:h=default -pr:b=default | |
else | |
mkdir cppflow/build | |
cd cppflow/build | |
cmake .. -DCMAKE_INSTALL_PREFIX=${PWD} | |
make -j | |
make -j install | |
fi | |
- name: Configure | |
run: | | |
if [[ "$USE_CONAN" = 1 ]]; then | |
# Doxygen currently broken in Conan v1 and v2 | |
#conan install doxygen/1.9.4@#2af713e135f12722e3536808017ba086 --update | |
conan install ${{github.workspace}} -if ${{github.workspace}}/build --build missing -s compiler.libcxx=libstdc++11 -o mpi=off -o openmp=off -o docs=off -o cppflow=on -pr:h=default -pr:b=default | |
else | |
export PATH=${{github.workspace}}/cppflow/build:$PATH | |
export PATH=${{github.workspace}}/Catch2/build:$PATH | |
#export Catch2_DIR=${{github.workspace}}/Catch2/build/lib/cmake/Catch2:$CMAKE_MODULE_PATH | |
export Catch2_DIR=${{github.workspace}}/Catch2/build:$Catch2_DIR | |
mkdir ${{github.workspace}}/build | |
cd ${{github.workspace}}/build | |
cmake .. -DCMAKE_INSTALL_PREFIX=${PWD} -Ddompi=OFF -Dopenmp=OFF -Ddocs=ON -Dcppflow=ON | |
fi | |
- name: Build | |
run: | | |
if [[ "$USE_CONAN" = 1 ]]; then | |
conan build ${{github.workspace}} -bf ${{github.workspace}}/build | |
else | |
export PATH=${{github.workspace}}/cppflow/build:$PATH | |
export PATH=${{github.workspace}}/Catch2/build:$PATH | |
export CMAKE_MODULE_PATH=${{github.workspace}}/Catch2/build/lib/cmake/Catch2:$CMAKE_MODULE_PATH | |
#export CMAKE_MODULE_PATH=${{github.workspace}}/Catch2/build/lib/cmake/Catch2:$CMAKE_MODULE_PATH | |
cd ${{github.workspace}}/build | |
make -j | |
make -j install | |
fi | |
- name: Make Docweb | |
run: | | |
if [[ "$USE_CONAN" = 0 ]]; then | |
cd build | |
make docweb VERBOSE=1 | |
fi | |
- name: Deploy to GH pages | |
if: ${{github.event_name == 'push'}} | |
uses: JamesIves/[email protected] | |
with: | |
branch: gh-pages # The branch the action should deploy to. | |
folder: build/cpp/docs/html # The folder the action should deploy. |