Skip to content

Commit 2eb650a

Browse files
committed
Testing - Ubuntu build validation #251
Add GitHub Actions workflow for Ubuntu build validation
1 parent 30a23ff commit 2eb650a

File tree

1 file changed

+178
-0
lines changed

1 file changed

+178
-0
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,178 @@
1+
# This workflow validates the build on the latest Ubuntu version (24.04) using multiple configurations.
2+
# It is triggered on pushes to the master branch.
3+
# The workflow includes steps to install dependencies, configure, build, and clean up the project for different configurations.
4+
5+
name: Ubuntu build validation
6+
7+
on:
8+
pull_request:
9+
branches:
10+
- '**'
11+
push:
12+
branches:
13+
- 'master'
14+
15+
concurrency:
16+
group: ${{ github.workflow }}-${{ github.event.pull_request.number }}
17+
cancel-in-progress: true
18+
19+
jobs:
20+
main_job:
21+
name: Latest ubuntu validation
22+
runs-on: ubuntu-24.04
23+
24+
strategy:
25+
matrix:
26+
config:
27+
- {
28+
name: "GCC",
29+
cc: "gcc",
30+
cxx: "g++"
31+
}
32+
- {
33+
name: "Clang",
34+
cc: "clang",
35+
cxx: "clang++"
36+
}
37+
38+
steps:
39+
- name: Checkout repository
40+
uses: actions/[email protected]
41+
42+
- name: Install dependencies
43+
run: sudo apt-get update && sudo apt-get install -y tcl-dev tk-dev cmake clang gcc g++ make libbtbb-dev libx11-dev libglu1-mesa-dev tcllib tcl-thread tcl libvtk9-dev libopenvr-dev libdraco-dev libfreeimage-dev libegl1-mesa-dev libgles2-mesa-dev libfreetype-dev libjemalloc-dev
44+
45+
- name: Install rapidjson
46+
run: |
47+
wget https://github.com/Tencent/rapidjson/archive/858451e5b7d1c56cf8f6d58f88cf958351837e53.zip -O rapidjson.zip
48+
unzip rapidjson.zip
49+
50+
- name: Configure basic
51+
run: |
52+
mkdir -p build
53+
cd build
54+
cmake -D CMAKE_C_COMPILER=${{ matrix.compiler }} -D CMAKE_CXX_COMPILER=${{ matrix.cxx_compiler }} ..
55+
56+
- name: Build basic
57+
run: |
58+
cd build
59+
cmake --build . -- -j
60+
61+
- name: Clear up after build
62+
run: |
63+
rm -rf build
64+
65+
- name: Configure full shared
66+
run: |
67+
mkdir -p build
68+
cd build
69+
cmake -G "Unix Makefiles" \
70+
-D CMAKE_C_COMPILER=${{ matrix.compiler }} \
71+
-D CMAKE_CXX_COMPILER=${{ matrix.cxx_compiler }} \
72+
-D BUILD_USE_PCH=OFF \
73+
-D BUILD_INCLUDE_SYMLINK=ON \
74+
-D BUILD_OPT_PROFILE=Production \
75+
-D BUILD_LIBRARY_TYPE=Shared \
76+
-D USE_TK=ON \
77+
-D CMAKE_BUILD_TYPE=Debug \
78+
-D USE_MMGR_TYPE=JEMALLOC \
79+
-D INSTALL_DIR=${{ github.workspace }}/install \
80+
-D 3RDPARTY_RAPIDJSON_DIR=${{ github.workspace }}/rapidjson-858451e5b7d1c56cf8f6d58f88cf958351837e53 \
81+
-D USE_FREETYPE=ON \
82+
-D USE_DRACO=ON \
83+
-D USE_FFMPEG=OFF \
84+
-D USE_FREEIMAGE=ON \
85+
-D USE_GLES2=ON \
86+
-D USE_OPENVR=ON \
87+
-D USE_VTK=ON \
88+
-D USE_TBB=ON \
89+
-D USE_RAPIDJSON=ON \
90+
-D USE_OPENGL=ON \
91+
-D CMAKE_CXX_FLAGS="-Werror -Wall -Wextra" \
92+
-D CMAKE_C_FLAGS="-Werror -Wall -Wextra" ..
93+
94+
- name: Build full shared
95+
run: |
96+
cd build
97+
cmake --build . --target install --config Debug -- -j
98+
99+
- name: Clear up after build
100+
run: |
101+
rm -rf build
102+
rm -rf ${{ github.workspace }}/install
103+
104+
- name: Configure full static
105+
run: |
106+
mkdir -p build
107+
cd build
108+
cmake -G "Unix Makefiles" \
109+
-D CMAKE_C_COMPILER=${{ matrix.compiler }} \
110+
-D CMAKE_CXX_COMPILER=${{ matrix.cxx_compiler }} \
111+
-D BUILD_USE_PCH=OFF \
112+
-D BUILD_INCLUDE_SYMLINK=ON \
113+
-D BUILD_OPT_PROFILE=Production \
114+
-D BUILD_LIBRARY_TYPE=Static \
115+
-D USE_TK=ON \
116+
-D CMAKE_BUILD_TYPE=Debug \
117+
-D USE_MMGR_TYPE=JEMALLOC \
118+
-D INSTALL_DIR=${{ github.workspace }}/install \
119+
-D 3RDPARTY_RAPIDJSON_DIR=${{ github.workspace }}/rapidjson-858451e5b7d1c56cf8f6d58f88cf958351837e53 \
120+
-D USE_FREETYPE=ON \
121+
-D USE_DRACO=ON \
122+
-D USE_FFMPEG=OFF \
123+
-D USE_FREEIMAGE=ON \
124+
-D USE_GLES2=ON \
125+
-D USE_OPENVR=ON \
126+
-D USE_VTK=ON \
127+
-D USE_TBB=ON \
128+
-D USE_RAPIDJSON=ON \
129+
-D USE_OPENGL=ON \
130+
-D CMAKE_CXX_FLAGS="-Werror -Wall -Wextra" \
131+
-D CMAKE_C_FLAGS="-Werror -Wall -Wextra" ..
132+
133+
- name: Build full static
134+
run: |
135+
cd build
136+
cmake --build . --target install --config Debug -- -j
137+
138+
- name: Clear up after build
139+
run: |
140+
rm -rf build
141+
rm -rf ${{ github.workspace }}/install
142+
143+
- name: Configure full with DEBUG define
144+
run: |
145+
mkdir -p build
146+
cd build
147+
cmake -G "Unix Makefiles" \
148+
-D CMAKE_C_COMPILER=${{ matrix.compiler }} \
149+
-D CMAKE_CXX_COMPILER=${{ matrix.cxx_compiler }} \
150+
-D BUILD_WITH_DEBUG=ON \
151+
-D BUILD_USE_PCH=OFF \
152+
-D BUILD_INCLUDE_SYMLINK=ON \
153+
-D BUILD_OPT_PROFILE=Production \
154+
-D BUILD_LIBRARY_TYPE=Shared \
155+
-D USE_TK=ON \
156+
-D CMAKE_BUILD_TYPE=Debug \
157+
-D INSTALL_DIR=${{ github.workspace }}/install \
158+
-D 3RDPARTY_RAPIDJSON_DIR=${{ github.workspace }}/rapidjson-858451e5b7d1c56cf8f6d58f88cf958351837e53 \
159+
-D USE_FREETYPE=ON \
160+
-D USE_DRACO=ON \
161+
-D USE_FFMPEG=OFF \
162+
-D USE_FREEIMAGE=ON \
163+
-D USE_GLES2=ON \
164+
-D USE_OPENVR=ON \
165+
-D USE_VTK=ON \
166+
-D USE_TBB=ON \
167+
-D USE_RAPIDJSON=ON \
168+
-D USE_OPENGL=ON ..
169+
170+
- name: Build full with DEBUG define
171+
run: |
172+
cd build
173+
cmake --build . --target install --config Debug -- -j
174+
175+
- name: Clear up after build
176+
run: |
177+
rm -rf build
178+
rm -rf ${{ github.workspace }}/install

0 commit comments

Comments
 (0)