Skip to content

Commit 372894c

Browse files
committed
add cmake build workflow
1 parent 625bcf6 commit 372894c

1 file changed

Lines changed: 193 additions & 0 deletions

File tree

.github/workflows/cmake.yml

Lines changed: 193 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,193 @@
1+
name: CMake Build and Test
2+
3+
on:
4+
push:
5+
branches: [ master ]
6+
pull_request:
7+
branches: [ master ]
8+
9+
jobs:
10+
build:
11+
# The CMake configure and build commands are platform agnostic and should work equally
12+
# well on Windows or Mac. You can convert this to a matrix build if you need
13+
# cross-platform coverage.
14+
# See: https://docs.github.com/en/free-pro-team@latest/actions/learn-github-actions/managing-complex-workflows#using-a-build-matrix
15+
runs-on: ${{ matrix.os }}
16+
name: ${{matrix.build_type}} on ${{matrix.os}}
17+
18+
strategy:
19+
fail-fast: false
20+
21+
matrix:
22+
os: [ubuntu-latest]
23+
variant: [All]
24+
build_type: [Release]
25+
c_compiler: [gcc, clang]
26+
use_cuda: [OFF]
27+
use_qt5: [OFF]
28+
use_deskvox: [OFF]
29+
BUILD_energy: [ON]
30+
build_arrow: [ON]
31+
test_energy: [ON]
32+
debug_ennovatis: [ON]
33+
drivingsim: [OFF]
34+
include:
35+
- os: 'ubuntu-latest'
36+
c_compiler: gcc
37+
cxx_compiler: g++
38+
- os: 'ubuntu-latest'
39+
c_compiler: clang
40+
cxx_compiler: clang++
41+
42+
43+
steps:
44+
- name: Show info
45+
if: runner.os == 'Linux'
46+
run: |
47+
cat /etc/apt/apt.conf || true
48+
cat /etc/apt/apt.conf.d/* || true
49+
ls -l /etc/apt/sources.list && cat /etc/apt/sources.list || true
50+
ls -l /etc/apt/sources.list.d/* && cat /etc/apt/sources.list.d/* || true
51+
52+
- name: Clean apt
53+
if: runner.os == 'Linux'
54+
run: >
55+
sudo apt-get clean && sudo rm -rf /etc/apt/sources.list.d/microsoft-prod.list && sudo rm -rf /var/lib/apt/lists/* && sudo rm -f /etc/apt/sources.list.d/archive_uri-* && sudo apt-get clean
56+
57+
- name: Install Arrow
58+
if: runner.os == 'Linux'
59+
run: >
60+
sudo apt install -y -V ca-certificates lsb-release wget && UBUNTU_VERSION=$(lsb_release --codename --short) && wget "https://apache.jfrog.io/artifactory/arrow/$(lsb_release --id --short | tr 'A-Z' 'a-z')/apache-arrow-apt-source-latest-${UBUNTU_VERSION}.deb" && sudo apt install -y -V "./apache-arrow-apt-source-latest-${UBUNTU_VERSION}.deb" && sudo apt update && sudo apt install libarrow-dev
61+
62+
- name: Install Linux Dependencies
63+
if: runner.os == 'Linux'
64+
run: >
65+
sudo apt-get update && sudo apt-get install
66+
ninja-build
67+
libglew-dev
68+
libxerces-c-dev
69+
libpng-dev
70+
swig
71+
libopenscenegraph-dev
72+
libtbb-dev
73+
libjpeg-dev
74+
libtiff-dev
75+
libopenmpi-dev
76+
libassimp-dev
77+
libboost-all-dev
78+
libcgal-dev
79+
libtinyxml2-dev
80+
libturbojpeg0-dev
81+
libfftw3-dev
82+
libarchive-dev
83+
libbotan-2-dev
84+
libavcodec-dev
85+
libcfitsio-dev
86+
libsnappy-dev
87+
libproj-dev
88+
libgdal-dev
89+
libeigen3-dev
90+
libsdl2-dev
91+
libblas-dev
92+
libvncserver-dev
93+
libaudiofile-dev
94+
libavformat-dev
95+
libavutil-dev
96+
libswscale-dev
97+
libhdf5-openmpi-dev
98+
libnetcdf-mpi-dev
99+
libnetcdf-c++4-dev
100+
libcgns-dev
101+
libalut-dev
102+
libfreetype-dev
103+
libomp-dev
104+
nlohmann-json3-dev
105+
qt6-base-dev
106+
qt6-tools-dev
107+
qt6-connectivity-dev
108+
qt6-declarative-dev
109+
qt6-multimedia-dev
110+
qt6-networkauth-dev
111+
qt6-quick3d-dev
112+
qt6-sensors-dev
113+
qt6-serialbus-dev
114+
qt6-serialport-dev
115+
qt6-speech-dev
116+
qt6-svg-dev
117+
qt6-virtualkeyboard-dev
118+
qt6-wayland-dev
119+
qt6-webengine-dev
120+
qt6-websockets-dev
121+
qt6-webview-dev
122+
123+
- name: Free disk space
124+
if: runner.os == 'Linux'
125+
uses: jlumbroso/free-disk-space@main
126+
with:
127+
# this might remove tools that are actually needed, but frees about 6 GB
128+
tool-cache: false
129+
# all of these default to true, but feel free to set to "false" if necessary for your workflow
130+
android: true
131+
dotnet: true
132+
haskell: true
133+
large-packages: false
134+
docker-images: true
135+
swap-storage: true
136+
137+
- name: Checkout repository's master branch
138+
uses: actions/checkout@v4
139+
with:
140+
ref: 'master'
141+
142+
- name: Sync and update submodules recursive
143+
uses: actions/checkout@v4
144+
with:
145+
submodules: 'recursive'
146+
147+
- name: ccache
148+
uses: hendrikmuhs/ccache-action@v1.2
149+
with:
150+
key: ${{ runner.os }}-${{ matrix.build_type }}
151+
max-size: "1000M"
152+
153+
- name: Create Build Environment
154+
# Some projects don't allow in-source building, so create a separate build directory
155+
# We'll use this as our working directory for all subsequent commands
156+
run: cmake -E make_directory ${{runner.workspace}}/build
157+
158+
- name: Configure CMake
159+
# Use a bash shell so we can use the same syntax for environment variable
160+
# access regardless of the host operating system
161+
shell: bash
162+
working-directory: ${{runner.workspace}}/build
163+
# Note the current convention is to use the -S and -B options here to specify source
164+
# and build directories, but this is only available with CMake 3.13 and higher.
165+
# The CMake binaries on the Github Actions machines are (as of this writing) 3.12
166+
run: >
167+
cmake -G Ninja
168+
$GITHUB_WORKSPACE
169+
-DCMAKE_CXX_COMPILER=${{matrix.cxx_compiler}}
170+
-DCMAKE_C_COMPILER=${{matrix.c_compiler}}
171+
-DCMAKE_C_COMPILER_LAUNCHER=ccache
172+
-DCMAKE_CXX_COMPILER_LAUNCHER=ccache
173+
-DCMAKE_BUILD_TYPE=${{matrix.build_type}}
174+
-DCOVISE_BUILD_DRIVINGSIM=${{matrix.drivingsim}}
175+
-DCOVISE_USE_QT5=${{matrix.use_qt5}}
176+
-DCOVISE_USE_CUDA=${{matrix.use_cuda}}
177+
-DBUILD_ENERGY=${{matrix.build_energy}}
178+
-DBUILD_ARROW=${{matrix.build_arrow}}
179+
-DTEST_ENERGYCAMPUS=${{matrix.test_energy}}
180+
-DDEBUG_ENNOVATIS=${{matrix.debug_ennovatis}}
181+
-Wno-dev
182+
183+
- name: Build
184+
working-directory: ${{runner.workspace}}/build
185+
shell: bash
186+
# Execute the build. You can specify a specific target with "--target <NAME>"
187+
run: cmake --build . --config ${{matrix.build_type}}
188+
189+
- name: Run Energy Tests
190+
working-directory: ${{runner.workspace}}/build/src/OpenCOVER/plugins/hlrs/Energy/test
191+
shell: bash
192+
# Execute the build. You can specify a specific target with "--target <NAME>"
193+
run: ctest .

0 commit comments

Comments
 (0)