Skip to content

Build

Build #22

Workflow file for this run

name: Build
on:
workflow_dispatch:
inputs:
debug_enabled:
type: boolean
description: 'Run the build with tmate debugging enabled (https://github.com/marketplace/actions/debugging-with-tmate)'
required: false
default: false
use_cached_itksnap_build:
type: boolean
description: 'Use cached build results from last run'
required: false
default: false
# push:
# release:
# types:
# - published
jobs:
build_wheels:
name: Build wheels on ${{ matrix.os }}
runs-on: ${{ matrix.os }}
strategy:
matrix:
# os: [ubuntu-20.04,macos-13,macos-14,windows-2019]
os: [ubuntu-20.04]
steps:
# Setup ninja
- name: Setup Ninja
uses: seanmiddleditch/gha-setup-ninja@master
# Install system packages
- name: Install System Packages
uses: ConorMacBride/install-package@v1
with:
brew: curl
apt: libcurl4-openssl-dev
choco: curl
# Install Qt
- name: Install Qt on Ubuntu
uses: jurplel/install-qt-action@v4
if: ${{ startsWith(matrix.os,'ubuntu') }}
with:
version: '6.6.3'
host: 'linux'
target: 'desktop'
arch: 'gcc_64'
# Use cached VTK build if available
- name: Cache VTK
id: cache-vtk
uses: actions/cache@v4
with:
path: ${{github.workspace}}/vtk/install
key: ${{ runner.os }}-vtk-9.3.1
# Check out VTK
- name: Checkout VTK
if: steps.cache-vtk.outputs.cache-hit != 'true'
uses: actions/checkout@v4
with:
repository: 'Kitware/VTK.git'
ref: 'v9.3.1'
submodules: true
path: 'vtk'
# Build VTK
- name: Build VTK
if: steps.cache-vtk.outputs.cache-hit != 'true'
uses: threeal/[email protected]
with:
source-dir: ${{github.workspace}}/vtk
build-dir: ${{github.workspace}}/vtk/build
build-args: |
-t
install
generator: Ninja
options: |
BUILD_TESTING:BOOL=FALSE
BUILD_EXAMPLES:BOOL=FALSE
BUILD_SHARED_LIBS:BOOL=FALSE
VTK_REQUIRED_OBJCXX_FLAGS:STRING=
VTK_GROUP_ENABLE_Qt:STRING=YES
VTK_MODULE_ENABLE_VTK_GUISupportQtQuick:STRING=NO
VTK_MODULE_ENABLE_VTK_GUISupportQtSQL:STRING=NO
CMAKE_INSTALL_PREFIX=${{github.workspace}}/vtk/install
# Use cached ITK build if available. Unfortunately ITK make install fails to
# install one file, vnl_vector_ref.hxx so instead of caching the install dir
# we are caching the build dir
- name: Cache ITK
id: cache-itk
uses: actions/cache@v4
with:
path: ${{github.workspace}}/itk
key: ${{ runner.os }}-itk-5.4.0-build
# Check out ITK
- name: Checkout ITK
if: steps.cache-itk.outputs.cache-hit != 'true'
uses: actions/checkout@v4
with:
repository: 'InsightSoftwareConsortium/ITK.git'
ref: 'v5.4.0'
submodules: true
path: 'itk'
# Build ITK
- name: Build ITK
if: steps.cache-itk.outputs.cache-hit != 'true'
uses: threeal/[email protected]
with:
source-dir: ${{github.workspace}}/itk
build-dir: ${{github.workspace}}/itk/build
build-args: |
-t
install
generator: Ninja
options: |
BUILD_TESTING:BOOL=FALSE
BUILD_EXAMPLES:BOOL=FALSE
Module_MorphologicalContourInterpolation:BOOL=TRUE
CMAKE_INSTALL_PREFIX=${{github.workspace}}/itk/install
# Checkout ITK-SNAP code
- name: Checkout code
uses: actions/checkout@v4
with:
submodules: true
path: 'itksnap'
# Use cached ITK build if available. Unfortunately ITK make install fails to
# install one file, vnl_vector_ref.hxx so instead of caching the install dir
# we are caching the build dir
- name: Restore ITK-SNAP Cache (optional)
id: cache-restore-itksnap
uses: actions/cache/restore@v4
if: ${{ github.event_name == 'workflow_dispatch' && inputs.use_cached_itksnap_build }}
with:
path: ${{github.workspace}}/itksnap/build
key: ${{ runner.os }}-itksnap-${{ github.ref }}-build
- name: Setup tmate session
uses: mxschmitt/action-tmate@v3
if: ${{ github.event_name == 'workflow_dispatch' && inputs.debug_enabled }}
# Build ITK-SNAP
- name: Build ITK-SNAP
uses: threeal/[email protected]
continue-on-error: true
with:
source-dir: ${{github.workspace}}/itksnap
build-dir: ${{github.workspace}}/itksnap/build
build-args: |
-t
install
generator: Ninja
options: |
ITK_DIR=${{github.workspace}}/itk/build
VTK_DIR=${{github.workspace}}/vtk/install/lib/cmake/vtk-9.3
CMAKE_PREFIX_PATH=${{github.workspace}}/../Qt/6.6.3/linux/lib/cmake
CMAKE_BUILD_TYPE=Release
# Cache the ITK-SNAP build
- name: Cache ITK-SNAP build directory
uses: actions/cache/save@v4
with:
path: ${{github.workspace}}/itksnap/build
key: ${{ runner.os }}-itksnap-${{ github.ref }}-build