Skip to content

Commit e4e6ba8

Browse files
authored
Merge pull request #43 from thewtex/all-repos_autofix_ci-itk-5.4.0-secret-syntax
ENH: Upgrade CI for ITK 5.4.0
2 parents 4d9cba2 + a3713ff commit e4e6ba8

File tree

3 files changed

+118
-327
lines changed

3 files changed

+118
-327
lines changed
Lines changed: 10 additions & 273 deletions
Original file line numberDiff line numberDiff line change
@@ -1,278 +1,15 @@
1+
12
name: Build, test, package
23

34
on: [push,pull_request]
45

56
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-
uses: lukka/[email protected]
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-
uses: lukka/[email protected]
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 }}

pyproject.toml

Lines changed: 108 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,108 @@
1+
[build-system]
2+
requires = ["scikit-build-core"]
3+
build-backend = "scikit_build_core.build"
4+
5+
[project]
6+
name = "itk-phasesymmetry"
7+
version = "1.0.5"
8+
description = "itk-phasesymmetry provides multi-scale steerable filters "
9+
readme = "README.rst"
10+
license = {file = "LICENSE"}
11+
authors = [
12+
{ name = "Charles Hatt", email = "[email protected]" },
13+
]
14+
keywords = [
15+
"itk",
16+
]
17+
classifiers = [
18+
"Development Status :: 4 - Beta",
19+
"Intended Audience :: Developers",
20+
"Intended Audience :: Education",
21+
"Intended Audience :: Healthcare Industry",
22+
"Intended Audience :: Science/Research",
23+
"License :: OSI Approved :: Apache Software License",
24+
"Operating System :: Android",
25+
"Operating System :: MacOS",
26+
"Operating System :: Microsoft :: Windows",
27+
"Operating System :: POSIX",
28+
"Operating System :: Unix",
29+
"Programming Language :: C++",
30+
"Programming Language :: Python",
31+
"Topic :: Scientific/Engineering",
32+
"Topic :: Scientific/Engineering :: Information Analysis",
33+
"Topic :: Scientific/Engineering :: Medical Science Apps.",
34+
"Topic :: Software Development :: Libraries",
35+
]
36+
requires-python = ">=3.8"
37+
dependencies = [
38+
"itk == 5.4.*",
39+
]
40+
41+
[project.urls]
42+
Download = "https://github.com/KitwareMedical/ITKPhaseSymmetry"
43+
Homepage = "https://github.com/KitwareMedical/ITKPhaseSymmetry"
44+
45+
[tool.scikit-build]
46+
# The versions of CMake to allow. If CMake is not present on the system or does
47+
# not pass this specifier, it will be downloaded via PyPI if possible. An empty
48+
# string will disable this check.
49+
cmake.version = ">=3.16.3"
50+
51+
# A list of args to pass to CMake when configuring the project. Setting this in
52+
# config or envvar will override toml. See also ``cmake.define``.
53+
cmake.args = []
54+
55+
# A table of defines to pass to CMake when configuring the project. Additive.
56+
cmake.define = {}
57+
58+
# Verbose printout when building.
59+
cmake.verbose = true
60+
61+
# The build type to use when building the project. Valid options are: "Debug",
62+
# "Release", "RelWithDebInfo", "MinSizeRel", "", etc.
63+
cmake.build-type = "Release"
64+
65+
# The source directory to use when building the project. Currently only affects
66+
# the native builder (not the setuptools plugin).
67+
cmake.source-dir = "."
68+
69+
# The versions of Ninja to allow. If Ninja is not present on the system or does
70+
# not pass this specifier, it will be downloaded via PyPI if possible. An empty
71+
# string will disable this check.
72+
ninja.version = ">=1.11"
73+
74+
# The logging level to display, "DEBUG", "INFO", "WARNING", and "ERROR" are
75+
# possible options.
76+
logging.level = "INFO"
77+
78+
# Files to include in the SDist even if they are skipped by default. Supports
79+
# gitignore syntax.
80+
sdist.include = []
81+
82+
# Files to exclude from the SDist even if they are included by default. Supports
83+
# gitignore syntax.
84+
sdist.exclude = []
85+
86+
# A list of license files to include in the wheel. Supports glob patterns.
87+
wheel.license-files = ["LICEN[CS]E*",]
88+
89+
# Target the platlib or the purelib. If not set, the default is to target the
90+
# platlib if wheel.cmake is true, and the purelib otherwise.
91+
wheel.platlib = "false"
92+
93+
# If CMake is less than this value, backport a copy of FindPython. Set to 0
94+
# disable this, or the empty string.
95+
backport.find-python = "3.26.1"
96+
97+
# Select the editable mode to use. Can be "redirect" (default) or "inplace".
98+
editable.mode = "redirect"
99+
100+
# Rebuild the project when the package is imported. The build-directory must be
101+
# set.
102+
editable.rebuild = false
103+
104+
# If set, this will provide a method for scikit-build-core backward compatibility.
105+
minimum-version = "0.8.2"
106+
107+
# The build directory. Defaults to a temporary directory, but can be set.
108+
build-dir = "build/{wheel_tag}"

0 commit comments

Comments
 (0)