Repository navigation
146 lines (140 loc) · 4.83 KB
/
Copy pathBuild.yml
File metadata and controls
146 lines (140 loc) · 4.83 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
name: Build and Test
on:
push:
branches: ['master', 'main', 'release']
pull_request:
branches: [ 'master', 'main', 'release' ]
paths-ignore:
- 'Testing/CI/**'
- 'docs/**'
- 'Documentation/**'
- 'Utilities/**'
- '*.rst'
- '.github/**'
- '!.github/workflows/Build.yml'
concurrency:
group: '${{ github.workflow }}@${{ github.head_ref || github.ref }}'
cancel-in-progress: true
# Set minimal permissions for all jobs (read-only)
permissions:
contents: read
actions: read
jobs:
build:
# The CMake configure and build commands are platform-agnostic and should work a cross
# platforms.
if: github.repository == 'SimpleITK/SimpleITK'
runs-on: ${{ matrix.os }}
env:
CTEST_SOURCE_DIRECTORY: "${{ github.workspace }}"
strategy:
max-parallel: 5
matrix:
include:
- os: mac-arm64
cmake-build-type: "RelMinSize"
cmake-generator: "Ninja"
ctest-cache: |
WRAP_PYTHON:BOOL=ON
WRAP_JAVA:BOOL=ON
WRAP_TCL:BOOL=ON
WRAP_RUBY: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
SimpleITK_EXPLICIT_INSTANTIATION:BOOL=ON
- os: ubuntu-24.04
cmake-build-type: "Release"
cmake-generator: "Ninja"
cmake_build_parallel_level: 6
ctest-cache: |
WRAP_PYTHON:BOOL=ON
WRAP_R:BOOL=ON
SimpleITK_USE_ELASTIX:BOOL=ON
- os: ubuntu-24.04-arm
cmake-build-type: "Release"
cmake-generator: "Ninja"
ctest-cache: |
WRAP_PYTHON:BOOL=ON
WRAP_JAVA:BOOL=ON
ITK_USE_BUILD_DIR:BOOL=ON
- os: macos-13
cmake-build-type: "Release"
cmake-generator: "Ninja"
ctest-cache: |
WRAP_PYTHON:BOOL=ON
WRAP_JAVA:BOOL=ON
WRAP_CSHARP: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_PYTHON:BOOL=ON
WRAP_JAVA:BOOL=ON
WRAP_CSHARP:BOOL=ON
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
ref: "${{ github.event.pull_request.head.sha }}"
- uses: actions/checkout@v4
with:
path: SimpleITK-dashboard
ref: dashboard
- name: Install R
if: contains(matrix.ctest-cache, 'WRAP_R')
uses: r-lib/actions/setup-r@v2
with:
r-version: 'latest'
- name: Install Examples R package dependencies
if: contains(matrix.ctest-cache, 'WRAP_R')
run: |
Rscript -e 'install.packages(c("argparser"))'
- name: Generate External Data Hash
shell: bash
run: |
mkdir -p ${{ runner.temp }}/.ExternalData
ls -la "${{ github.workspace }}/Testing/Data/"
git log -n 1 "${{ github.workspace }}/Testing/Data/" | tee "${{ github.workspace }}/external-data.hashable"
- uses: actions/cache@v4
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 3.11
uses: actions/setup-python@v5
id: cpy
with:
python-version: 3.11
- name: Install build dependencies
run: |
python -m pip install --upgrade pip
python -m pip install -r ./.github/workflows/requirements-build.txt
- name: Build and Test
shell: bash
env:
DASHBOARD_BRANCH_DIRECTORY: "${{ github.workspace }}/SimpleITK-dashboard"
ExternalData_OBJECT_STORES: "${{ runner.temp }}/.ExternalData"
ITK_GLOBAL_DEFAULT_NUMBER_OF_THREADS: 2
CTEST_CONFIGURATION_TYPE: ${{ matrix.cmake-build-type }}
CTEST_CMAKE_GENERATOR: "${{ matrix.cmake-generator }}"
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.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 -VV