-
Notifications
You must be signed in to change notification settings - Fork 226
229 lines (207 loc) · 7.74 KB
/
BatchBuild.yml
File metadata and controls
229 lines (207 loc) · 7.74 KB
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
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
name: Batch Build and Test
on:
push:
branches: ['master', 'main', 'release']
pull_request:
paths:
- .github/workflows/BatchBuild.yml
# Enable manual running of workflow
workflow_dispatch:
concurrency:
group: '${{ github.workflow }}@${{ github.head_ref || github.ref }}'
cancel-in-progress: ${{ github.event_name == 'pull_request' }}
# Set minimal permissions for all jobs (read-only)
permissions:
contents: read
actions: read
env:
DEFAULT_PYTHON_VERSION: "3.11"
jobs:
build:
# The CMake configure and build commands are platform-agnostic and should work a cross
# platforms.
runs-on: ${{ matrix.os }}
env:
CTEST_SOURCE_DIRECTORY: "${{ github.workspace }}"
CTEST_BINARY_DIRECTORY: "${{ github.workspace }}/bld"
strategy:
fail-fast: false
max-parallel: 4
matrix:
include:
- os: mac-arm64
cmake-build-type: "Release"
cmake-generator: "Ninja"
cmake_osx_architectures: "arm64"
ctest-cache: |
WRAP_PYTHON:BOOL=ON
WRAP_JAVA:BOOL=ON
SimpleITK_USE_ELASTIX:BOOL=ON
- os: mac-arm64
cmake-build-type: "RelMinSize"
cmake-generator: "Ninja"
ctest-cache: |
WRAP_PYTHON:BOOL=ON
CMAKE_CXX_FLAGS:STRING=-fvisibility=hidden -fvisibility-inlines-hidden
CMAKE_C_FLAGS:STRING=-fvisibility=hidden
CMAKE_CXX_VISIBILITY_PRESET:STRING=hidden
CMAKE_VISIBILITY_INLINES_HIDDEN:BOOL=ON
CMAKE_OSX_ARCHITECTURES:STRING=x86_64
- os: windows-2022
cmake-build-type: "MinSizeRel"
cmake-generator: "Visual Studio 17 2022"
cmake-generator-toolset: v143,host=x64
cmake-generator-platform: x64
ctest-cache: |
SimpleITK_USE_ELASTIX:BOOL=ON
BUILD_EXAMPLES:BOOL=ON
CXXFLAGS:STRING= /wd4251 /MP
- os: windows-2022
cmake-build-type: "MinSizeRel"
cmake-generator: "Visual Studio 17 2022"
cmake-generator-toolset: v143,host=x64
cmake-generator-platform: x64
ctest-cache: |
WRAP_DEFAULT:BOOL=OFF
CXXFLAGS:STRING= /wd4251 /MP
BUILD_SHARED_LIBS:BOOL=ON
- os: windows-2022
cmake-build-type: "Release"
cmake-generator: "Visual Studio 17 2022"
cmake-generator-toolset: v142,host=x64
cmake-generator-platform: x64
ctest-cache: |
WRAP_CSHARP:BOOL=ON
WRAP_PYTHON:BOOL=ON
WRAP_JAVA:BOOL=ON
ITK_USE_BUILD_DIR:BOOL=ON
CXXFLAGS:STRING= /wd4251 /MP
- os: ubuntu-24.04-arm
cmake-build-type: "Release"
cmake-generator: "Ninja"
ctest-cache: |
WRAP_PYTHON:BOOL=ON
WRAP_JAVA:BOOL=ON
SimpleITK_USE_ELASTIX:BOOL=ON
- os: ubuntu-24.04
cmake-build-type: "Release"
cmake-generator: "Ninja"
apt-get-dependencies: "liblua5.3-dev lua5.3"
ctest-cache: |
WRAP_PYTHON:BOOL=ON
WRAP_LUA:BOOL=ON
SimpleITK_USE_ELASTIX:BOOL=ON
- os: ubuntu-24.04
cmake-build-type: "Release"
cmake-generator: "Ninja"
ctest-cache: |
ITK_GIT_TAG:STRING=main
- os: ubuntu-22.04
cmake-build-type: "Release"
cmake-generator: "Ninja"
CXX: "g++-10"
CC: "gcc-10"
ctest-cache: |
WRAP_DEFAULT:BOOL=OFF
- os: ubuntu-22.04
cmake-build-type: "Release"
cmake-generator: "Ninja"
CXX: "g++-12"
CC: "gcc-12"
ctest-cache: |
WRAP_DEFAULT:BOOL=OFF
- os: macos-15
cmake-build-type: "Release"
cmake-generator: "Ninja"
xcode-version: 16.4
ctest-cache: |
WRAP_PYTHON:BOOL=ON
- os: macos-14
cmake-build-type: "Release"
cmake-generator: "Ninja"
xcode-version: 15.4
python-version: "3.10"
ctest-cache: |
WRAP_PYTHON:BOOL=ON
- os: macos-14
cmake-build-type: "MinSizeRel"
cmake-generator: "Ninja"
xcode-version: 16.2
python-version: "3.13"
ctest-cache: |
WRAP_PYTHON:BOOL=ON
WRAP_JAVA:BOOL=ON
steps:
- uses: actions/checkout@v6
with:
fetch-depth: 0
ref: "${{ github.event.pull_request.head.sha }}"
- uses: actions/checkout@v6
with:
path: SimpleITK-dashboard
ref: dashboard
- name: Generate External Data Hash
shell: bash
run: |
git log -n 1 "${{ github.workspace }}/Testing/Data/" | tee "${{ github.workspace }}/external-data.hashable"
- uses: actions/cache@v5
id: cache
with:
path: ${{ runner.temp }}/.ExternalData
key: external-data-v1-${{ hashFiles( format( '{0}/{1}', github.workspace, 'external-data.hashable') ) }}
enableCrossOsArchive: true
restore-keys: |
external-data-v1-
- name: Set up Python ${{ matrix.python-version || env.DEFAULT_PYTHON_VERSION }}
uses: actions/setup-python@v6
id: cpy
with:
python-version: ${{ matrix.python-version || env.DEFAULT_PYTHON_VERSION }}
- name: Update Path for shared libraries
shell: bash
if: ${{ contains(matrix.ctest-cache, 'BUILD_SHARED_LIBS:BOOL=ON') && contains(matrix.os, 'windows') }}
run: |
echo "${{ env.CTEST_BINARY_DIRECTORY }}\ITK-prefix\bin" >> $GITHUB_PATH
echo "${{ env.CTEST_BINARY_DIRECTORY }}\SimpleITK-build\bin\${{ matrix.cmake-build-type }}" >> $GITHUB_PATH
- name: Install build dependencies
shell: bash
run: |
python -m pip install --upgrade pip
python -m pip install -r ./.github/workflows/requirements-build.txt
if [ ! -z "${{ matrix.xcode-version }}" ]; then
sudo xcode-select -s /Applications/Xcode_${{ matrix.xcode-version }}.app/Contents/Developer/
xcode-select -p
fi
if [ ! -z "${{ matrix.apt-get-dependencies }}" ]; then
sudo apt-get update
sudo apt-get install -y ${{ matrix.apt-get-dependencies }}
fi
- name: Build and Test
shell: bash
env:
DASHBOARD_BRANCH_DIRECTORY: "${{ github.workspace }}/SimpleITK-dashboard"
ITK_GLOBAL_DEFAULT_NUMBER_OF_THREADS: 2
CTEST_CONFIGURATION_TYPE: ${{ matrix.cmake-build-type }}
CTEST_CMAKE_GENERATOR: "${{ matrix.cmake-generator }}"
CTEST_CMAKE_GENERATOR_TOOLSET: "${{ matrix.cmake-generator-toolset }}"
CTEST_CMAKE_GENERATOR_PLATFORM: "${{ matrix.cmake-generator-platform }}"
CTEST_OUTPUT_ON_FAILURE: 1
CTEST_CACHE: |
WRAP_DEFAULT:BOOL=OFF
BUILD_EXAMPLES:BOOL=ON
BUILD_TESTING:BOOL=ON
Python_EXECUTABLE:FILEPATH=${{ steps.cpy.outputs.python-path }}
${{ matrix.ctest-cache }}
run: |
if [ ! -z "${{ matrix.GCC }} ]; then
export CC=${{ matrix.CC }}
fi
if [ ! -z "${{ matrix.CXX }} ]; then
export CXX=${{ matrix.CXX }}
fi
if [ ! -z "${{ matrix.cmake_build_parallel_level }}" ]; then
export CMAKE_BUILD_PARALLEL_LEVEL=${{ matrix.cmake_build_parallel_level }}
fi
cmake --version
ninja --version
ctest -S ${CTEST_SOURCE_DIRECTORY}/.github/workflows/github_actions.cmake -V -j 2