Skip to content

Commit 1ae358d

Browse files
authored
Merge pull request #40 from InsightSoftwareConsortium/github-actions
GitHub Actions
2 parents 19012bd + f9eae6d commit 1ae358d

5 files changed

Lines changed: 286 additions & 2 deletions

File tree

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
name: Apply clang-format to PR
2+
3+
on:
4+
pull_request:
5+
types: [labeled]
6+
7+
jobs:
8+
clang-format:
9+
runs-on: ubuntu-latest
10+
11+
steps:
12+
- uses: actions/checkout@v1
13+
- uses: InsightSoftwareConsortium/ITKApplyClangFormatAction@master
14+
with:
15+
github-token: ${{ secrets.GITHUB_TOKEN }}
Lines changed: 254 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,254 @@
1+
name: Build, test, package
2+
3+
on: [push]
4+
5+
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: "v5.1.0"
17+
cmake-build-type: "MinSizeRel"
18+
- os: windows-2019
19+
c-compiler: "cl.exe"
20+
cxx-compiler: "cl.exe"
21+
itk-git-tag: "v5.1.0"
22+
cmake-build-type: "Release"
23+
- os: macos-10.15
24+
c-compiler: "clang"
25+
cxx-compiler: "clang++"
26+
itk-git-tag: "v5.1.0"
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: Download ITK
43+
run: |
44+
cd ..
45+
git clone https://github.com/InsightSoftwareConsortium/ITK.git
46+
cd ITK
47+
git checkout ${{ matrix.itk-git-tag }}
48+
49+
- name: Build ITK
50+
if: matrix.os != 'windows-2019'
51+
run: |
52+
cd ..
53+
mkdir ITK-build
54+
cd ITK-build
55+
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
56+
ninja
57+
58+
- name: Build ITK
59+
if: matrix.os == 'windows-2019'
60+
run: |
61+
cd ..
62+
mkdir ITK-build
63+
cd ITK-build
64+
call "C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\VC\Auxiliary\Build\vcvars64.bat"
65+
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
66+
ninja
67+
shell: cmd
68+
69+
- name: Fetch CTest driver script
70+
run: |
71+
curl -L https://raw.githubusercontent.com/InsightSoftwareConsortium/ITK/dashboard/itk_common.cmake -O
72+
73+
- name: Configure CTest script
74+
shell: bash
75+
run: |
76+
operating_system="${{ matrix.os }}"
77+
cat > dashboard.cmake << EOF
78+
set(CTEST_SITE "GitHubActions")
79+
file(TO_CMAKE_PATH "${GITHUB_WORKSPACE}/.." CTEST_DASHBOARD_ROOT)
80+
file(TO_CMAKE_PATH "${GITHUB_WORKSPACE}/" CTEST_SOURCE_DIRECTORY)
81+
file(TO_CMAKE_PATH "${GITHUB_WORKSPACE}/../build" CTEST_BINARY_DIRECTORY)
82+
set(dashboard_source_name "${GITHUB_REPOSITORY}")
83+
if(ENV{GITHUB_REF} MATCHES "master")
84+
set(branch "-master")
85+
set(dashboard_model "Continuous")
86+
else()
87+
set(branch "-${GITHUB_REF}")
88+
set(dashboard_model "Experimental")
89+
endif()
90+
set(CTEST_BUILD_NAME "${GITHUB_REPOSITORY}-${operating_system}-\${branch}")
91+
set(CTEST_UPDATE_VERSION_ONLY 1)
92+
set(CTEST_TEST_ARGS \${CTEST_TEST_ARGS} PARALLEL_LEVEL \${PARALLEL_LEVEL})
93+
set(CTEST_BUILD_CONFIGURATION "Release")
94+
set(CTEST_CMAKE_GENERATOR "Ninja")
95+
set(CTEST_CUSTOM_WARNING_EXCEPTION
96+
\${CTEST_CUSTOM_WARNING_EXCEPTION}
97+
# macOS Azure VM Warning
98+
"ld: warning: text-based stub file"
99+
)
100+
set(dashboard_no_clean 1)
101+
set(ENV{CC} ${{ matrix.c-compiler }})
102+
set(ENV{CXX} ${{ matrix.cxx-compiler }})
103+
set(dashboard_cache "
104+
ITK_DIR:PATH=\${CTEST_DASHBOARD_ROOT}/ITK-build
105+
BUILD_TESTING:BOOL=ON
106+
")
107+
string(TIMESTAMP build_date "%Y-%m-%d")
108+
message("CDash Build Identifier: \${build_date} \${CTEST_BUILD_NAME}")
109+
message("CTEST_SITE = \${CTEST_SITE}")
110+
include(\${CTEST_SCRIPT_DIRECTORY}/itk_common.cmake)
111+
EOF
112+
cat dashboard.cmake
113+
114+
- name: Build and test
115+
if: matrix.os != 'windows-2019'
116+
run: |
117+
ctest -j 2 -V -S dashboard.cmake
118+
119+
- name: Build and test
120+
if: matrix.os == 'windows-2019'
121+
run: |
122+
call "C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\VC\Auxiliary\Build\vcvars64.bat"
123+
ctest -j 2 -V -S dashboard.cmake
124+
shell: cmd
125+
126+
build-linux-python-packages:
127+
runs-on: ubuntu-18.04
128+
strategy:
129+
max-parallel: 2
130+
matrix:
131+
python-version: [35, 36, 37, 38]
132+
include:
133+
- itk-python-git-tag: "v5.1.0"
134+
135+
steps:
136+
- uses: actions/checkout@v2
137+
138+
- name: 'Free up disk space'
139+
run: |
140+
# Workaround for https://github.com/actions/virtual-environments/issues/709
141+
df -h
142+
sudo apt-get clean
143+
sudo rm -rf "/usr/local/share/boost"
144+
sudo rm -rf "$AGENT_TOOLSDIRECTORY"
145+
df -h
146+
147+
- name: 'Fetch build script'
148+
run: |
149+
curl -L https://raw.githubusercontent.com/InsightSoftwareConsortium/ITKPythonPackage/master/scripts/dockcross-manylinux-download-cache-and-build-module-wheels.sh -O
150+
chmod u+x dockcross-manylinux-download-cache-and-build-module-wheels.sh
151+
152+
- name: 'Build Python package'
153+
run: |
154+
export ITK_PACKAGE_VERSION=${{ matrix.itk-python-git-tag }}
155+
./dockcross-manylinux-download-cache-and-build-module-wheels.sh cp${{ matrix.python-version }}
156+
157+
- name: Publish Python package as GitHub Artifact
158+
uses: actions/upload-artifact@v1
159+
with:
160+
name: LinuxWheel${{ matrix.python-version }}
161+
path: dist
162+
163+
- name: Publish Python package to PyPI
164+
if: github.event_name == 'push' && startsWith(github.event.ref, 'refs/tags')
165+
uses: pypa/gh-action-pypi-publish@master
166+
with:
167+
user: __token__
168+
password: ${{ secrets.pypi_password }}
169+
170+
build-macos-python-packages:
171+
runs-on: macos-10.15
172+
strategy:
173+
max-parallel: 2
174+
matrix:
175+
python-version: [3.5, 3.6, 3.7, 3.8]
176+
include:
177+
- itk-python-git-tag: "v5.1.0"
178+
179+
steps:
180+
- uses: actions/checkout@v2
181+
182+
- name: 'Fetch build script'
183+
run: |
184+
curl -L https://raw.githubusercontent.com/InsightSoftwareConsortium/ITKPythonPackage/master/scripts/macpython-download-cache-and-build-module-wheels.sh -O
185+
chmod u+x macpython-download-cache-and-build-module-wheels.sh
186+
187+
- name: 'Build Python package'
188+
run: |
189+
export ITK_PACKAGE_VERSION=${{ matrix.itk-python-git-tag }}
190+
export MACOSX_DEPLOYMENT_TARGET=10.9
191+
./macpython-download-cache-and-build-module-wheels.sh
192+
193+
- name: Publish Python package as GitHub Artifact
194+
uses: actions/upload-artifact@v1
195+
with:
196+
name: MacOSWheel${{ matrix.python-version }}
197+
path: dist
198+
199+
- name: Publish Python package to PyPI
200+
if: github.event_name == 'push' && startsWith(github.event.ref, 'refs/tags')
201+
uses: pypa/gh-action-pypi-publish@master
202+
with:
203+
user: __token__
204+
password: ${{ secrets.pypi_password }}
205+
206+
build-windows-python-packages:
207+
runs-on: windows-2019
208+
strategy:
209+
max-parallel: 2
210+
matrix:
211+
python-version-minor: [5, 6, 7, 8]
212+
include:
213+
- itk-python-git-tag: "v5.1.0"
214+
215+
steps:
216+
- uses: actions/checkout@v2
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+
curl -L "https://github.com/InsightSoftwareConsortium/ITKPythonBuilds/releases/download/${{ matrix.itk-python-git-tag }}/ITKPythonBuilds-windows.zip" -o "ITKPythonBuilds-windows.zip"
228+
7z x ITKPythonBuilds-windows.zip -o/c/P -aoa -r
229+
curl -L "https://data.kitware.com/api/v1/file/5c0ad59d8d777f2179dd3e9c/download" -o "doxygen-1.8.11.windows.bin.zip"
230+
7z x doxygen-1.8.11.windows.bin.zip -o/c/P/doxygen -aoa -r
231+
curl -L "https://data.kitware.com/api/v1/file/5bbf87ba8d777f06b91f27d6/download/grep-win.zip" -o "grep-win.zip"
232+
7z x grep-win.zip -o/c/P/grep -aoa -r
233+
234+
- name: 'Build Python package'
235+
shell: cmd
236+
run: |
237+
call "C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\VC\Auxiliary\Build\vcvars64.bat"
238+
set PATH="C:\P\grep;%PATH%"
239+
set CC=cl.exe
240+
set CXX=cl.exe
241+
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"
242+
243+
- name: Publish Python package as GitHub Artifact
244+
uses: actions/upload-artifact@v1
245+
with:
246+
name: WindowWheel3.${{ matrix.python-version-minor }}
247+
path: dist
248+
249+
- name: Publish Python package to PyPI
250+
if: github.event_name == 'push' && startsWith(github.event.ref, 'refs/tags')
251+
uses: pypa/gh-action-pypi-publish@master
252+
with:
253+
user: __token__
254+
password: ${{ secrets.pypi_password }}
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
name: clang-format linter
2+
3+
on: [push,pull_request]
4+
5+
jobs:
6+
lint:
7+
runs-on: ubuntu-latest
8+
9+
steps:
10+
- uses: actions/checkout@v1
11+
with:
12+
fetch-depth: 1
13+
- uses: InsightSoftwareConsortium/ITKClangFormatLinterAction@master

README.rst

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,8 @@ ITKAnisotropicDiffusionLBR
1313
.. image:: https://dev.azure.com/ITKAnisotropicDiffusionLBR/ITKAnisotropicDiffusionLBR/_apis/build/status/InsightSoftwareConsortium.ITKAnisotropicDiffusionLBR?branchName=master
1414
:target: https://dev.azure.com/ITKAnisotropicDiffusionLBR/ITKAnisotropicDiffusionLBR/_build/latest?definitionId=1&branchName=master
1515

16+
.. image:: https://github.com/InsightSoftwareConsortium/ITKAnisotropicDiffusionLBR/workflows/Build,%20test,%20package/badge.svg
17+
1618
.. image:: https://img.shields.io/pypi/v/itk-anisotropicdiffusionlbr.svg
1719
:target: https://pypi.python.org/pypi/itk-anisotropicdiffusionlbr
1820
:alt: PyPI

setup.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212

1313
setup(
1414
name='itk-anisotropicdiffusionlbr',
15-
version='1.0.2',
15+
version='1.1.0',
1616
author='Insight Software Consortium',
1717
author_email='community@itk.org',
1818
packages=['itk'],
@@ -50,6 +50,6 @@
5050
keywords='ITK InsightToolkit',
5151
url=r'https://itk.org/',
5252
install_requires=[
53-
r'itk>=5.0.0.post1'
53+
r'itk>=5.1.0'
5454
]
5555
)

0 commit comments

Comments
 (0)