* ENH: Bump to latest release of VTK and disable IOSS compilation #552
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Build, test, package | |
on: [push,pull_request] | |
env: | |
vtk-git-tag: "v9.2.6" | |
itk-git-tag: "1fc47c7bec4ee133318c1892b7b745763a17d411" | |
# v5.3.0 = "1fc47c7bec4ee133318c1892b7b745763a17d411" | |
itk-wheel-tag: "v5.3.0" | |
itk-minimalpathextraction-git-tag: "v1.2.6" | |
itk-python-package-tag: "5ad02309321621cdc7269b9b68a35013c912271c" | |
itk-python-package-org: "InsightSoftwareConsortium" | |
jobs: | |
build-test-cxx: | |
runs-on: ${{ matrix.os }} | |
strategy: | |
max-parallel: 3 | |
matrix: | |
os: [ubuntu-20.04, windows-2022, macos-11] | |
include: | |
- os: ubuntu-20.04 | |
c-compiler: "gcc" | |
cxx-compiler: "g++" | |
- os: windows-2022 | |
c-compiler: "cl.exe" | |
cxx-compiler: "cl.exe" | |
- os: macos-11 | |
c-compiler: "clang" | |
cxx-compiler: "clang++" | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Set up Python 3.8 | |
uses: actions/setup-python@v2 | |
with: | |
python-version: 3.8 | |
- name: Set up OpenGL | |
if: matrix.os == 'ubuntu-20.04' | |
run: | | |
sudo apt-get update | |
sudo apt-get install -y libglu1-mesa-dev mesa-common-dev libgl1-mesa-glx libglvnd-core-dev freeglut3-dev libtbb-dev zstd | |
- name: Install build dependencies | |
run: | | |
python -m pip install --upgrade pip | |
python -m pip install ninja | |
- name: Get specific version of CMake, Ninja | |
uses: lukka/get-cmake@v3.22.2 | |
- name: Cache VTK | |
id: cache-vtk | |
uses: actions/cache@v3 | |
with: | |
path: | | |
VTK | |
VTK-build | |
key: build-${{ env.vtk-git-tag }}-${{ matrix.os }} | |
- name: Download VTK | |
if: steps.cache-vtk.outputs.cache-hit != 'true' | |
run: | | |
git clone https://github.com/Kitware/VTK.git | |
pushd VTK | |
git checkout ${{ env.vtk-git-tag }} | |
- name: Build VTK (Mac and Linux) | |
if: matrix.os != 'windows-2022' && steps.cache-vtk.outputs.cache-hit != 'true' | |
run: | | |
mkdir VTK-build | |
pushd VTK-build | |
cmake -DCMAKE_C_COMPILER:FILEPATH="${{ matrix.c-compiler }}" -DBUILD_TESTING:BOOL=OFF -DBUILD_SHARED_LIBS:BOOL=OFF -DCMAKE_CXX_COMPILER="${{ matrix.cxx-compiler }}" -DCMAKE_BUILD_TYPE:STRING="Release" -GNinja ../VTK | |
ninja | |
- name: Build VTK (Windows) | |
if: matrix.os == 'windows-2022' && steps.cache-vtk.outputs.cache-hit != 'true' | |
run: | | |
mkdir VTK-build | |
pushd VTK-build | |
call "C:\Program Files\Microsoft Visual Studio\2022\Enterprise\VC\Auxiliary\Build\vcvars64.bat" | |
cmake -DCMAKE_C_COMPILER:FILEPATH="${{ matrix.c-compiler }}" -DBUILD_TESTING:BOOL=OFF -DBUILD_SHARED_LIBS:BOOL=OFF -DVTK_MODULE_ENABLE_VTK_ioss:BOOL=NO -DVTK_MODULE_ENABLE_VTK_IOIOSS:BOOL=NO -DCMAKE_CXX_COMPILER="${{ matrix.cxx-compiler }}" -DCMAKE_BUILD_TYPE:STRING="Release" -GNinja ../VTK | |
ninja | |
shell: cmd | |
- name: Download ITK | |
run: | | |
git clone https://github.com/InsightSoftwareConsortium/ITK.git | |
pushd ITK | |
git checkout ${{ env.itk-git-tag }} | |
- name: Build ITK (Mac and Linux) | |
if: matrix.os != 'windows-2022' | |
run: | | |
mkdir ITK-build | |
pushd ITK-build | |
cmake -DCMAKE_C_COMPILER:FILEPATH="${{ matrix.c-compiler }}" -DITK_LEGACY_REMOVE:BOOL=ON -DModule_MinimalPathExtraction:BOOL=ON -DBUILD_SHARED_LIBS:BOOL=ON -DCMAKE_CXX_COMPILER="${{ matrix.cxx-compiler }}" -DCMAKE_BUILD_TYPE:STRING="Release" -DBUILD_TESTING:BOOL=ON -GNinja ../ITK | |
ninja | |
- name: Build ITK (Windows) | |
if: matrix.os == 'windows-2022' | |
run: | | |
mkdir ITK-build | |
pushd ITK-build | |
call "C:\Program Files\Microsoft Visual Studio\2022\Enterprise\VC\Auxiliary\Build\vcvars64.bat" | |
cmake -DCMAKE_C_COMPILER:FILEPATH="${{ matrix.c-compiler }}" -DITK_LEGACY_REMOVE:BOOL=ON -DModule_MinimalPathExtraction:BOOL=ON -DBUILD_SHARED_LIBS:BOOL=ON -DBUILD_EXAMPLES:BOOL=OFF -DBUILD_TESTING:BOOL=ON -DCMAKE_CXX_COMPILER="${{ matrix.cxx-compiler }}" -DCMAKE_BUILD_TYPE:STRING="Release" -GNinja ../ITK | |
shell: cmd | |
- name: Fetch CTest driver script | |
run: | | |
curl -L https://raw.githubusercontent.com/InsightSoftwareConsortium/ITK/dashboard/itk_common.cmake -O | |
- name: Configure CTest script | |
shell: bash | |
run: | | |
operating_system="${{ matrix.os }}" | |
cat > dashboard.cmake << EOF | |
set(CTEST_SITE "GitHubActions") | |
file(TO_CMAKE_PATH "${PWD}/.." CTEST_DASHBOARD_ROOT) | |
file(TO_CMAKE_PATH "${PWD}/" CTEST_SOURCE_DIRECTORY) | |
file(TO_CMAKE_PATH "${PWD}/../build" CTEST_BINARY_DIRECTORY) | |
set(dashboard_source_name "${GITHUB_REPOSITORY}") | |
if(ENV{GITHUB_REF} MATCHES "master") | |
set(branch "-master") | |
set(dashboard_model "Continuous") | |
else() | |
set(branch "-${GITHUB_REF}") | |
set(dashboard_model "Experimental") | |
endif() | |
set(CTEST_BUILD_NAME "${GITHUB_REPOSITORY}-${operating_system}-\${branch}") | |
set(CTEST_UPDATE_VERSION_ONLY 1) | |
set(CTEST_TEST_ARGS \${CTEST_TEST_ARGS} PARALLEL_LEVEL \${PARALLEL_LEVEL}) | |
set(CTEST_BUILD_CONFIGURATION "Release") | |
set(CTEST_CMAKE_GENERATOR "Ninja") | |
set(CTEST_CUSTOM_WARNING_EXCEPTION | |
\${CTEST_CUSTOM_WARNING_EXCEPTION} | |
# macOS Azure VM Warning | |
"ld: warning: text-based stub file" | |
) | |
set(dashboard_no_clean 1) | |
set(ENV{CC} ${{ matrix.c-compiler }}) | |
set(ENV{CXX} ${{ matrix.cxx-compiler }}) | |
set(ENV{ITK_DIR} "\${CTEST_SOURCE_DIRECTORY}/ITK-build") | |
set(ENV{VTK_DIR} "\${CTEST_SOURCE_DIRECTORY}/VTK-build") | |
if(WIN32) | |
set(ENV{PATH} "\${CTEST_DASHBOARD_ROOT}/ITK-build/bin;\$ENV{PATH}") | |
endif() | |
set(dashboard_cache " | |
ITK_LEGACY_REMOVE:BOOL=ON | |
Module_MinimalPathExtraction:BOOL=ON | |
BUILD_SHARED_LIBS:BOOL=ON | |
CMAKE_BUILD_TYPE:STRING="Release" | |
ITK_DIR:PATH=${PWD}/ITK-build | |
VTK_DIR:PATH=${PWD}/VTK-build | |
BUILD_TESTING:BOOL=ON | |
BUILD_EXAMPLES:BOOL=OFF | |
TubeTK_BUILD_APPLICATIONS:BOOL=OFF | |
") | |
string(TIMESTAMP build_date "%Y-%m-%d") | |
message("CDash Build Identifier: \${build_date} \${CTEST_BUILD_NAME}") | |
message("CTEST_SITE = \${CTEST_SITE}") | |
include(\${CTEST_SCRIPT_DIRECTORY}/itk_common.cmake) | |
EOF | |
cat dashboard.cmake | |
- name: Build and test (Mac and Linux) | |
if: matrix.os != 'windows-2022' | |
run: | | |
ctest --output-on-failure -j 2 -V -S dashboard.cmake | |
- name: Build and test (Windows) | |
if: matrix.os == 'windows-2022' | |
run: | | |
call "C:\Program Files\Microsoft Visual Studio\2022\Enterprise\VC\Auxiliary\Build\vcvars64.bat" | |
ctest --output-on-failure -j 2 -V -S dashboard.cmake | |
shell: cmd | |
build-linux-python-packages: | |
runs-on: ubuntu-20.04 | |
timeout-minutes: 500 | |
strategy: | |
max-parallel: 1 | |
matrix: | |
manylinux-platform: ["_2_28-x64", "2014-x64"] | |
python-version: ["38", "39", "310", "311"] | |
include: | |
- manylinux-platform: _2_28-x64 | |
target-arch: x64 | |
- manylinux-platform: 2014-x64 | |
target-arch: x64 | |
- python-version: 38 | |
itk-package: "ITK-cp38-cp38-manylinux" | |
c-compiler: "gcc" | |
cxx-compiler: "g++" | |
- python-version: 39 | |
itk-package: "ITK-cp39-cp39-manylinux" | |
c-compiler: "gcc" | |
cxx-compiler: "g++" | |
- python-version: 310 | |
itk-package: "ITK-cp310-cp310-manylinux" | |
c-compiler: "gcc" | |
cxx-compiler: "g++" | |
- python-version: 311 | |
itk-package: "ITK-cp311-cp311-manylinux" | |
c-compiler: "gcc" | |
cxx-compiler: "g++" | |
steps: | |
- uses: actions/checkout@v3 | |
- name: 'Free up disk space' | |
run: | | |
# Workaround for | |
# https://github.com/actions/virtual-environments/issues/709 | |
df -h | |
sudo apt-get remove -y '^dotnet-.*' | |
sudo apt-get remove -y '^llvm-.*' | |
sudo apt-get remove -y '^php-.*' | |
sudo apt-get autoremove -y | |
sudo apt-get clean | |
sudo rm -rf "/usr/local/share/boost" | |
sudo rm -rf "/usr/share/dotnet" | |
sudo rm -rf "$AGENT_TOOLSDIRECTORY" | |
df -h | |
- name: 'Set Swap Space' | |
uses: pierotofy/set-swap-space@master | |
with: | |
swap-size-gb: 10 | |
- name: 'Install dependencies' | |
run: | | |
sudo apt-get update | |
python -m pip install --upgrade pip | |
python -m pip install ninja | |
- name: 'Fetch build script' | |
run: | | |
IPP_DOWNLOAD_GIT_TAG=${{ env.itk-python-package-tag }} | |
IPP_DOWNLOAD_ORG=${{ env.itk-python-package-org }} | |
curl -L https://raw.githubusercontent.com/${IPP_DOWNLOAD_ORG:=InsightSoftwareConsortium}/ITKPythonPackage/${IPP_DOWNLOAD_GIT_TAG:=master}/scripts/dockcross-manylinux-download-cache-and-build-module-wheels.sh -O | |
chmod u+x dockcross-manylinux-download-cache-and-build-module-wheels.sh | |
- name: 'Git-Configure-Build MinimalPathExtraction' | |
run: | | |
rm -rf dist | |
rm -rf ITKPythonPackage | |
export ITK_PACKAGE_VERSION=${{ env.itk-wheel-tag }} | |
export ITKPYTHONPACKAGE_TAG=${{ env.itk-python-package-tag }} | |
export ITKPYTHONPACKAGE_ORG=${{ env.itk-python-package-org }} | |
#export ITK_MODULE_PREQ=${{ env.itk-module-deps }} | |
MANYLINUX_PLATFORM=${{ matrix.manylinux-platform }} | |
export MANYLINUX_VERSION=`(echo ${MANYLINUX_PLATFORM} | cut -d '-' -f 1)` | |
export TARGET_ARCH=`(echo ${MANYLINUX_PLATFORM} | cut -d '-' -f 2)` | |
export ITK_MODULE_NO_CLEANUP="true" | |
git clone https://github.com/InsightSoftwareConsortium/ITKMinimalPathExtraction | |
cp ./dockcross-manylinux-download-cache-and-build-module-wheels.sh ./ITKMinimalPathExtraction | |
pushd ITKMinimalPathExtraction | |
git checkout ${{env.itk-minimalpathextraction-git-tag}} | |
./dockcross-manylinux-download-cache-and-build-module-wheels.sh cp${{ matrix.python-version }} | |
popd | |
cp ITKMinimalPathExtraction/include/* include/ | |
mv ./ITKMinimalPathExtraction/ITKPythonPackage . | |
mv ./ITKMinimalPathExtraction/tools . | |
mkdir -p dist | |
- name: 'Setup Build Env' | |
shell: bash | |
run: | | |
MANYLINUX_PLATFORM=${{ matrix.manylinux-platform }} | |
export MANYLINUX_VERSION=`(echo ${MANYLINUX_PLATFORM} | cut -d '-' -f 1)` | |
export TARGET_ARCH=`(echo ${MANYLINUX_PLATFORM} | cut -d '-' -f 2)` | |
export ITK_DIR_NAME=${{ matrix.itk-package }}${MANYLINUX_VERSION}_${TARGET_ARCH} | |
cat > git-configure-build-env.sh << EOF | |
#!/bin/sh | |
ln -s -f -T /ITKPythonPackage/${ITK_DIR_NAME} /work/${ITK_DIR_NAME} | |
ln -s -f -T /ITKPythonPackage/ITK-source /work/ITK-source | |
ln -s -f -T /ITKPythonPackage/oneTBB-prefix /work/oneTBB-prefix | |
EOF | |
chmod +x ./git-configure-build-env.sh | |
source "./ITKPythonPackage/scripts/dockcross-manylinux-set-vars.sh" | |
docker run -v $(pwd):/work/ -v $PWD/ITKPythonPackage:/ITKPythonPackage --rm ${CONTAINER_SOURCE} /work/git-configure-build-env.sh | |
- name: Cache VTK Python Linux | |
id: cache-vtk-python-linux | |
uses: actions/cache@v3 | |
with: | |
path: | | |
VTK | |
VTK-build | |
key: linux-${{ env.vtk-git-tag }}-${{ matrix.manylinux-platform }}-${{ matrix.python-version }} | |
- name: 'Git-Configure-Build VTK' | |
if: steps.cache-vtk-python-linux.outputs.cache-hit != 'true' | |
shell: bash | |
run: | | |
MANYLINUX_PLATFORM=${{ matrix.manylinux-platform }} | |
export MANYLINUX_VERSION=`(echo ${MANYLINUX_PLATFORM} | cut -d '-' -f 1)` | |
export TARGET_ARCH=`(echo ${MANYLINUX_PLATFORM} | cut -d '-' -f 2)` | |
cat > git-configure-build-vtk.sh << EOF | |
#!/bin/sh | |
sudo apt-get update | |
sudo apt-get install -y libglu1-mesa-dev mesa-common-dev libgl1-mesa-glx libglvnd-core-dev freeglut3-dev libtbb-dev zstd | |
python -m pip install --upgrade pip | |
python -m pip install ninja | |
git clone https://github.com/Kitware/VTK.git | |
cd VTK | |
git checkout ${{ env.vtk-git-tag }} | |
cd .. | |
mkdir -p VTK-build | |
cd VTK-build | |
cmake -DCMAKE_C_COMPILER:FILEPATH="${{ matrix.c-compiler }}" \ | |
-DBUILD_TESTING:BOOL=OFF \ | |
-DBUILD_SHARED_LIBS:BOOL=OFF \ | |
-DCMAKE_CXX_COMPILER="${{ matrix.cxx-compiler }}" \ | |
-DCMAKE_BUILD_TYPE:STRING="Release" \ | |
-GNinja \ | |
../VTK | |
ninja | |
EOF | |
chmod u+x ./git-configure-build-vtk.sh | |
source "./ITKPythonPackage/scripts/dockcross-manylinux-set-vars.sh" | |
docker run -v $(pwd):/work/ --rm ${CONTAINER_SOURCE} /work/git-configure-build-vtk.sh | |
- name: 'Build 🐍 Python 📦 package TubeTK' | |
timeout-minutes: 400 | |
run: | | |
export ITK_PACKAGE_VERSION=${{ env.itk-wheel-tag }} | |
export ITKPYTHONPACKAGE_TAG=${{ env.itk-python-package-tag }} | |
export ITKPYTHONPACKAGE_ORG=${{ env.itk-python-package-org }} | |
#export ITK_MODULE_PREQ=${{ env.itk-module-deps }} | |
export MANYLINUX_PLATFORM=${{ matrix.manylinux-platform }} | |
export MANYLINUX_VERSION=`(echo ${MANYLINUX_PLATFORM} | cut -d '-' -f 1)` | |
export TARGET_ARCH=`(echo ${MANYLINUX_PLATFORM} | cut -d '-' -f 2)` | |
./ITKPythonPackage/scripts/dockcross-manylinux-build-module-wheels.sh cp${{ matrix.python-version }} | |
- name: Publish Python package as GitHub Artifact | |
uses: actions/upload-artifact@v1 | |
with: | |
name: LinuxWheel${{ matrix.python-version }} | |
path: dist | |
build-macos-python-packages: | |
runs-on: macos-11 | |
strategy: | |
max-parallel: 1 | |
matrix: | |
include: | |
- c-compiler: "clang" | |
cxx-compiler: "clang++" | |
steps: | |
- uses: actions/checkout@v3 | |
- name: 'Specific XCode version' | |
run: | | |
sudo xcode-select -s "/Applications/Xcode_13.2.1.app" | |
- name: Get specific version of CMake, Ninja | |
uses: lukka/get-cmake@v3.22.2 | |
- name: 'Fetch build script' | |
run: | | |
python -m pip install --upgrade pip | |
python -m pip install ninja | |
curl -L https://raw.githubusercontent.com/InsightSoftwareConsortium/ITKPythonPackage/${{ env.itk-wheel-tag }}/scripts/macpython-download-cache-and-build-module-wheels.sh -O | |
chmod u+x macpython-download-cache-and-build-module-wheels.sh | |
- name: Cache VTK Python Mac | |
id: cache-vtk-python-mac | |
uses: actions/cache@v3 | |
with: | |
path: | | |
VTK | |
VTK-build | |
key: mac-${{ env.vtk-git-tag }} | |
- name: 'Git-Configure-Build VTK' | |
if: steps.cache-vtk-python-mac.outputs.cache-hit != 'true' | |
run: | | |
export ITK_PACKAGE_VERSION=${{ env.itk-wheel-tag }} | |
export MACOSX_DEPLOYMENT_TARGET=10.9 | |
git clone https://github.com/Kitware/VTK | |
pushd VTK | |
git checkout ${{env.vtk-git-tag}} | |
popd | |
mkdir VTK-build | |
pushd VTK-build | |
cmake -DCMAKE_C_COMPILER:FILEPATH="${{ matrix.c-compiler }}" -DBUILD_TESTING:BOOL=OFF -DBUILD_SHARED_LIBS:BOOL=OFF -DVTK_MODULE_ENABLE_VTK_ioss:BOOL=NO -DVTK_MODULE_ENABLE_VTK_IOIOSS:BOOL=NO -DCMAKE_CXX_COMPILER="${{ matrix.cxx-compiler }}" -DCMAKE_BUILD_TYPE:STRING="Release" -GNinja ../VTK | |
ninja | |
- name: 'Git-Configure-Build MinimalPathExtraction' | |
run: | | |
export ITK_PACKAGE_VERSION=${{ env.itk-wheel-tag }} | |
export MACOSX_DEPLOYMENT_TARGET=10.9 | |
git clone https://github.com/InsightSoftwareConsortium/ITKMinimalPathExtraction | |
cp ./macpython-download-cache-and-build-module-wheels.sh ITKMinimalPathExtraction/ | |
pushd ITKMinimalPathExtraction | |
git checkout ${{env.itk-minimalpathextraction-git-tag}} | |
./macpython-download-cache-and-build-module-wheels.sh | |
popd | |
cp ITKMinimalPathExtraction/include/* include/ | |
- name: 'Git-Configure-Build SEM' | |
run: | | |
export ITK_PACKAGE_VERSION=${{ env.itk-wheel-tag }} | |
export MACOSX_DEPLOYMENT_TARGET=10.9 | |
# Can build SEM using any version of python wrapping | |
export ITK_DIR="/Users/svc-dashboard/D/P/ITKPythonPackage/ITK-3.9-macosx_x86_64/" | |
git clone https://github.com/Slicer/SlicerExecutionModel | |
mkdir SlicerExecutionModel-build | |
pushd SlicerExecutionModel-build | |
cmake -DCMAKE_C_COMPILER:FILEPATH="${{ matrix.c-compiler }}" -DCMAKE_CXX_COMPILER="${{ matrix.cxx-compiler }}" -DCMAKE_BUILD_TYPE:STRING="Release" -GNinja ../SlicerExecutionModel | |
ninja | |
- name: 'Build 🐍 Python 📦 package TubeTK' | |
run: | | |
export ITK_PACKAGE_VERSION=${{ env.itk-wheel-tag }} | |
export MACOSX_DEPLOYMENT_TARGET=10.9 | |
/Users/svc-dashboard/D/P/ITKPythonPackage/scripts/macpython-build-module-wheels.sh | |
- name: Publish Python package as GitHub Artifact | |
uses: actions/upload-artifact@v1 | |
with: | |
name: MacOSWheels | |
path: dist | |
build-windows-python-packages: | |
runs-on: windows-2022 | |
strategy: | |
max-parallel: 1 | |
matrix: | |
python-version-minor: ["8", "9", "10", "11"] | |
include: | |
- c-compiler: "cl.exe" | |
cxx-compiler: "cl.exe" | |
steps: | |
- name: Get specific version of CMake, Ninja | |
uses: lukka/get-cmake@v3.22.2 | |
- uses: actions/checkout@v3 | |
with: | |
path: "im" | |
- name: 'Install Python' | |
run: | | |
$pythonArch = "64" | |
$pythonVersion = "3.${{ matrix.python-version-minor }}" | |
iex ((new-object net.webclient).DownloadString('https://raw.githubusercontent.com/scikit-build/scikit-ci-addons/master/windows/install-python.ps1')) | |
- name: 'Fetch build dependencies' | |
shell: bash | |
run: | | |
mv im ../../ | |
pushd ../../im | |
curl -L "https://github.com/InsightSoftwareConsortium/ITKPythonBuilds/releases/download/${{ env.itk-wheel-tag }}/ITKPythonBuilds-windows.zip" -o "ITKPythonBuilds-windows.zip" | |
7z x ITKPythonBuilds-windows.zip -o/c/P -aoa -r | |
curl -L "https://data.kitware.com/api/v1/file/5c0ad59d8d777f2179dd3e9c/download" -o "doxygen-1.8.11.windows.bin.zip" | |
7z x doxygen-1.8.11.windows.bin.zip -o/c/P/doxygen -aoa -r | |
curl -L "https://data.kitware.com/api/v1/file/5bbf87ba8d777f06b91f27d6/download/grep-win.zip" -o "grep-win.zip" | |
7z x grep-win.zip -o/c/P/grep -aoa -r | |
echo "Updating ITKPythonPackage build scripts to ${{env.itk-python-package-tag}}" | |
git clone https://github.com/InsightSoftwareConsortium/ITKMinimalPathExtraction | |
pushd ITKMinimalPathExtraction | |
git checkout ${{env.itk-minimalpathextraction-git-tag}} | |
popd | |
git clone https://github.com/Slicer/SlicerExecutionModel | |
pushd /c/P/IPP | |
git remote add InsightSoftwareConsortium https://github.com/InsightSoftwareConsortium/ITKPythonPackage.git --tags | |
git fetch InsightSoftwareConsortium | |
git checkout ${{env.itk-python-package-tag}} | |
git status | |
- name: Cache VTK Python Windows | |
id: cache-vtk-python-windows | |
uses: actions/cache@v3 | |
with: | |
path: | | |
\a\im\VTK | |
\a\im\VTK-build-3${{ matrix.python-version-minor }} | |
key: windows-${{ env.vtk-git-tag }}-${{ matrix.python-version-minor }} | |
- name: 'Git-Configure-Build VTK' | |
if: steps.cache-vtk-python-windows.outputs.cache-hit != 'true' | |
shell: cmd | |
run: | | |
pushd \a\im | |
git clone https://github.com/Kitware/VTK | |
pushd VTK | |
git checkout ${{env.vtk-git-tag}} | |
popd | |
call "C:\Program Files\Microsoft Visual Studio\2022\Enterprise\VC\Auxiliary\Build\vcvars64.bat" | |
set PATH=C:\P\grep;%PATH% | |
set CC=cl.exe | |
set CXX=cl.exe | |
C:\Python3${{ matrix.python-version-minor }}-x64\python.exe -m pip install ninja | |
C:\Python3${{ matrix.python-version-minor }}-x64\python.exe -m pip install cmake | |
mkdir VTK-build-3${{ matrix.python-version-minor }} | |
pushd VTK-build-3${{ matrix.python-version-minor }} | |
C:\Python3${{ matrix.python-version-minor }}-x64\Scripts\cmake -DCMAKE_C_COMPILER:FILEPATH="${{ matrix.c-compiler }}" -DBUILD_TESTING:BOOL=OFF -DBUILD_SHARED_LIBS:BOOL=OFF -DVTK_MODULE_ENABLE_VTK_ioss:BOOL=NO -DVTK_MODULE_ENABLE_VTK_IOIOSS:BOOL=NO -DCMAKE_CXX_COMPILER="${{ matrix.cxx-compiler }}" -DCMAKE_BUILD_TYPE:STRING="Release" -GNinja ..\VTK | |
C:\Python3${{ matrix.python-version-minor }}-x64\Scripts\ninja | |
- name: 'Build 🐍 Python 📦 package' | |
shell: cmd | |
run: | | |
pushd ..\..\im | |
call "C:\Program Files\Microsoft Visual Studio\2022\Enterprise\VC\Auxiliary\Build\vcvars64.bat" | |
set PATH=C:\P\grep;%PATH% | |
set CC=cl.exe | |
set CXX=cl.exe | |
C:\Python3${{ matrix.python-version-minor }}-x64\python.exe -m pip install ninja | |
C:\Python3${{ matrix.python-version-minor }}-x64\python.exe -m pip install cmake | |
pushd ITKMinimalPathExtraction | |
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" | |
popd | |
copy ITKMinimalPathExtraction\include\* include\ | |
set ITK_DIR=C:\P\IPP\ITK-win_3${{ matrix.python-version-minor }}-x64 | |
set VTK_DIR=\a\im\VTK-build-3${{ matrix.python-version-minor }} | |
mkdir SlicerExecutionModel-build-3${{ matrix.python-version-minor }} | |
pushd SlicerExecutionModel-build-3${{ matrix.python-version-minor }} | |
cmake -DCMAKE_C_COMPILER:FILEPATH="${{ matrix.c-compiler }}" -DCMAKE_CXX_COMPILER="${{ matrix.cxx-compiler }}" -DCMAKE_BUILD_TYPE:STRING="Release" -GNinja ../SlicerExecutionModel | |
ninja | |
popd | |
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" | |
- name: Publish Python package as GitHub Artifact | |
uses: actions/upload-artifact@v1 | |
with: | |
name: WindowsWheel3.${{ matrix.python-version-minor }} | |
path: ../../im/dist | |
publish-python-packages-to-pypi: | |
needs: | |
- build-linux-python-packages | |
- build-macos-python-packages | |
- build-windows-python-packages | |
runs-on: ubuntu-20.04 | |
steps: | |
- name: Download Python Packages | |
uses: actions/download-artifact@v2 | |
- name: Prepare packages for upload | |
run: | | |
ls -R | |
for d in */; do | |
mv ${d}/itk_tubetk*.whl . | |
done | |
mkdir dist | |
mv itk_tubetk*.whl dist/ | |
ls dist | |
- name: Publish 🐍 Python 📦 package to PyPI | |
if: github.event_name == 'push' && startsWith(github.event.ref, 'refs/tags') | |
uses: pypa/gh-action-pypi-publish@master | |
with: | |
user: __token__ | |
password: ${{ secrets.pypi_password }} |