Skip to content

Make ct happy again. #820

Make ct happy again.

Make ct happy again. #820

Workflow file for this run

name: Documentation build
on:
push:
# release:
# types:
# - released
# - unpublished
# - deleted
jobs:
documentation-build:
runs-on: ubuntu-latest
steps:
- name: Get current branch name
id: branch
run: |
# Get the branch name
branch=$(echo ${GITHUB_REF#refs/heads/})
# if the branch is a support/ branch, then set the doc_version
if [[ $branch == support/* ]]; then
echo "doc_version=$(echo ${branch#support/})" >> $GITHUB_ENV
echo "publish_dir=$(echo ${branch#support/})" >> $GITHUB_ENV
echo "publish_doc=true" >> $GITHUB_ENV
elif [[ $branch == master ]]; then
echo "doc_version=v999.0" >> $GITHUB_ENV
echo "publish_dir=latest" >> $GITHUB_ENV
echo "publish_doc=true" >> $GITHUB_ENV
else
echo "publish_doc=false" >> $GITHUB_ENV
fi
- name: Install Dependencies
run: |
sudo apt update
sudo apt-get install ninja-build doxygen graphviz libprotobuf-dev libprotoc-dev protobuf-compiler libhdf5-dev
- name: Checkout
uses: actions/checkout@v4
with:
submodules: 'false'
fetch-depth: 0
- name: Update / download Submodules (selected ones)
run: |
cd $GITHUB_WORKSPACE
git submodule init
git submodule deinit thirdparty/curl/curl
git submodule deinit thirdparty/gtest/googletest
git submodule deinit thirdparty/hdf5/hdf5
git submodule deinit thirdparty/protobuf/protobuf
git submodule update
- name: Install Python requirements
shell: bash
run: |
sudo apt-get -y install python3-dev python3-venv
mkdir ".venv_build"
python3 -m venv ".venv_build"
source ".venv_build/bin/activate"
pip install --upgrade pip
pip install wheel setuptools
pip install -r "$GITHUB_WORKSPACE/doc/requirements.txt"
- name: CMake
run: |
source ".venv_build/bin/activate"
mkdir "${{ runner.workspace }}/_build"
cd "${{ runner.workspace }}/_build"
cmake $GITHUB_WORKSPACE -G "Ninja" \
-DCMAKE_PROJECT_TOP_LEVEL_INCLUDES=cmake/submodule_dependencies.cmake \
-DHAS_HDF5=ON \
-DHAS_QT=OFF \
-DHAS_CURL=OFF \
-DHAS_CAPNPROTO=OFF \
-DHAS_FTXUI=ON \
-DBUILD_DOCS=ON \
-DBUILD_APPS=OFF \
-DBUILD_SAMPLES=OFF \
-DBUILD_TIME=OFF \
-DBUILD_PY_BINDING=ON \
-DBUILD_CSHARP_BINDING=OFF \
-DBUILD_ECAL_TESTS=OFF \
-DECAL_INSTALL_SAMPLE_SOURCES=OFF \
-DECAL_NPCAP_SUPPORT=OFF \
-DECAL_THIRDPARTY_BUILD_CMAKE_FUNCTIONS=ON \
-DECAL_THIRDPARTY_BUILD_PROTOBUF=OFF \
-DECAL_THIRDPARTY_BUILD_SPDLOG=ON \
-DECAL_THIRDPARTY_BUILD_TINYXML2=ON \
-DECAL_THIRDPARTY_BUILD_FINEFTP=ON \
-DECAL_THIRDPARTY_BUILD_CURL=OFF \
-DECAL_THIRDPARTY_BUILD_GTEST=ON \
-DECAL_THIRDPARTY_BUILD_HDF5=OFF \
-DECAL_THIRDPARTY_BUILD_RECYCLE=ON \
-DECAL_THIRDPARTY_BUILD_TCP_PUBSUB=ON \
-DECAL_THIRDPARTY_BUILD_QWT=OFF \
-DCMAKE_BUILD_TYPE=Release \
-DCMAKE_INSTALL_SYSCONFDIR=/etc \
-DCMAKE_INSTALL_PREFIX=/usr \
-DCMAKE_INSTALL_LOCALSTATEDIR=/var \
-DCMAKE_INSTALL_LIBDIR=lib/x86_64-linux-gnu \
-DPython_FIND_VIRTUALENV=ONLY
shell: bash
- name: Build Documentation
env:
ECAL_GH_API_KEY: ${{ secrets.GITHUB_TOKEN }}
ECAL_DOC_VERSION: ${{ env.doc_version }}
run: cmake --build . --parallel --config Release --target documentation_sphinx
working-directory: ${{ runner.workspace }}/_build
- name: Zip Documentation
run: |
cd ${{ runner.workspace }}/_build/doc/html
zip -r ${{ runner.workspace }}/_build/doc/html.zip .
- name: Upload Documentation as Artifact
uses: actions/upload-artifact@v4
with:
name: documentation
path: ${{ runner.workspace }}/_build/doc/html.zip
- name: Deploy Documentation
uses: peaceiris/actions-gh-pages@v3
with:
publish_branch: gh-pages
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: ${{ runner.workspace }}/_build/doc/html
destination_dir: ${{ env.publish_dir }}
if: env.publish_doc == 'true'