|
| 1 | + |
1 | 2 | name: Build, test, package
|
2 | 3 |
|
3 | 4 | on: [push,pull_request]
|
4 | 5 |
|
5 | 6 | jobs:
|
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" |
28 |
| - |
29 |
| - steps: |
30 |
| - - uses: actions/checkout@v1 |
31 |
| - |
32 |
| - - name: Set up Python 3.7 |
33 |
| - uses: actions/setup-python@v1 |
34 |
| - with: |
35 |
| - python-version: 3.7 |
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 |
| - |
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=OFF -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=OFF -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 |
| - BUILD_TESTING:BOOL=ON |
112 |
| - ") |
113 |
| - string(TIMESTAMP build_date "%Y-%m-%d") |
114 |
| - message("CDash Build Identifier: \${build_date} \${CTEST_BUILD_NAME}") |
115 |
| - message("CTEST_SITE = \${CTEST_SITE}") |
116 |
| - include(\${CTEST_SCRIPT_DIRECTORY}/itk_common.cmake) |
117 |
| - EOF |
118 |
| - cat dashboard.cmake |
119 |
| -
|
120 |
| - - name: Build and test |
121 |
| - if: matrix.os != 'windows-2019' |
122 |
| - run: | |
123 |
| - ctest --output-on-failure -j 2 -V -S dashboard.cmake |
124 |
| -
|
125 |
| - - name: Build and test |
126 |
| - if: matrix.os == 'windows-2019' |
127 |
| - run: | |
128 |
| - call "C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\VC\Auxiliary\Build\vcvars64.bat" |
129 |
| - ctest --output-on-failure -j 2 -V -S dashboard.cmake |
130 |
| - shell: cmd |
131 |
| - |
132 |
| - build-linux-python-packages: |
133 |
| - runs-on: ubuntu-18.04 |
134 |
| - strategy: |
135 |
| - max-parallel: 2 |
136 |
| - matrix: |
137 |
| - python-version: [37, 38, 39, 310] |
138 |
| - include: |
139 |
| - - itk-python-git-tag: "v5.3rc04" |
140 |
| - |
141 |
| - steps: |
142 |
| - - uses: actions/checkout@v2 |
143 |
| - |
144 |
| - - name: 'Free up disk space' |
145 |
| - run: | |
146 |
| - # Workaround for https://github.com/actions/virtual-environments/issues/709 |
147 |
| - df -h |
148 |
| - sudo apt-get clean |
149 |
| - sudo rm -rf "/usr/local/share/boost" |
150 |
| - sudo rm -rf "$AGENT_TOOLSDIRECTORY" |
151 |
| - df -h |
152 |
| -
|
153 |
| - - name: 'Fetch build script' |
154 |
| - run: | |
155 |
| - curl -L https://raw.githubusercontent.com/InsightSoftwareConsortium/ITKPythonPackage/master/scripts/dockcross-manylinux-download-cache-and-build-module-wheels.sh -O |
156 |
| - chmod u+x dockcross-manylinux-download-cache-and-build-module-wheels.sh |
157 |
| -
|
158 |
| - - name: 'Build 🐍 Python 📦 package' |
159 |
| - run: | |
160 |
| - export ITK_PACKAGE_VERSION=${{ matrix.itk-python-git-tag }} |
161 |
| - ./dockcross-manylinux-download-cache-and-build-module-wheels.sh cp${{ matrix.python-version }} |
162 |
| -
|
163 |
| - - name: Publish Python package as GitHub Artifact |
164 |
| - uses: actions/upload-artifact@v1 |
165 |
| - with: |
166 |
| - name: LinuxWheel${{ matrix.python-version }} |
167 |
| - path: dist |
168 |
| - |
169 |
| - build-macos-python-packages: |
170 |
| - runs-on: macos-10.15 |
171 |
| - strategy: |
172 |
| - max-parallel: 2 |
173 |
| - matrix: |
174 |
| - include: |
175 |
| - - itk-python-git-tag: "v5.3rc04" |
176 |
| - |
177 |
| - steps: |
178 |
| - - uses: actions/checkout@v2 |
179 |
| - |
180 |
| - - name: 'Specific XCode version' |
181 |
| - run: | |
182 |
| - sudo xcode-select -s "/Applications/Xcode_11.7.app" |
183 |
| -
|
184 |
| - - name: Get specific version of CMake, Ninja |
185 |
| - |
186 |
| - |
187 |
| - - name: 'Fetch build script' |
188 |
| - run: | |
189 |
| - curl -L https://raw.githubusercontent.com/InsightSoftwareConsortium/ITKPythonPackage/master/scripts/macpython-download-cache-and-build-module-wheels.sh -O |
190 |
| - chmod u+x macpython-download-cache-and-build-module-wheels.sh |
191 |
| -
|
192 |
| - - name: 'Build 🐍 Python 📦 package' |
193 |
| - run: | |
194 |
| - export ITK_PACKAGE_VERSION=${{ matrix.itk-python-git-tag }} |
195 |
| - export MACOSX_DEPLOYMENT_TARGET=10.9 |
196 |
| - ./macpython-download-cache-and-build-module-wheels.sh |
197 |
| -
|
198 |
| - - name: Publish Python package as GitHub Artifact |
199 |
| - uses: actions/upload-artifact@v1 |
200 |
| - with: |
201 |
| - name: MacOSWheels |
202 |
| - path: dist |
203 |
| - |
204 |
| - build-windows-python-packages: |
205 |
| - runs-on: windows-2019 |
206 |
| - strategy: |
207 |
| - max-parallel: 2 |
208 |
| - matrix: |
209 |
| - python-version-minor: [7, 8, 9, 10] |
210 |
| - include: |
211 |
| - - itk-python-git-tag: "v5.3rc04" |
212 |
| - |
213 |
| - steps: |
214 |
| - - uses: actions/checkout@v2 |
215 |
| - with: |
216 |
| - path: "im" |
217 |
| - |
218 |
| - - name: 'Install Python' |
219 |
| - run: | |
220 |
| - $pythonArch = "64" |
221 |
| - $pythonVersion = "3.${{ matrix.python-version-minor }}" |
222 |
| - iex ((new-object net.webclient).DownloadString('https://raw.githubusercontent.com/scikit-build/scikit-ci-addons/master/windows/install-python.ps1')) |
223 |
| -
|
224 |
| - - name: 'Fetch build dependencies' |
225 |
| - shell: bash |
226 |
| - run: | |
227 |
| - mv im ../../ |
228 |
| - cd ../../im |
229 |
| - curl -L "https://github.com/InsightSoftwareConsortium/ITKPythonBuilds/releases/download/${{ matrix.itk-python-git-tag }}/ITKPythonBuilds-windows.zip" -o "ITKPythonBuilds-windows.zip" |
230 |
| - 7z x ITKPythonBuilds-windows.zip -o/c/P -aoa -r |
231 |
| - curl -L "https://data.kitware.com/api/v1/file/5c0ad59d8d777f2179dd3e9c/download" -o "doxygen-1.8.11.windows.bin.zip" |
232 |
| - 7z x doxygen-1.8.11.windows.bin.zip -o/c/P/doxygen -aoa -r |
233 |
| - curl -L "https://data.kitware.com/api/v1/file/5bbf87ba8d777f06b91f27d6/download/grep-win.zip" -o "grep-win.zip" |
234 |
| - 7z x grep-win.zip -o/c/P/grep -aoa -r |
235 |
| -
|
236 |
| - - name: 'Build 🐍 Python 📦 package' |
237 |
| - shell: cmd |
238 |
| - run: | |
239 |
| - cd ../../im |
240 |
| - call "C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\VC\Auxiliary\Build\vcvars64.bat" |
241 |
| - set PATH=C:\P\grep;%PATH% |
242 |
| - set CC=cl.exe |
243 |
| - set CXX=cl.exe |
244 |
| - 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" |
245 |
| -
|
246 |
| - - name: Publish Python package as GitHub Artifact |
247 |
| - uses: actions/upload-artifact@v1 |
248 |
| - with: |
249 |
| - name: WindowsWheel3.${{ matrix.python-version-minor }} |
250 |
| - path: ../../im/dist |
251 |
| - |
252 |
| - publish-python-packages-to-pypi: |
253 |
| - needs: |
254 |
| - - build-linux-python-packages |
255 |
| - - build-macos-python-packages |
256 |
| - - build-windows-python-packages |
257 |
| - runs-on: ubuntu-18.04 |
258 |
| - |
259 |
| - steps: |
260 |
| - - name: Download Python Packages |
261 |
| - uses: actions/download-artifact@v2 |
262 |
| - |
263 |
| - - name: Prepare packages for upload |
264 |
| - run: | |
265 |
| - ls -R |
266 |
| - for d in */; do |
267 |
| - mv ${d}/*.whl . |
268 |
| - done |
269 |
| - mkdir dist |
270 |
| - mv *.whl dist/ |
271 |
| - ls dist |
272 |
| -
|
273 |
| - - name: Publish 🐍 Python 📦 package to PyPI |
274 |
| - if: github.event_name == 'push' && startsWith(github.event.ref, 'refs/tags') |
275 |
| - uses: pypa/gh-action-pypi-publish@master |
276 |
| - with: |
277 |
| - user: __token__ |
278 |
| - password: ${{ secrets.pypi_password }} |
| 7 | + cxx-build-workflow: |
| 8 | + uses: InsightSoftwareConsortium/ITKRemoteModuleBuildTestPackageAction/.github/workflows/[email protected] |
| 9 | + |
| 10 | + python-build-workflow: |
| 11 | + uses: InsightSoftwareConsortium/ITKRemoteModuleBuildTestPackageAction/.github/workflows/[email protected] |
| 12 | + with: |
| 13 | + test-notebooks: false |
| 14 | + secrets: |
| 15 | + pypi_password: ${{ secrets.pypi_password }} |
0 commit comments