forked from InsightSoftwareConsortium/ITK
-
Notifications
You must be signed in to change notification settings - Fork 1
252 lines (222 loc) · 8.64 KB
/
Copy patharm.yml
File metadata and controls
252 lines (222 loc) · 8.64 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
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
name: ITK.Arm64
on:
push:
branches:
- main
- 'release*'
paths-ignore:
- '*.md'
- LICENSE
- NOTICE
- 'Documentation/**'
- 'Utilities/Debugger/**'
- 'Utilities/ITKv5Preparation/**'
- 'Utilities/Maintenance/**'
- 'Modules/Remote/*.remote.cmake'
pull_request:
paths-ignore:
- '*.md'
- LICENSE
- NOTICE
- 'Documentation/**'
- 'Utilities/Debugger/**'
- 'Utilities/ITKv5Preparation/**'
- 'Utilities/Maintenance/**'
- 'Modules/Remote/*.remote.cmake'
concurrency:
group: '${{ github.workflow }}@${{ github.head_ref || github.ref }}'
cancel-in-progress: ${{ github.event_name == 'pull_request' }}
env:
CMakeVersion: "4.0.1"
jobs:
build:
runs-on: ${{ matrix.os }}
timeout-minutes: 600
strategy:
fail-fast: false
matrix:
include:
- os: ubuntu-24.04-arm
name: "Ubuntu-24.04-arm"
cmake-build-type: "Release"
cmake-generator: "Ninja"
python-version: ""
parallel-level: 4
ctest-cache: |
BUILD_SHARED_LIBS:BOOL=OFF
BUILD_EXAMPLES:BOOL=OFF
ITK_WRAP_PYTHON:BOOL=OFF
ITK_USE_CLANG_FORMAT:BOOL=OFF
ITK_COMPUTER_MEMORY_SIZE:STRING=11
ctest-options: ""
- os: macos-15
name: "x86_64-rosetta"
cmake-build-type: "Release"
cmake-generator: "Ninja"
python-version: ""
parallel-level: 3
ctest-cache: |
BUILD_SHARED_LIBS:BOOL=OFF
BUILD_EXAMPLES:BOOL=OFF
ITK_WRAP_PYTHON:BOOL=OFF
ITK_USE_CLANG_FORMAT:BOOL=OFF
CMAKE_OSX_ARCHITECTURES:STRING=x86_64
ITK_COMPUTER_MEMORY_SIZE:STRING=11
ctest-options: ""
- os: macos-15
name: "Python"
cmake-build-type: "Release"
cmake-generator: "Ninja"
python-version: "3.11"
parallel-level: 3
ctest-cache: |
BUILD_SHARED_LIBS:BOOL=OFF
BUILD_EXAMPLES:BOOL=OFF
ITK_WRAP_PYTHON:BOOL=ON
ITK_USE_CLANG_FORMAT:BOOL=OFF
ITK_COMPUTER_MEMORY_SIZE:STRING=11
ctest-options: "-E itkPyBufferMemoryLeakTest"
name: ARMBUILD-${{ matrix.name }}
steps:
- name: Checkout
uses: actions/checkout@v5
with:
fetch-depth: 5
clean: true
- name: Install ccache
shell: bash
run: |
echo "CCACHE_BASEDIR=${GITHUB_WORKSPACE}" >> "$GITHUB_ENV"
echo "CCACHE_COMPILERCHECK=content" >> "$GITHUB_ENV"
echo "CCACHE_NOHASHDIR=true" >> "$GITHUB_ENV"
echo "CCACHE_SLOPPINESS=pch_defines,time_macros" >> "$GITHUB_ENV"
echo "CCACHE_DIR=${{ runner.temp }}/ccache" >> "$GITHUB_ENV"
echo "CCACHE_MAXSIZE=5G" >> "$GITHUB_ENV"
if [ "$RUNNER_OS" == "Linux" ]; then
sudo mkdir -p /etc/apt/apt.conf.d
echo 'Acquire::ForceIPv4 "true";' | sudo tee /etc/apt/apt.conf.d/99force-ipv4 >/dev/null
echo 'Acquire::Retries "5";' | sudo tee /etc/apt/apt.conf.d/80-retries >/dev/null
for i in 1 2 3; do
sudo apt-get update -qq && sudo apt-get install -y --no-install-recommends ccache locales && break
echo "apt attempt $i failed; retrying..."
[ "$i" -lt 3 ] && sleep $((i * 10))
done
command -v ccache >/dev/null || { echo "ccache install failed"; exit 1; }
command -v locale-gen >/dev/null || { echo "locales install failed"; exit 1; }
sudo locale-gen de_DE.UTF-8
elif [ "$RUNNER_OS" == "macOS" ]; then
brew install ccache
fi
- name: Restore compiler cache
id: restore-ccache
uses: actions/cache/restore@v5
with:
path: ${{ runner.temp }}/ccache
key: ccache-v4-${{ runner.os }}-${{ matrix.name }}-${{ github.sha }}
restore-keys: |
ccache-v4-${{ runner.os }}-${{ matrix.name }}-
- name: Restore ExternalData object store
id: restore-externaldata
uses: actions/cache/restore@v5
with:
# ExternalData blobs are platform-agnostic; share a single cache
# entry across every workflow/job/OS in the repo. The SHA suffix
# produces an immutable save key per run; restore-keys falls
# through to the most recent prior cache under the same version.
path: ${{ runner.temp }}/ExternalData
key: externaldata-v1-${{ hashFiles('**/*.cid') }}
restore-keys: |
externaldata-v1-
- name: Show ccache configuration, stats and maintenance
shell: bash
run: |
ccache --zero-stats
ccache --evict-older-than 7d
ccache --show-config
- name: Set up Python
if: matrix.python-version != ''
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
- name: Install Python dependencies
if: matrix.python-version != ''
run: |
set -x
python3 -m pip install --upgrade --pre numpy
- name: Get specific version of CMake, latest Ninja
uses: lukka/get-cmake@v4.0.1
with:
cmakeVersion: ~${{ env.CMakeVersion }}
ninjaVersion: latest
- name: Download dashboard script
run: |
set -x
git clone -b dashboard --single-branch https://github.com/InsightSoftwareConsortium/ITK.git ITK-dashboard
- name: Export ExternalData_OBJECT_STORES
shell: bash
run: |
echo "ExternalData_OBJECT_STORES=${{ runner.temp }}/ExternalData" >> "$GITHUB_ENV"
- name: Configure CTest script
run: |
cat > ITK-dashboard/dashboard.cmake << EOF
set(CTEST_BUILD_CONFIGURATION "${{ matrix.cmake-build-type }}")
set(CTEST_CMAKE_GENERATOR "${{ matrix.cmake-generator }}")
set(dashboard_cache "
${{ matrix.ctest-cache }}
CMAKE_C_COMPILER_LAUNCHER:STRING=ccache
CMAKE_CXX_COMPILER_LAUNCHER:STRING=ccache
")
include(${{ github.workspace }}/ITK-dashboard/github_actions_dashboard.cmake)
EOF
cat ITK-dashboard/dashboard.cmake
- name: Build and test
run: |
set -x
c++ --version
cmake --version
ctest -S ${{ github.workspace }}/ITK-dashboard/dashboard.cmake -V -j ${{ matrix.parallel-level }} ${{ matrix.ctest-options }}
env:
CTEST_OUTPUT_ON_FAILURE: 1
- name: Report build warnings and errors
if: always()
run: python3 ${{ github.workspace }}/Testing/ContinuousIntegration/report_build_diagnostics.py ${{ github.workspace }}/build
- name: Save compiler cache
if: ${{ !cancelled() }}
uses: actions/cache/save@v5
with:
path: ${{ runner.temp }}/ccache
key: ccache-v4-${{ runner.os }}-${{ matrix.name }}-${{ github.sha }}
# ExternalData object store is populated by
# .github/workflows/populate-externaldata-cache.yml — a dedicated
# workflow whose only job is to prefetch every CID and write the
# shared cache entry. Consumer workflows (this one, pixi.yml, the
# Azure pipelines) restore-only. Do not reintroduce a Save step
# here: races across platforms overwrite the single shared key with
# a fraction of the expected blobs and poison every subsequent
# restore.
- name: ccache stats
if: always()
run: ccache --show-stats
prune-superseded-caches:
# Background housekeeping: removes ccache entries whose SHA-suffixed
# key has been superseded by a newer build of the same (ref, OS).
# ccache restore-keys still falls back to the newest prefix match,
# so older entries are dead weight under the 10 GB repo cache budget.
needs: build
if: always()
runs-on: ubuntu-24.04
permissions:
actions: write
contents: read
continue-on-error: true
steps:
- name: Checkout maintenance script
uses: actions/checkout@v5
with:
sparse-checkout: Utilities/Maintenance/PruneSupersededCiCaches.py
sparse-checkout-cone-mode: false
- name: Prune superseded ccache entries
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
GITHUB_REPOSITORY: ${{ github.repository }}
run: python3 Utilities/Maintenance/PruneSupersededCiCaches.py