Skip to content

Commit 67c5ebf

Browse files
committed
WIP: CXX vs Python workflows
1 parent 99fc57f commit 67c5ebf

File tree

2 files changed

+162
-47
lines changed

2 files changed

+162
-47
lines changed

.github/workflows/build-test-package.yml renamed to .github/workflows/build-test-cxx.yml

Lines changed: 1 addition & 47 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
name: 'Build, Test, Package ITK Remote Module'
1+
name: 'Build, Test, Package ITK Remote Module'
22

33
on:
44
workflow_call:
@@ -13,10 +13,6 @@ on:
1313
required: false
1414
type: string
1515
default: '835dc01388d22c4b4c9a46b01dbdfe394ec23511'
16-
itk-wheel-tag:
17-
required: false
18-
type: string
19-
default: 'v5.3rc04.post2'
2016

2117
jobs:
2218
build-test-cxx:
@@ -142,45 +138,3 @@ jobs:
142138
call "C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\VC\Auxiliary\Build\vcvars64.bat"
143139
ctest --output-on-failure -j 2 -V -S dashboard.cmake
144140
shell: cmd
145-
146-
echo-linux-python:
147-
runs-on: ubuntu-20.04
148-
strategy:
149-
max-parallel: 2
150-
matrix:
151-
python-version: [37, 38, 39, 310]
152-
153-
steps:
154-
- name: 'Echo version'
155-
shell: bash
156-
run: |
157-
echo "OS ${{ runner.os }}"
158-
echo "Python version ${{ matrix.python-version }}"
159-
echo "ITK wheel tag ${{ inputs.itk-wheel-tag }}"
160-
161-
echo-macos-python:
162-
runs-on: macos-10.15
163-
strategy:
164-
max-parallel: 2
165-
166-
steps:
167-
- name: 'Echo version'
168-
shell: bash
169-
run: |
170-
echo "OS ${{ runner.os }}"
171-
echo "ITK wheel tag ${{ inputs.itk-wheel-tag }}"
172-
173-
build-windows-python-packages:
174-
runs-on: windows-2019
175-
strategy:
176-
max-parallel: 2
177-
matrix:
178-
python-version-minor: [7, 8, 9, 10]
179-
180-
steps:
181-
- name: 'Echo version'
182-
shell: bash
183-
run: |
184-
echo "OS ${{ runner.os }}"
185-
echo "Python version ${{ matrix.python-version-minor }}"
186-
echo "ITK wheel tag ${{ inputs.itk-wheel-tag }}"
Lines changed: 161 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,161 @@
1+
name: 'Build, Test, Package ITK Remote Module'
2+
3+
on:
4+
workflow_call:
5+
inputs:
6+
cmake-options:
7+
required: false
8+
type: string
9+
itk-wheel-tag:
10+
required: false
11+
type: string
12+
default: 'v5.3rc04.post2'
13+
secrets:
14+
pypi_password:
15+
required: false # Packages will not be uploaded to PyPI if not set
16+
type: string
17+
18+
jobs:
19+
build-linux-python-packages:
20+
runs-on: ubuntu-20.04
21+
strategy:
22+
max-parallel: 2
23+
matrix:
24+
python-version: [37, 38, 39, 310]
25+
26+
steps:
27+
- uses: actions/checkout@v2
28+
29+
- name: 'Free up disk space'
30+
run: |
31+
# Workaround for https://github.com/actions/virtual-environments/issues/709
32+
df -h
33+
sudo apt-get clean
34+
sudo rm -rf "/usr/local/share/boost"
35+
sudo rm -rf "$AGENT_TOOLSDIRECTORY"
36+
df -h
37+
38+
- name: 'Fetch build script'
39+
run: |
40+
curl -L https://raw.githubusercontent.com/InsightSoftwareConsortium/ITKPythonPackage/master/scripts/dockcross-manylinux-download-cache-and-build-module-wheels.sh -O
41+
chmod u+x dockcross-manylinux-download-cache-and-build-module-wheels.sh
42+
43+
- name: 'Build 🐍 Python 📦 package'
44+
run: |
45+
export ITK_PACKAGE_VERSION=${{ inputs.itk-wheel-tag }}
46+
./dockcross-manylinux-download-cache-and-build-module-wheels.sh cp${{ matrix.python-version }} --cmake_options ${{ inputs.cmake-options }}
47+
48+
- name: Publish Python package as GitHub Artifact
49+
uses: actions/upload-artifact@v1
50+
with:
51+
name: LinuxWheel${{ matrix.python-version }}
52+
path: dist
53+
54+
build-macos-python-packages:
55+
runs-on: macos-10.15
56+
strategy:
57+
max-parallel: 2
58+
59+
steps:
60+
- uses: actions/checkout@v2
61+
62+
- name: 'Specific XCode version'
63+
run: |
64+
sudo xcode-select -s "/Applications/Xcode_11.7.app"
65+
66+
- name: Get specific version of CMake, Ninja
67+
uses: lukka/[email protected]
68+
69+
- name: 'Fetch build script'
70+
run: |
71+
curl -L https://raw.githubusercontent.com/InsightSoftwareConsortium/ITKPythonPackage/master/scripts/macpython-download-cache-and-build-module-wheels.sh -O
72+
chmod u+x macpython-download-cache-and-build-module-wheels.sh
73+
74+
- name: 'Build 🐍 Python 📦 package'
75+
run: |
76+
export ITK_PACKAGE_VERSION=${{ inputs.itk-wheel-tag }}
77+
export MACOSX_DEPLOYMENT_TARGET=10.9
78+
./macpython-download-cache-and-build-module-wheels.sh --cmake_options ${{ inputs.cmake-options }}
79+
80+
- name: Publish Python package as GitHub Artifact
81+
uses: actions/upload-artifact@v1
82+
with:
83+
name: MacOSWheels
84+
path: dist
85+
86+
build-windows-python-packages:
87+
runs-on: windows-2019
88+
strategy:
89+
max-parallel: 2
90+
matrix:
91+
python-version-minor: [7, 8, 9, 10]
92+
93+
steps:
94+
- name: Get specific version of CMake, Ninja
95+
uses: lukka/[email protected]
96+
97+
- uses: actions/checkout@v2
98+
with:
99+
path: "im"
100+
101+
- name: 'Install Python'
102+
run: |
103+
$pythonArch = "64"
104+
$pythonVersion = "3.${{ matrix.python-version-minor }}"
105+
iex ((new-object net.webclient).DownloadString('https://raw.githubusercontent.com/scikit-build/scikit-ci-addons/master/windows/install-python.ps1'))
106+
107+
- name: 'Fetch build dependencies'
108+
shell: bash
109+
run: |
110+
mv im ../../
111+
cd ../../
112+
curl -L "https://github.com/InsightSoftwareConsortium/ITKPythonBuilds/releases/download/${{ inputs.itk-wheel-tag }}/ITKPythonBuilds-windows.zip" -o "ITKPythonBuilds-windows.zip"
113+
7z x ITKPythonBuilds-windows.zip -o/c/P -aoa -r
114+
curl -L "https://data.kitware.com/api/v1/file/5c0ad59d8d777f2179dd3e9c/download" -o "doxygen-1.8.11.windows.bin.zip"
115+
7z x doxygen-1.8.11.windows.bin.zip -o/c/P/doxygen -aoa -r
116+
curl -L "https://data.kitware.com/api/v1/file/5bbf87ba8d777f06b91f27d6/download/grep-win.zip" -o "grep-win.zip"
117+
7z x grep-win.zip -o/c/P/grep -aoa -r
118+
119+
- name: 'Build 🐍 Python 📦 package'
120+
shell: cmd
121+
run: |
122+
cd ../../im
123+
call "C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\VC\Auxiliary\Build\vcvars64.bat"
124+
set PATH=C:\P\grep;%PATH%
125+
set CC=cl.exe
126+
set CXX=cl.exe
127+
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
128+
129+
- name: Publish Python package as GitHub Artifact
130+
uses: actions/upload-artifact@v1
131+
with:
132+
name: WindowsWheel3.${{ matrix.python-version-minor }}
133+
path: ../../im/dist
134+
135+
publish-python-packages-to-pypi:
136+
needs:
137+
- build-linux-python-packages
138+
- build-macos-python-packages
139+
- build-windows-python-packages
140+
runs-on: ubuntu-18.04
141+
142+
steps:
143+
- name: Download Python Packages
144+
uses: actions/download-artifact@v2
145+
146+
- name: Prepare packages for upload
147+
run: |
148+
ls -R
149+
for d in */; do
150+
mv ${d}/*.whl .
151+
done
152+
mkdir dist
153+
mv *.whl dist/
154+
ls dist
155+
156+
- name: Publish 🐍 Python 📦 package to PyPI
157+
if: github.event_name == 'push' && startsWith(github.event.ref, 'refs/tags')
158+
uses: pypa/gh-action-pypi-publish@master
159+
with:
160+
user: __token__
161+
password: ${{ secrets.pypi_password }}

0 commit comments

Comments
 (0)