Repository navigation
155 lines (136 loc) · 5.2 KB
/
Copy pathci.yml
File metadata and controls
155 lines (136 loc) · 5.2 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
name: CI
on:
push:
branches:
- master
pull_request:
workflow_dispatch:
permissions:
contents: read
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
build-test:
name: ${{ matrix.name }}
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
include:
- name: ubuntu-itk-v5.4.8
os: ubuntu-24.04
itk: v5.4.8
- name: ubuntu-itk-v5.4.8-serializer
os: ubuntu-24.04
itk: v5.4.8
serializer: true
install-development: true
- name: ubuntu-itk-main
os: ubuntu-24.04
itk: main
- name: macos-itk-v5.4.8
os: macos-14
itk: v5.4.8
install-development: true
- name: windows-itk-v5.4.8
os: windows-2022
itk: v5.4.8
install-development: true
defaults:
run:
shell: bash
env:
CMAKE_BUILD_PARALLEL_LEVEL: 4
steps:
- uses: actions/checkout@v4
with:
path: src
# A branch ref resolves to its current commit, so the cache follows ITK main.
- name: Resolve ITK ${{ matrix.itk }}
run: |
sha=$(git ls-remote https://github.com/InsightSoftwareConsortium/ITK.git \
"refs/heads/${{ matrix.itk }}" "refs/tags/${{ matrix.itk }}^{}" | head -n 1 | cut -f 1)
test -n "$sha"
echo "ITK_SHA=$sha" >> "$GITHUB_ENV"
# Only the ITK modules SlicerExecutionModel depends on are built.
# ITK sits under runner.temp: Windows limits the ITK source path to 50 characters.
- name: Restore ITK
id: cache-itk
uses: actions/cache@v4
with:
path: ${{ runner.temp }}/itk-install
key: itk-${{ env.ITK_SHA }}-${{ runner.os }}-v1
- name: Build ITK
if: steps.cache-itk.outputs.cache-hit != 'true'
run: |
cd "$RUNNER_TEMP"
git init -q itk-src
git -C itk-src fetch -q --depth 1 \
https://github.com/InsightSoftwareConsortium/ITK.git "$ITK_SHA"
git -C itk-src checkout -q FETCH_HEAD
cmake -S itk-src -B itk-build \
-DCMAKE_BUILD_TYPE:STRING=Release \
-DCMAKE_INSTALL_PREFIX:PATH="$RUNNER_TEMP/itk-install" \
-DBUILD_SHARED_LIBS:BOOL=OFF \
-DBUILD_TESTING:BOOL=OFF \
-DBUILD_EXAMPLES:BOOL=OFF \
-DITK_LEGACY_REMOVE:BOOL=ON \
-DITK_BUILD_DEFAULT_MODULES:BOOL=OFF \
-DITK_USE_SYSTEM_LIBRARIES:BOOL=OFF \
-DModule_ITKCommon:BOOL=ON \
-DModule_ITKIOXML:BOOL=ON \
-DModule_ITKExpat:BOOL=ON
cmake --build itk-build --config Release
cmake --install itk-build --config Release
- name: Build ParameterSerializer
if: matrix.serializer
run: |
sudo apt-get update
sudo apt-get install -y libjsoncpp-dev
git clone https://github.com/Slicer/ParameterSerializer.git ps-src
git -C ps-src checkout 3b40b7fb14f907341196eba870e857b292a01f4f
cmake -S ps-src -B ps-build \
-DCMAKE_BUILD_TYPE:STRING=Release \
-DCMAKE_POLICY_VERSION_MINIMUM:STRING=3.5 \
-DCMAKE_PREFIX_PATH:PATH="$RUNNER_TEMP/itk-install" \
-DBUILD_TESTING:BOOL=OFF
cmake --build ps-build
echo "SEM_EXTRA_ARGS=-DSlicerExecutionModel_USE_JSONCPP:BOOL=ON -DSlicerExecutionModel_USE_SERIALIZER:BOOL=ON -DParameterSerializer_DIR:PATH=$GITHUB_WORKSPACE/ps-build" >> "$GITHUB_ENV"
- name: Configure
run: |
cmake -S src -B build \
-DCMAKE_BUILD_TYPE:STRING=Release \
-DCMAKE_PREFIX_PATH:PATH="$RUNNER_TEMP/itk-install" \
-DBUILD_TESTING:BOOL=ON \
-DSlicerExecutionModel_INSTALL_NO_DEVELOPMENT:BOOL=${{ matrix.install-development && 'OFF' || 'ON' }} \
-DSITE:STRING=GitHubActions \
-DBUILDNAME:STRING="${{ matrix.name }}_${{ github.event.pull_request.number && format('PR{0}', github.event.pull_request.number) || github.ref_name }}" \
${SEM_EXTRA_ARGS}
- name: Build, test, and submit to CDash
working-directory: build
run: ctest --build-config Release --dashboard Experimental --output-on-failure --parallel 4
build-test-apt:
name: ubuntu-latest-itk-apt
runs-on: ubuntu-latest
env:
CMAKE_BUILD_PARALLEL_LEVEL: 4
steps:
- uses: actions/checkout@v4
with:
path: src
- name: Install ITK from APT
run: |
sudo apt-get update
sudo apt-get install -y libinsighttoolkit5-dev
dpkg-query -W libinsighttoolkit5-dev
- name: Configure
run: |
cmake -S src -B build \
-DCMAKE_BUILD_TYPE:STRING=Release \
-DBUILD_TESTING:BOOL=ON \
-DSITE:STRING=GitHubActions \
-DBUILDNAME:STRING="ubuntu-latest-itk-apt_${{ github.event.pull_request.number && format('PR{0}', github.event.pull_request.number) || github.ref_name }}"
- name: Build, test, and submit to CDash
working-directory: build
run: ctest --dashboard Experimental --output-on-failure --parallel 4