-
Notifications
You must be signed in to change notification settings - Fork 36
195 lines (192 loc) · 7.37 KB
/
build.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
192
193
194
195
name: Build
on:
push:
branches: [ master ]
pull_request:
branches: [ master ]
workflow_dispatch:
env:
MM_DEFAULT_CONFIG: >-
-DMEGAMOL_VCPKG_DOWNLOAD_CACHE=ON
-DMEGAMOL_WARNING_LEVEL="Off"
-DMEGAMOL_PLUGIN_MEGAMOL101_GL=ON
-DMEGAMOL_PLUGIN_IMAGESERIES=ON
-DMEGAMOL_PLUGIN_IMAGESERIES_GL=ON
-DMEGAMOL_USE_CGAL=ON
-DMEGAMOL_USE_PROFILING=ON
-DMEGAMOL_USE_STACKTRACE=ON
-DMEGAMOL_USE_TRACY=ON
-DMEGAMOL_USE_VTKM=ON
MM_NO_GL_CONFIG: >-
-DMEGAMOL_VCPKG_DOWNLOAD_CACHE=ON
-DMEGAMOL_WARNING_LEVEL="Off"
-DMEGAMOL_USE_OPENGL=OFF
jobs:
vcpkg_cache:
# Skip on PR from forked repo as no secrets are available.
if: ${{ github.event_name != 'pull_request' || github.event.pull_request.head.repo.full_name == github.repository }}
strategy:
fail-fast: false
matrix:
job:
- name: 'Windows'
os: 'windows-2022'
container: ''
generator: 'Visual Studio 17 2022'
cc: ''
cxx: ''
ignore_features: 'MPI POWER'
- name: 'Ubuntu-GCC'
os: 'ubuntu-24.04'
container: 'ghcr.io/unistuttgart-visus/megamol_ci_ubuntu:master'
generator: 'Ninja'
cc: 'gcc-13'
cxx: 'g++-13'
ignore_features: 'CUESDK VR_INTEROP POWER'
- name: 'Ubuntu-Clang'
os: 'ubuntu-24.04'
container: 'ghcr.io/unistuttgart-visus/megamol_ci_ubuntu:master'
generator: 'Ninja'
cc: 'clang-18'
cxx: 'clang++-18'
ignore_features: 'CUESDK VR_INTEROP POWER'
name: "Vcpkg-${{ matrix.job.name }}"
runs-on: ${{ matrix.job.os }}
container:
image: ${{ matrix.job.container }}
steps:
- uses: actions/checkout@v4
with:
show-progress: false
- name: Download Vcpkg
# Download vcpkg in advance, to download only once. MegaMol will detect the vcpkg directory in the repo root
# folder automatically.
run: |
version=$(LC_ALL=C.UTF-8 grep -oP 'set\(MEGAMOL_VCPKG_VERSION "\K[^"]+' CMakeLists.txt)
git clone https://github.com/microsoft/vcpkg.git vcpkg
cd vcpkg && git reset --hard $version && cd ..
shell: bash
- name: Find MegaMol Feature Options
run: |
import json
with open('vcpkg.json') as f:
features = json.load(f)['features']
features = [f.upper().replace('-', '_') for f in features if 'dependencies' in features[f]]
ignored = '${{ matrix.job.ignore_features }}'.split()
features = [f for f in features if f not in ignored]
with open('MEGAMOL_FEATURES', 'w') as f:
f.write(' '.join(features))
shell: python3 {0}
- name: Build Vcpkg Ports
# Vcpkg ports may are required with different feature sets, based on the MegaMol features, e.g., `megamol`
# requires `a` and `megamol[foo]` requires `a[bar]`. We need to build both `a` and `a[foo]` for the cache. The
# problem extents to all transitive dependencies. Because we cannot try to build all possible combinations of
# enabled MegaMol features, we use the following heuristic to hopefully cover most cases: 1. MegaMol with no
# features, 2. MegaMol with all features, 3. For every feature MegaMol with only this feature enabled.
run: |
echo "::group::Build Cache No Features"
cmake -S . -B "$GITHUB_WORKSPACE/build" -G "${{ matrix.job.generator }}" \
-DMEGAMOL_STOP_AFTER_VCPKG=ON \
-DMEGAMOL_DISABLE_ALL_FEATURES=ON
rm -rf "$GITHUB_WORKSPACE/build"
echo "::endgroup::"
echo "::group::Build Cache All Features"
cmake -S . -B "$GITHUB_WORKSPACE/build" -G "${{ matrix.job.generator }}" \
-DMEGAMOL_STOP_AFTER_VCPKG=ON \
-DMEGAMOL_ENABLE_ALL_FEATURES=ON \
$(echo "${{ matrix.job.ignore_features }}" | sed -e 's/\([^ ]*\)/-DMEGAMOL_USE_\1=OFF/g')
rm -rf "$GITHUB_WORKSPACE/build"
echo "::endgroup::"
features=$(<MEGAMOL_FEATURES)
for feature in $features; do
echo "::group::Build Cache Feature $feature"
cmake -S . -B "$GITHUB_WORKSPACE/build" -G "${{ matrix.job.generator }}" \
-DMEGAMOL_STOP_AFTER_VCPKG=ON \
-DMEGAMOL_DISABLE_ALL_FEATURES=ON -DMEGAMOL_USE_$feature=ON
rm -rf "$GITHUB_WORKSPACE/build"
echo "::endgroup::"
done
shell: bash
env:
CC: ${{ matrix.job.cc }}
CXX: ${{ matrix.job.cxx }}
VCPKG_BINARY_SOURCES: "clear;http,https://vcpkg-cache.megamol.org/{triplet}-{name}-{sha},readwrite,Authorization: Token ${{ secrets.CACHING_SERVER_SECRET }}"
build_windows:
if: ${{ always() }}
needs: vcpkg_cache
strategy:
fail-fast: false
matrix:
job:
- name: Release
configuration: Release
no-gl: false
- name: Debug
configuration: Debug
no-gl: false
- name: Release-No-GL
configuration: Release
no-gl: true
name: "Windows (${{ matrix.job.name }})"
runs-on: windows-2022
steps:
- name: Install Ninja
run: |
$ninjaPath = "$env:RUNNER_WORKSPACE\ninja"
New-Item -ItemType Directory -Force -Path $ninjaPath
Invoke-WebRequest -Uri "https://github.com/ninja-build/ninja/releases/download/v1.12.1/ninja-win.zip" -OutFile "$ninjaPath\ninja.zip"
Expand-Archive -Path "$ninjaPath\ninja.zip" -DestinationPath $ninjaPath
Remove-Item "$ninjaPath\ninja.zip" -Force
echo "$ninjaPath" | Out-File -Append -FilePath $env:GITHUB_PATH
shell: pwsh
- uses: actions/checkout@v4
with:
show-progress: false
- name: Configure
run: >-
cmake -S . -B $GITHUB_WORKSPACE/build -G "Ninja"
${{ matrix.job.no-gl && env.MM_NO_GL_CONFIG || env.MM_DEFAULT_CONFIG }}
- name: Build
run: cmake --build $GITHUB_WORKSPACE/build --config ${{ matrix.job.configuration }} --parallel 2
build_linux:
if: ${{ always() }}
needs: vcpkg_cache
strategy:
fail-fast: false
matrix:
job:
- name: 'GCC13 Debug'
container: megamol_ci_ubuntu
cc: gcc-13
cxx: g++-13
configuration: Debug
no-gl: false
- name: 'Clang18 Release'
container: megamol_ci_ubuntu
cc: clang-18
cxx: clang++-18
configuration: Release
no-gl: false
- name: 'GCC13 Release No-GL'
container: megamol_ci_ubuntu
cc: gcc-13
cxx: g++-13
configuration: Release
no-gl: true
name: "Linux (${{ matrix.job.name }})"
runs-on: ubuntu-24.04
container:
image: ghcr.io/unistuttgart-visus/${{ matrix.job.container }}:master
steps:
- uses: actions/checkout@v4
with:
show-progress: false
- name: Configure
run: >-
cmake -S . -B $GITHUB_WORKSPACE/build -G Ninja -DCMAKE_BUILD_TYPE=${{ matrix.job.configuration }}
${{ matrix.job.no-gl && env.MM_NO_GL_CONFIG || env.MM_DEFAULT_CONFIG }}
- name: Build
run: cmake --build $GITHUB_WORKSPACE/build
env:
CC: ${{ matrix.job.cc }}
CXX: ${{ matrix.job.cxx }}