@@ -3,280 +3,10 @@ name: Build, test, package
33on : [push,pull_request]
44
55jobs :
6- build-test-cxx :
7- runs-on : ${{ matrix.os }}
8- strategy :
9- max-parallel : 3
10- matrix :
11- os : [ubuntu-18.04, windows-2019, macos-10.15]
12- include :
13- - os : ubuntu-18.04
14- c-compiler : " gcc"
15- cxx-compiler : " g++"
16- itk-git-tag : " d6acfd26bfcdec606d605beb1301bddfb17c05a6"
17- cmake-build-type : " MinSizeRel"
18- - os : windows-2019
19- c-compiler : " cl.exe"
20- cxx-compiler : " cl.exe"
21- itk-git-tag : " d6acfd26bfcdec606d605beb1301bddfb17c05a6"
22- cmake-build-type : " Release"
23- - os : macos-10.15
24- c-compiler : " clang"
25- cxx-compiler : " clang++"
26- itk-git-tag : " d6acfd26bfcdec606d605beb1301bddfb17c05a6"
27- cmake-build-type : " MinSizeRel"
6+ cxx-build-workflow :
7+ uses : InsightSoftwareConsortium/ITKRemoteModuleBuildTestPackageAction/.github/workflows/build-test-cxx.yml@edd0a4350396f533e9ec3755ed6c5af5ddfedb97
288
29- steps :
30- - uses : actions/checkout@v1
31-
32- - name : Set up Python 3.8
33- uses : actions/setup-python@v2
34- with :
35- python-version : 3.8
36-
37- - name : Install build dependencies
38- run : |
39- python -m pip install --upgrade pip
40- python -m pip install ninja
41-
42- - name : Get specific version of CMake, Ninja
43- uses : lukka/get-cmake@v3.18.3
44-
45- - name : Download ITK
46- run : |
47- cd ..
48- git clone https://github.com/InsightSoftwareConsortium/ITK.git
49- cd ITK
50- git checkout ${{ matrix.itk-git-tag }}
51-
52- - name : Build ITK
53- if : matrix.os != 'windows-2019'
54- run : |
55- cd ..
56- mkdir ITK-build
57- cd ITK-build
58- cmake -DCMAKE_C_COMPILER:FILEPATH="${{ matrix.c-compiler }}" -DBUILD_SHARED_LIBS:BOOL=ON -DCMAKE_CXX_COMPILER="${{ matrix.cxx-compiler }}" -DCMAKE_BUILD_TYPE:STRING=${{ matrix.cmake-build-type }} -DBUILD_TESTING:BOOL=OFF -GNinja ../ITK
59- ninja
60-
61- - name : Build ITK
62- if : matrix.os == 'windows-2019'
63- run : |
64- cd ..
65- mkdir ITK-build
66- cd ITK-build
67- call "C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\VC\Auxiliary\Build\vcvars64.bat"
68- cmake -DCMAKE_C_COMPILER:FILEPATH="${{ matrix.c-compiler }}" -DBUILD_SHARED_LIBS:BOOL=ON -DCMAKE_CXX_COMPILER="${{ matrix.cxx-compiler }}" -DCMAKE_BUILD_TYPE:STRING=${{ matrix.cmake-build-type }} -DBUILD_TESTING:BOOL=OFF -GNinja ../ITK
69- ninja
70- shell : cmd
71-
72- - name : Fetch CTest driver script
73- run : |
74- curl -L https://raw.githubusercontent.com/InsightSoftwareConsortium/ITK/dashboard/itk_common.cmake -O
75-
76- - name : Configure CTest script
77- shell : bash
78- run : |
79- operating_system="${{ matrix.os }}"
80- cat > dashboard.cmake << EOF
81- set(CTEST_SITE "GitHubActions")
82- file(TO_CMAKE_PATH "\$ENV{GITHUB_WORKSPACE}/.." CTEST_DASHBOARD_ROOT)
83- file(TO_CMAKE_PATH "\$ENV{GITHUB_WORKSPACE}/" CTEST_SOURCE_DIRECTORY)
84- file(TO_CMAKE_PATH "\$ENV{GITHUB_WORKSPACE}/../build" CTEST_BINARY_DIRECTORY)
85- set(dashboard_source_name "${GITHUB_REPOSITORY}")
86- if(ENV{GITHUB_REF} MATCHES "master")
87- set(branch "-master")
88- set(dashboard_model "Continuous")
89- else()
90- set(branch "-${GITHUB_REF}")
91- set(dashboard_model "Experimental")
92- endif()
93- set(CTEST_BUILD_NAME "${GITHUB_REPOSITORY}-${operating_system}-\${branch}")
94- set(CTEST_UPDATE_VERSION_ONLY 1)
95- set(CTEST_TEST_ARGS \${CTEST_TEST_ARGS} PARALLEL_LEVEL \${PARALLEL_LEVEL})
96- set(CTEST_BUILD_CONFIGURATION "Release")
97- set(CTEST_CMAKE_GENERATOR "Ninja")
98- set(CTEST_CUSTOM_WARNING_EXCEPTION
99- \${CTEST_CUSTOM_WARNING_EXCEPTION}
100- # macOS Azure VM Warning
101- "ld: warning: text-based stub file"
102- )
103- set(dashboard_no_clean 1)
104- set(ENV{CC} ${{ matrix.c-compiler }})
105- set(ENV{CXX} ${{ matrix.cxx-compiler }})
106- if(WIN32)
107- set(ENV{PATH} "\${CTEST_DASHBOARD_ROOT}/ITK-build/bin;\$ENV{PATH}")
108- endif()
109- set(dashboard_cache "
110- ITK_DIR:PATH=\${CTEST_DASHBOARD_ROOT}/ITK-build
111- Module_IsotropicWavelets_BUILD_EXAMPLES:BOOL=ON
112- BUILD_TESTING:BOOL=ON
113- ")
114- string(TIMESTAMP build_date "%Y-%m-%d")
115- message("CDash Build Identifier: \${build_date} \${CTEST_BUILD_NAME}")
116- message("CTEST_SITE = \${CTEST_SITE}")
117- include(\${CTEST_SCRIPT_DIRECTORY}/itk_common.cmake)
118- EOF
119- cat dashboard.cmake
120-
121- - name : Build and test
122- if : matrix.os != 'windows-2019'
123- run : |
124- ctest --output-on-failure -j 2 -V -S dashboard.cmake
125-
126- - name : Build and test
127- if : matrix.os == 'windows-2019'
128- run : |
129- call "C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\VC\Auxiliary\Build\vcvars64.bat"
130- ctest --output-on-failure -j 2 -V -S dashboard.cmake
131- shell : cmd
132-
133- build-linux-python-packages :
134- runs-on : ubuntu-20.04
135- strategy :
136- max-parallel : 2
137- matrix :
138- python-version : [37, 38, 39, 310]
139- include :
140- - itk-python-git-tag : " v5.3rc04"
141-
142- steps :
143- - uses : actions/checkout@v2
144-
145- - name : ' Free up disk space'
146- run : |
147- # Workaround for https://github.com/actions/virtual-environments/issues/709
148- df -h
149- sudo apt-get clean
150- sudo rm -rf "/usr/local/share/boost"
151- sudo rm -rf "$AGENT_TOOLSDIRECTORY"
152- df -h
153-
154- - name : ' Fetch build script'
155- run : |
156- curl -L https://raw.githubusercontent.com/InsightSoftwareConsortium/ITKPythonPackage/master/scripts/dockcross-manylinux-download-cache-and-build-module-wheels.sh -O
157- chmod u+x dockcross-manylinux-download-cache-and-build-module-wheels.sh
158-
159- - name : ' Build 🐍 Python 📦 package'
160- run : |
161- export ITK_PACKAGE_VERSION=${{ matrix.itk-python-git-tag }}
162- ./dockcross-manylinux-download-cache-and-build-module-wheels.sh cp${{ matrix.python-version }}
163-
164- - name : Publish Python package as GitHub Artifact
165- uses : actions/upload-artifact@v1
166- with :
167- name : LinuxWheel${{ matrix.python-version }}
168- path : dist
169-
170- build-macos-python-packages :
171- runs-on : macos-10.15
172- strategy :
173- max-parallel : 2
174- matrix :
175- include :
176- - itk-python-git-tag : " v5.3rc04"
177-
178- steps :
179- - uses : actions/checkout@v2
180-
181- - name : ' Specific XCode version'
182- run : |
183- sudo xcode-select -s "/Applications/Xcode_11.7.app"
184-
185- - name : Get specific version of CMake, Ninja
186- uses : lukka/get-cmake@v3.18.3
187-
188- - name : ' Fetch build script'
189- run : |
190- curl -L https://raw.githubusercontent.com/InsightSoftwareConsortium/ITKPythonPackage/master/scripts/macpython-download-cache-and-build-module-wheels.sh -O
191- chmod u+x macpython-download-cache-and-build-module-wheels.sh
192-
193- - name : ' Build 🐍 Python 📦 package'
194- run : |
195- export ITK_PACKAGE_VERSION=${{ matrix.itk-python-git-tag }}
196- export MACOSX_DEPLOYMENT_TARGET=10.9
197- ./macpython-download-cache-and-build-module-wheels.sh
198-
199- - name : Publish Python package as GitHub Artifact
200- uses : actions/upload-artifact@v1
201- with :
202- name : MacOSWheels
203- path : dist
204-
205- build-windows-python-packages :
206- runs-on : windows-2019
207- strategy :
208- max-parallel : 2
209- matrix :
210- python-version-minor : [7, 8, 9, 10]
211- include :
212- - itk-python-git-tag : " v5.3rc04"
213-
214- steps :
215- - name : Get specific version of CMake, Ninja
216- uses : lukka/get-cmake@v3.18.3
217-
218- - uses : actions/checkout@v2
219- with :
220- path : " im"
221-
222- - name : ' Install Python'
223- run : |
224- $pythonArch = "64"
225- $pythonVersion = "3.${{ matrix.python-version-minor }}"
226- iex ((new-object net.webclient).DownloadString('https://raw.githubusercontent.com/scikit-build/scikit-ci-addons/master/windows/install-python.ps1'))
227-
228- - name : ' Fetch build dependencies'
229- shell : bash
230- run : |
231- mv im ../../
232- cd ../../
233- curl -L "https://github.com/InsightSoftwareConsortium/ITKPythonBuilds/releases/download/${{ matrix.itk-python-git-tag }}/ITKPythonBuilds-windows.zip" -o "ITKPythonBuilds-windows.zip"
234- 7z x ITKPythonBuilds-windows.zip -o/c/P -aoa -r
235- curl -L "https://data.kitware.com/api/v1/file/5c0ad59d8d777f2179dd3e9c/download" -o "doxygen-1.8.11.windows.bin.zip"
236- 7z x doxygen-1.8.11.windows.bin.zip -o/c/P/doxygen -aoa -r
237- curl -L "https://data.kitware.com/api/v1/file/5bbf87ba8d777f06b91f27d6/download/grep-win.zip" -o "grep-win.zip"
238- 7z x grep-win.zip -o/c/P/grep -aoa -r
239-
240- - name : ' Build 🐍 Python 📦 package'
241- shell : cmd
242- run : |
243- cd ../../im
244- call "C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\VC\Auxiliary\Build\vcvars64.bat"
245- set PATH=C:\P\grep;%PATH%
246- set CC=cl.exe
247- set CXX=cl.exe
248- C:\Python3${{ matrix.python-version-minor }}-x64\python.exe C:\P\IPP\scripts\windows_build_module_wheels.py --py-envs "3${{ matrix.python-version-minor }}-x64" --no-cleanup
249-
250- - name : Publish Python package as GitHub Artifact
251- uses : actions/upload-artifact@v1
252- with :
253- name : WindowsWheel3.${{ matrix.python-version-minor }}
254- path : ../../im/dist
255-
256- publish-python-packages-to-pypi :
257- needs :
258- - build-linux-python-packages
259- - build-macos-python-packages
260- - build-windows-python-packages
261- runs-on : ubuntu-18.04
262-
263- steps :
264- - name : Download Python Packages
265- uses : actions/download-artifact@v2
266-
267- - name : Prepare packages for upload
268- run : |
269- ls -R
270- for d in */; do
271- mv ${d}/*.whl .
272- done
273- mkdir dist
274- mv *.whl dist/
275- ls dist
276-
277- - name : Publish 🐍 Python 📦 package to PyPI
278- if : github.event_name == 'push' && startsWith(github.event.ref, 'refs/tags')
279- uses : pypa/gh-action-pypi-publish@master
280- with :
281- user : __token__
282- password : ${{ secrets.pypi_password }}
9+ python-build-workflow :
10+ uses : InsightSoftwareConsortium/ITKRemoteModuleBuildTestPackageAction/.github/workflows/build-test-package-python.yml@edd0a4350396f533e9ec3755ed6c5af5ddfedb97
11+ secrets :
12+ pypi_password : ${{ secrets.pypi_password }}
0 commit comments