Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ENH: Multiple enhancements (zlib, testing, Windows binaries) #1

Merged
merged 3 commits into from
Jan 12, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions .github/workflows/release-binaries.yml
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,9 @@ jobs:
cmake \
-DCMAKE_BUILD_TYPE=${{ matrix.config.build_type }} \
-G "${{ matrix.config.generators }}" \
-DBUILD_TESTING=ON \
-DRUN_SHORT_TESTS=ON \
-DRUN_LONG_TESTS=OFF \
-DCMAKE_INSTALL_PREFIX:PATH=${{ runner.temp }}/install/ants-${{ env.ANTS_VERSION }} \
${GITHUB_WORKSPACE}
- name: Build
Expand All @@ -104,6 +107,12 @@ jobs:
run: |
cd build
cmake --build . --config ${{ matrix.config.build_type }} --parallel
- name: Test
shell: bash
working-directory: ${{ runner.temp }}
run: |
cd build/ANTS-build
ctest
- name: Install
shell: bash
working-directory: ${{ runner.temp }}
Expand Down
9 changes: 9 additions & 0 deletions .github/workflows/release-docker-binaries.yml
Original file line number Diff line number Diff line change
Expand Up @@ -64,13 +64,22 @@ jobs:
cmake \
-DCMAKE_BUILD_TYPE=${{ matrix.config.build_type }} \
-G "${{ matrix.config.generators }}" \
-DBUILD_TESTING=ON \
-DRUN_SHORT_TESTS=ON \
-DRUN_LONG_TESTS=OFF \
-DCMAKE_INSTALL_PREFIX:PATH=/opt/install/ants-${{ env.ANTS_VERSION }} \
${GITHUB_WORKSPACE}
- name: Build
shell: bash
run: |
cd /opt/build
cmake --build . --config ${{ matrix.config.build_type }} --parallel 1
- name: Test
shell: bash
working-directory: ${{ runner.temp }}
run: |
cd /opt/build/ANTS-build
ctest
- name: Install
shell: bash
run: |
Expand Down
86 changes: 86 additions & 0 deletions .github/workflows/release-win-binaries.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,86 @@
# Build for Windows using visual studio
name: Native Windows release binaries

# Controls when the action will run. Triggers the workflow on push
on:
release:
types: [created]

jobs:
build:
name: ${{ matrix.config.name }}
runs-on: ${{ matrix.config.os }}
strategy:
fail-fast: false
matrix:
config:
- {
name: "Windows-22",
os: "windows-2022",
vs: "2019",
build_type: "Release"
}
steps:
- uses: actions/checkout@v3
with:
ref: ${{ github.ref }}
# Set up vs studio. Use default windows shell (powershell) not bash,
# to avoid conflicts with link executable
- uses: ilammy/msvc-dev-cmd@v1
with:
arch: ${{ runner.arch }}
vsversion: ${{ matrix.vs }}
- name: Get ANTs version
run: |
$antsVersion="${{ env.ANTS_TAG }}"
$antsVersion=$antsVersion.Substring(1)
echo "ANTS_VERSION=$antsVersion" | Out-File -FilePath $env:GITHUB_ENV -Append
env:
ANTS_TAG: ${{ github.ref_name }}
- name: Define env
run: |
echo github.event.action: ${{ github.event.action }}
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
- name: Configure
working-directory: ${{ runner.temp }}
run: |
mkdir build
cd build
cmake `
-DCMAKE_BUILD_TYPE=${{ matrix.config.build_type }} `
-DBUILD_TESTING=ON `
-DRUN_SHORT_TESTS=ON `
-DRUN_LONG_TESTS=OFF `
-DCMAKE_INSTALL_PREFIX:PATH=${{ runner.temp }}/install/ants-${{ env.ANTS_VERSION }} `
${{ github.workspace }}
- name: Build
working-directory: ${{ runner.temp }}
run: |
cd build
cmake --build . --config ${{ matrix.config.build_type }} --parallel
- name: Test
working-directory: ${{ runner.temp }}
run: |
cd build/ANTS-build
ctest -C release
- name: Install
working-directory: ${{ runner.temp }}
run: |
cd build/ANTS-build
cmake --install .
- name: Pack
working-directory: ${{ runner.temp }}
run: |
cd install
7z a ${{ env.ARTIFACT }} .
- name: Upload release asset
# Previously was using actions/upload-release-asset@v1 , but this had some
# errors with large files
uses: ncipollo/release-action@v1.11.1
with:
allowUpdates: true
omitBodyDuringUpdate: true
omitNameDuringUpdate: true
artifacts: "${{ env.ARTIFACT }}"
artifactContentType: application/zip
token: ${{ secrets.GITHUB_TOKEN }}
4 changes: 3 additions & 1 deletion SuperBuild/External_ITKv5.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,8 @@ if(NOT DEFINED ${extProjName}_DIR AND NOT ${USE_SYSTEM_${extProjName}})
string(REPLACE "-fopenmp" "" ITK_CMAKE_C_FLAGS "${CMAKE_C_FLAGS}")
string(REPLACE "-fopenmp" "" ITK_CMAKE_CXX_FLAGS "${CMAKE_CX_FLAGS}")

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

set(${proj}_CMAKE_OPTIONS
-DBUILD_TESTING:BOOL=OFF
Expand All @@ -129,6 +130,7 @@ if(NOT DEFINED ${extProjName}_DIR AND NOT ${USE_SYSTEM_${extProjName}})
#-DITK_INSTALL_NO_DEVELOPMENT:BOOL=ON
-DKWSYS_USE_MD5:BOOL=ON # Required by SlicerExecutionModel
-DITK_WRAPPING:BOOL=OFF #${BUILD_SHARED_LIBS} ## HACK: QUICK CHANGE
-DITKZLIB:BOOL=ON
-DModule_MGHIO:BOOL=ON
-DModule_ITKReview:BOOL=ON
-DModule_GenericLabelInterpolator:BOOL=ON
Expand Down