Skip to content

Commit 68ca30e

Browse files
authored
Merge pull request #1484 from cookpa/master
ENH: Use ITK ZLIB, test release builds, Windows binaries (#1)
2 parents 89ea1a5 + d84fdcc commit 68ca30e

File tree

4 files changed

+107
-1
lines changed

4 files changed

+107
-1
lines changed

.github/workflows/release-binaries.yml

+9
Original file line numberDiff line numberDiff line change
@@ -96,6 +96,9 @@ jobs:
9696
cmake \
9797
-DCMAKE_BUILD_TYPE=${{ matrix.config.build_type }} \
9898
-G "${{ matrix.config.generators }}" \
99+
-DBUILD_TESTING=ON \
100+
-DRUN_SHORT_TESTS=ON \
101+
-DRUN_LONG_TESTS=OFF \
99102
-DCMAKE_INSTALL_PREFIX:PATH=${{ runner.temp }}/install/ants-${{ env.ANTS_VERSION }} \
100103
${GITHUB_WORKSPACE}
101104
- name: Build
@@ -104,6 +107,12 @@ jobs:
104107
run: |
105108
cd build
106109
cmake --build . --config ${{ matrix.config.build_type }} --parallel
110+
- name: Test
111+
shell: bash
112+
working-directory: ${{ runner.temp }}
113+
run: |
114+
cd build/ANTS-build
115+
ctest
107116
- name: Install
108117
shell: bash
109118
working-directory: ${{ runner.temp }}

.github/workflows/release-docker-binaries.yml

+9
Original file line numberDiff line numberDiff line change
@@ -64,13 +64,22 @@ jobs:
6464
cmake \
6565
-DCMAKE_BUILD_TYPE=${{ matrix.config.build_type }} \
6666
-G "${{ matrix.config.generators }}" \
67+
-DBUILD_TESTING=ON \
68+
-DRUN_SHORT_TESTS=ON \
69+
-DRUN_LONG_TESTS=OFF \
6770
-DCMAKE_INSTALL_PREFIX:PATH=/opt/install/ants-${{ env.ANTS_VERSION }} \
6871
${GITHUB_WORKSPACE}
6972
- name: Build
7073
shell: bash
7174
run: |
7275
cd /opt/build
7376
cmake --build . --config ${{ matrix.config.build_type }} --parallel 1
77+
- name: Test
78+
shell: bash
79+
working-directory: ${{ runner.temp }}
80+
run: |
81+
cd /opt/build/ANTS-build
82+
ctest
7483
- name: Install
7584
shell: bash
7685
run: |
+86
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,86 @@
1+
# Build for Windows using visual studio
2+
name: Native Windows release binaries
3+
4+
# Controls when the action will run. Triggers the workflow on push
5+
on:
6+
release:
7+
types: [created]
8+
9+
jobs:
10+
build:
11+
name: ${{ matrix.config.name }}
12+
runs-on: ${{ matrix.config.os }}
13+
strategy:
14+
fail-fast: false
15+
matrix:
16+
config:
17+
- {
18+
name: "Windows-22",
19+
os: "windows-2022",
20+
vs: "2019",
21+
build_type: "Release"
22+
}
23+
steps:
24+
- uses: actions/checkout@v3
25+
with:
26+
ref: ${{ github.ref }}
27+
# Set up vs studio. Use default windows shell (powershell) not bash,
28+
# to avoid conflicts with link executable
29+
- uses: ilammy/msvc-dev-cmd@v1
30+
with:
31+
arch: ${{ runner.arch }}
32+
vsversion: ${{ matrix.vs }}
33+
- name: Get ANTs version
34+
run: |
35+
$antsVersion="${{ env.ANTS_TAG }}"
36+
$antsVersion=$antsVersion.Substring(1)
37+
echo "ANTS_VERSION=$antsVersion" | Out-File -FilePath $env:GITHUB_ENV -Append
38+
env:
39+
ANTS_TAG: ${{ github.ref_name }}
40+
- name: Define env
41+
run: |
42+
echo github.event.action: ${{ github.event.action }}
43+
echo "ARTIFACT=${{ runner.temp }}/ants-${{ env.ANTS_VERSION }}-${{ matrix.config.os }}-${{ runner.arch }}-VS${{ matrix.config.vs }}.zip" | Out-File -FilePath $env:GITHUB_ENV -Append
44+
- name: Configure
45+
working-directory: ${{ runner.temp }}
46+
run: |
47+
mkdir build
48+
cd build
49+
cmake `
50+
-DCMAKE_BUILD_TYPE=${{ matrix.config.build_type }} `
51+
-DBUILD_TESTING=ON `
52+
-DRUN_SHORT_TESTS=ON `
53+
-DRUN_LONG_TESTS=OFF `
54+
-DCMAKE_INSTALL_PREFIX:PATH=${{ runner.temp }}/install/ants-${{ env.ANTS_VERSION }} `
55+
${{ github.workspace }}
56+
- name: Build
57+
working-directory: ${{ runner.temp }}
58+
run: |
59+
cd build
60+
cmake --build . --config ${{ matrix.config.build_type }} --parallel
61+
- name: Test
62+
working-directory: ${{ runner.temp }}
63+
run: |
64+
cd build/ANTS-build
65+
ctest -C release
66+
- name: Install
67+
working-directory: ${{ runner.temp }}
68+
run: |
69+
cd build/ANTS-build
70+
cmake --install .
71+
- name: Pack
72+
working-directory: ${{ runner.temp }}
73+
run: |
74+
cd install
75+
7z a ${{ env.ARTIFACT }} .
76+
- name: Upload release asset
77+
# Previously was using actions/upload-release-asset@v1 , but this had some
78+
# errors with large files
79+
uses: ncipollo/[email protected]
80+
with:
81+
allowUpdates: true
82+
omitBodyDuringUpdate: true
83+
omitNameDuringUpdate: true
84+
artifacts: "${{ env.ARTIFACT }}"
85+
artifactContentType: application/zip
86+
token: ${{ secrets.GITHUB_TOKEN }}

SuperBuild/External_ITKv5.cmake

+3-1
Original file line numberDiff line numberDiff line change
@@ -109,7 +109,8 @@ if(NOT DEFINED ${extProjName}_DIR AND NOT ${USE_SYSTEM_${extProjName}})
109109
string(REPLACE "-fopenmp" "" ITK_CMAKE_C_FLAGS "${CMAKE_C_FLAGS}")
110110
string(REPLACE "-fopenmp" "" ITK_CMAKE_CXX_FLAGS "${CMAKE_CX_FLAGS}")
111111

112-
find_package(ZLIB REQUIRED)
112+
# ITK now has zlib-ng, so we no longer depend on system zlib
113+
# find_package(ZLIB REQUIRED)
113114

114115
set(${proj}_CMAKE_OPTIONS
115116
-DBUILD_TESTING:BOOL=OFF
@@ -129,6 +130,7 @@ if(NOT DEFINED ${extProjName}_DIR AND NOT ${USE_SYSTEM_${extProjName}})
129130
#-DITK_INSTALL_NO_DEVELOPMENT:BOOL=ON
130131
-DKWSYS_USE_MD5:BOOL=ON # Required by SlicerExecutionModel
131132
-DITK_WRAPPING:BOOL=OFF #${BUILD_SHARED_LIBS} ## HACK: QUICK CHANGE
133+
-DITKZLIB:BOOL=ON
132134
-DModule_MGHIO:BOOL=ON
133135
-DModule_ITKReview:BOOL=ON
134136
-DModule_GenericLabelInterpolator:BOOL=ON

0 commit comments

Comments
 (0)