Skip to content

Commit 13120f0

Browse files
blowekampdzenanz
authored andcommitted
ENH: USE GHA hosted mac-15 to cross build for intel
Refactor the actions yaml to use a matrix build.
1 parent 32ca591 commit 13120f0

1 file changed

Lines changed: 92 additions & 60 deletions

File tree

.github/workflows/macos-arm.yml

Lines changed: 92 additions & 60 deletions
Original file line numberDiff line numberDiff line change
@@ -29,65 +29,97 @@ concurrency:
2929

3030
env:
3131
ExternalDataVersion: 5.4.0
32+
CMakeVersion: "4.0.1"
3233

3334
jobs:
34-
macOS-Python:
35-
runs-on: macos-14
36-
timeout-minutes: 0
37-
steps:
38-
- name: Checkout
39-
uses: actions/checkout@v4
40-
with:
41-
fetch-depth: 5
42-
clean: true
43-
44-
- name: Set up Python
45-
uses: actions/setup-python@v5
46-
with:
47-
python-version: '3.11'
48-
49-
- name: Install dependencies
50-
run: |
51-
set -x
52-
python3 -m pip install --upgrade --pre numpy
53-
54-
- name: Get specific version of CMake, latest Ninja
55-
uses: lukka/get-cmake@v4.0.1
56-
with:
57-
cmakeVersion: "~4.0.1"
58-
ninjaVersion: latest
59-
60-
- name: Download dashboard script and testing data
61-
run: |
62-
set -x
63-
git clone -b dashboard --single-branch https://github.com/InsightSoftwareConsortium/ITK.git ITK-dashboard
64-
65-
curl -L https://github.com/InsightSoftwareConsortium/ITK/releases/download/v${{ env.ExternalDataVersion }}/InsightData-${{ env.ExternalDataVersion }}.tar.gz -O
66-
cmake -E tar xfz InsightData-${{ env.ExternalDataVersion }}.tar.gz
67-
cmake -E rename InsightToolkit-${{ env.ExternalDataVersion }}/.ExternalData/CID ${{ github.workspace }}/.ExternalData/CID
68-
69-
- name: Configure CTest script
70-
run: |
71-
cat > ITK-dashboard/dashboard.cmake << EOF
72-
set(CTEST_BUILD_CONFIGURATION "Release")
73-
set(CTEST_CMAKE_GENERATOR "Ninja")
74-
set(dashboard_cache "
75-
BUILD_SHARED_LIBS:BOOL=OFF
76-
BUILD_EXAMPLES:BOOL=OFF
77-
ITK_WRAP_PYTHON:BOOL=ON
78-
ITK_USE_CLANG_FORMAT:BOOL=OFF
79-
")
80-
include(${{ github.workspace }}/ITK-dashboard/github_actions_dashboard.cmake)
81-
EOF
82-
cat ITK-dashboard/dashboard.cmake
83-
84-
- name: Build and test
85-
run: |
86-
set -x
87-
88-
c++ --version
89-
cmake --version
90-
91-
ctest -S ${{ github.workspace }}/ITK-dashboard/dashboard.cmake -VV -j 4 -E itkPyBufferMemoryLeakTest
92-
env:
93-
CTEST_OUTPUT_ON_FAILURE: 1
35+
build:
36+
runs-on: ${{ matrix.os }}
37+
timeout-minutes: 0
38+
39+
strategy:
40+
fail-fast: false
41+
matrix:
42+
include:
43+
- os: macos-15
44+
name: "x86_64-rosetta"
45+
cmake-build-type: "Release"
46+
cmake-generator: "Ninja"
47+
python-version: ""
48+
ctest-cache: |
49+
BUILD_SHARED_LIBS:BOOL=OFF
50+
BUILD_EXAMPLES:BOOL=OFF
51+
ITK_WRAP_PYTHON:BOOL=OFF
52+
ITK_USE_CLANG_FORMAT:BOOL=OFF
53+
CMAKE_OSX_ARCHITECTURES:STRING=x86_64
54+
ctest-options: ""
55+
56+
- os: macos-14
57+
name: "Python"
58+
cmake-build-type: "Release"
59+
cmake-generator: "Ninja"
60+
python-version: "3.11"
61+
ctest-cache: |
62+
BUILD_SHARED_LIBS:BOOL=OFF
63+
BUILD_EXAMPLES:BOOL=OFF
64+
ITK_WRAP_PYTHON:BOOL=ON
65+
ITK_USE_CLANG_FORMAT:BOOL=OFF
66+
ctest-options: "-E itkPyBufferMemoryLeakTest"
67+
68+
name: macOS-${{ matrix.name }}
69+
70+
steps:
71+
- name: Checkout
72+
uses: actions/checkout@v4
73+
with:
74+
fetch-depth: 5
75+
clean: true
76+
77+
- name: Set up Python
78+
if: matrix.python-version != ''
79+
uses: actions/setup-python@v5
80+
with:
81+
python-version: ${{ matrix.python-version }}
82+
83+
- name: Install Python dependencies
84+
if: matrix.python-version != ''
85+
run: |
86+
set -x
87+
python3 -m pip install --upgrade --pre numpy
88+
89+
- name: Get specific version of CMake, latest Ninja
90+
uses: lukka/get-cmake@v4.0.1
91+
with:
92+
cmakeVersion: ~${{ env.CMakeVersion }}
93+
ninjaVersion: latest
94+
95+
- name: Download dashboard script and testing data
96+
run: |
97+
set -x
98+
git clone -b dashboard --single-branch https://github.com/InsightSoftwareConsortium/ITK.git ITK-dashboard
99+
100+
curl -L https://github.com/InsightSoftwareConsortium/ITK/releases/download/v${{ env.ExternalDataVersion }}/InsightData-${{ env.ExternalDataVersion }}.tar.gz -O
101+
cmake -E tar xfz InsightData-${{ env.ExternalDataVersion }}.tar.gz
102+
cmake -E rename InsightToolkit-${{ env.ExternalDataVersion }}/.ExternalData/CID ${{ github.workspace }}/.ExternalData/CID
103+
104+
- name: Configure CTest script
105+
run: |
106+
cat > ITK-dashboard/dashboard.cmake << EOF
107+
set(CTEST_BUILD_CONFIGURATION "${{ matrix.cmake-build-type }}")
108+
set(CTEST_CMAKE_GENERATOR "${{ matrix.cmake-generator }}")
109+
set(dashboard_cache "
110+
${{ matrix.ctest-cache }}
111+
")
112+
include(${{ github.workspace }}/ITK-dashboard/github_actions_dashboard.cmake)
113+
EOF
114+
cat ITK-dashboard/dashboard.cmake
115+
116+
- name: Build and test
117+
run: |
118+
set -x
119+
120+
c++ --version
121+
cmake --version
122+
123+
ctest -S ${{ github.workspace }}/ITK-dashboard/dashboard.cmake -VV -j 4 ${{ matrix.ctest-options }}
124+
env:
125+
CTEST_OUTPUT_ON_FAILURE: 1

0 commit comments

Comments
 (0)