-
Notifications
You must be signed in to change notification settings - Fork 174
191 lines (164 loc) · 6.66 KB
/
build-ubuntu.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
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
name: Build Ubuntu
on:
push:
pull_request:
jobs:
build-ubuntu:
strategy:
fail-fast: false
matrix:
os: [ubuntu-24.04, ubuntu-22.04, ubuntu-20.04]
runs-on: ${{ matrix.os }}
env:
# enable starting Qt GUI Applications
QT_QPA_PLATFORM: offscreen
PROJECT_NAME: ecal
steps:
- name: Install Dependencies
run: |
sudo apt update
if [ "${{ matrix.os }}" == "ubuntu-24.04" ]; then
sudo apt-get install ninja-build doxygen graphviz libcurl4-openssl-dev libprotobuf-dev libprotoc-dev protobuf-compiler libhdf5-dev libyaml-cpp-dev
sudo apt-get install qt6-base-dev qt6-svg-dev
sudo apt-get install libgtest-dev
sudo apt-get install python3 python3-venv python3-dev
elif [ "${{ matrix.os }}" == "ubuntu-22.04" ]; then
sudo apt-get install ninja-build doxygen graphviz libcurl4-openssl-dev libprotobuf-dev libprotoc-dev protobuf-compiler libhdf5-dev libyaml-cpp-dev
sudo apt-get install qtbase5-dev libqt5opengl5-dev libqt5svg5-dev
sudo apt-get install libgtest-dev
sudo apt-get install python3 python3-venv python3-dev
elif [ "${{ matrix.os }}" == "ubuntu-20.04" ]; then
sudo apt-get install ninja-build doxygen graphviz libcurl4-openssl-dev libprotobuf-dev libprotoc-dev protobuf-compiler libhdf5-dev libyaml-cpp-dev
sudo apt-get install qt5-default libqt5opengl5-dev libqt5svg5-dev
sudo apt-get install libgtest-dev
sudo apt-get install python3.9 python3.9-venv python3.9-dev
fi
- name: Set variables
run: |
if [ "${{ matrix.os }}" == "ubuntu-24.04" ]; then
echo "ubuntu_codename=noble" >> "$GITHUB_ENV"
echo "python_version=3" >> "$GITHUB_ENV" # => default python 3 version
elif [ "${{ matrix.os }}" == "ubuntu-22.04" ]; then
echo "ubuntu_codename=focal" >> "$GITHUB_ENV"
echo "python_version=3" >> "$GITHUB_ENV" # => default python 3 version
elif [ "${{ matrix.os }}" == "ubuntu-20.04" ]; then
echo "ubuntu_codename=jammy" >> "$GITHUB_ENV"
echo "python_version=3.9" >> "$GITHUB_ENV"
fi
# Get cpu architecture
echo "cpu_architecture=$(dpkg --print-architecture)" >> "$GITHUB_ENV"
- name: Install Cap'n Proto
run: |
mkdir "${{ runner.workspace }}/capnp"
cd "${{ runner.workspace }}/capnp"
curl -O https://capnproto.org/capnproto-c++-1.0.2.tar.gz
tar zxf capnproto-c++-1.0.2.tar.gz
cd capnproto-c++-1.0.2
./configure
make -j$(($(nproc)*2))
sudo make install
- 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/libssh2/libssh2
git submodule deinit thirdparty/protobuf/protobuf
git submodule deinit thirdparty/zlib/zlib
git submodule update
- name: Create venv for building docs
shell: bash
run: |
mkdir ".venv_build"
python${{ env.python_version }} -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 \
-DCMAKE_EXPORT_COMPILE_COMMANDS=ON \
-DHAS_HDF5=ON \
-DHAS_QT=ON \
-DHAS_CURL=ON \
-DHAS_CAPNPROTO=ON \
-DHAS_FTXUI=ON \
-DBUILD_DOCS=ON \
-DBUILD_APPS=ON \
-DBUILD_SAMPLES=ON \
-DBUILD_TIME=ON \
-DBUILD_PY_BINDING=ON \
-DBUILD_STANDALONE_PY_WHEEL=OFF \
-DBUILD_CSHARP_BINDING=OFF \
-DBUILD_ECAL_TESTS=ON \
-DECAL_INCLUDE_PY_SAMPLES=OFF \
-DECAL_INSTALL_SAMPLE_SOURCES=ON \
-DECAL_JOIN_MULTICAST_TWICE=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=OFF \
-DECAL_THIRDPARTY_BUILD_HDF5=OFF \
-DECAL_THIRDPARTY_BUILD_RECYCLE=ON \
-DECAL_THIRDPARTY_BUILD_TCP_PUBSUB=ON \
-DECAL_THIRDPARTY_BUILD_QWT=ON \
-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 Release
run: cmake --build . --parallel -- -k 0
working-directory: ${{ runner.workspace }}/_build
- name: Create config path and copy ecal.yaml
run: |
sudo mkdir /etc/ecal
sudo cp "./ecal/core/cfg/gen/ecal.yaml" /etc/ecal
working-directory: ${{ runner.workspace }}/_build
shell: bash
- name: Run Tests
run: ctest -V
working-directory: ${{ runner.workspace }}/_build
- name: Get Project version from git tag
shell: bash
run: |
# Use git describe to get the tag / commit description
VERSION="$(git describe --tags --dirty)"
# Remove the leading 'v' from the tag
VERSION="${VERSION#v}"
echo "PROJECT_VERSION=$VERSION" >> "$GITHUB_ENV"
- name: Set output binary name
shell: bash
run: |
echo "BINARY_NAME=${{ env.PROJECT_NAME }}_${{ env.PROJECT_VERSION }}-${{ env.ubuntu_codename }}_${{ env.cpu_architecture }}" >> "$GITHUB_ENV"
- name: CPack
run: cpack -G DEB
working-directory: ${{ runner.workspace }}/_build
- name: Rename .deb installer
run: |
mv *.deb '${{ env.BINARY_NAME }}.deb'
shell: bash
working-directory: ${{runner.workspace}}/_build/_deploy/
- name: Upload Debian
uses: actions/upload-artifact@v4
with:
name: '${{ env.BINARY_NAME }}'
path: ${{ runner.workspace }}/_build/_deploy/*.deb