-
Notifications
You must be signed in to change notification settings - Fork 181
134 lines (119 loc) · 4.3 KB
/
documentation.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
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'