Updated modules in find_package command for Python3 #826
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: native | |
on: | |
push: | |
branches: [master] | |
paths-ignore: | |
- 'docker/Dockerfile' | |
- 'docker/*yml' | |
- '**.md' | |
- 'VirtualBox/**' | |
- '.github/workflows/*docker*' | |
- 'CITATION.cff' | |
- '.mailmap' | |
- 'NOTICE.txt' | |
- 'LICENSE.txt' | |
pull_request: | |
branches: [master] | |
paths-ignore: | |
- 'docker/Dockerfile' | |
- 'docker/*yml' | |
- '**.md' | |
- 'VirtualBox/**' | |
- '.github/workflows/*docker*' | |
- 'CITATION.cff' | |
- '.mailmap' | |
- 'NOTICE.txt' | |
- 'LICENSE.txt' | |
workflow_dispatch: | |
inputs: | |
tmate: | |
description: Debug with tmate ssh session | |
type: boolean | |
default: false | |
required: true | |
jobs: | |
build-test: | |
runs-on: ${{ matrix.os }} | |
defaults: {run: {shell: 'bash -el {0}'}} | |
env: | |
COMPILER: gcc | |
BUILD_TYPE: Release | |
strategy: | |
matrix: | |
include: | |
- os: ubuntu-latest | |
compiler_version: 9 | |
EXTRA_BUILD_FLAGS: "-DUSE_ITK=ON -DBUILD_CIL=ON -DUSE_SYSTEM_Armadillo=ON -DUSE_SYSTEM_Boost=ON -DUSE_SYSTEM_FFTW3=ON -DUSE_SYSTEM_HDF5=ON -DBUILD_siemens_to_ismrmrd=ON -DUSE_SYSTEM_SWIG=ON" | |
DEVEL_BUILD: "OFF" | |
- os: ubuntu-latest | |
compiler_version: 9 | |
EXTRA_BUILD_FLAGS: "-DUSE_ITK=ON -DBUILD_CIL=ON -DUSE_SYSTEM_Armadillo=ON -DUSE_SYSTEM_Boost=ON -DUSE_SYSTEM_FFTW3=OFF -DUSE_SYSTEM_HDF5=OFF -DBUILD_siemens_to_ismrmrd=ON -DUSE_SYSTEM_SWIG=OFF" | |
DEVEL_BUILD: "OFF" | |
#- os: ubuntu-latest | |
# compiler_version: 9 | |
# EXTRA_BUILD_FLAGS: "-DUSE_ITK=ON -DBUILD_CIL=ON -DUSE_SYSTEM_Armadillo=ON -DUSE_SYSTEM_Boost=OFF -DUSE_SYSTEM_FFTW3=ON -DUSE_SYSTEM_HDF5=ON -DBUILD_siemens_to_ismrmrd=ON -DUSE_SYSTEM_SWIG=ON" | |
# DEVEL_BUILD: "OFF" | |
- os: ubuntu-latest | |
compiler_version: 9 | |
EXTRA_BUILD_FLAGS: "-DUSE_ITK=ON -DBUILD_CIL=ON -DUSE_SYSTEM_Armadillo=ON -DUSE_SYSTEM_Boost=ON -DUSE_SYSTEM_FFTW3=ON -DUSE_SYSTEM_HDF5=ON -DBUILD_siemens_to_ismrmrd=ON -DUSE_SYSTEM_SWIG=ON -DUSE_SYSTEM_GTest=OFF" | |
DEVEL_BUILD: "OFF" | |
- os: ubuntu-latest | |
compiler_version: 11 | |
EXTRA_BUILD_FLAGS: "-DUSE_ITK=ON -DBUILD_CIL=ON -DUSE_SYSTEM_Armadillo=OFF -DUSE_SYSTEM_Boost=ON -DUSE_SYSTEM_FFTW3=ON -DUSE_SYSTEM_HDF5=ON -DBUILD_siemens_to_ismrmrd=ON -DUSE_SYSTEM_SWIG=ON -DUSE_ROOT:BOOL=ON -DUSE_SYSTEM_ROOT=ON -DSIRF_EXTRA_CMAKE_ARGS=-DCMAKE_POLICY_DEFAULT_CMP0074=NEW" # note: SIRF needs CMP0074 with older versions of pre-built ROOT (see below) | |
DEVEL_BUILD: "ON" | |
- os: ubuntu-latest | |
compiler_version: 11 | |
EXTRA_BUILD_FLAGS: "-DUSE_ITK=ON -DBUILD_CIL=ON -DUSE_SYSTEM_Armadillo=OFF -DUSE_SYSTEM_Boost=ON -DUSE_SYSTEM_FFTW3=ON -DUSE_SYSTEM_HDF5=ON -DBUILD_siemens_to_ismrmrd=ON -DUSE_SYSTEM_SWIG=ON -DUSE_ROOT:BOOL=ON -DUSE_SYSTEM_ROOT=ON -DSIRF_EXTRA_CMAKE_ARGS=-DCMAKE_POLICY_DEFAULT_CMP0074=NEW" # note: SIRF needs CMP0074 with older versions of pre-built ROOT (see below) | |
DEVEL_BUILD: "OFF" | |
fail-fast: false # don't terminate matrix if one job fails | |
steps: | |
- uses: actions/checkout@v4 | |
- if: contains(matrix.os, fromJSON('["ubuntu","macos"]')) | |
name: increase disk space | |
run: sudo .github/workflows/GHA_increase_disk_space.sh | |
- id: deps | |
name: install dependencies | |
working-directory: docker | |
run: | | |
sudo ./raw-ubuntu.sh | |
sudo ./build_system-ubuntu.sh | |
sudo ./build_essential-ubuntu.sh | |
sudo ./build_gadgetron-ubuntu.sh | |
sudo ./build_python-ubuntu.sh | |
echo "python-version=$(python3 --version | awk '{print $2}')" >> $GITHUB_OUTPUT | |
- name: optionally install ROOT | |
env: | |
EXTRA_BUILD_FLAGS: ${{ matrix.EXTRA_BUILD_FLAGS }} | |
run: | | |
sh -ex | |
if expr match "${EXTRA_BUILD_FLAGS}" ".*-DUSE_SYSTEM_ROOT=ON.*" >/dev/null | |
then | |
# Install ROOT (warning: currently only valid on Ubuntu) | |
ROOT_file=root_v6.28.12.Linux-ubuntu20-x86_64-gcc9.4.tar.gz | |
wget https://root.cern/download/"$ROOT_file" | |
tar -xzf "$ROOT_file" | |
rm "$ROOT_file" | |
source root/bin/thisroot.sh | |
echo ROOT_DIR="$ROOTSYS/cmake" >> $GITHUB_ENV | |
echo ROOTSYS="$ROOTSYS" >> $GITHUB_ENV | |
echo | |
# work-around problem with problem with Vdt for ROOT version pre-6.30.04 as per https://github.com/root-project/root/pull/14178 | |
echo Vdt_ROOT="$ROOTSYS" >> $GITHUB_ENV | |
# thisroot modifies the following | |
case ${{matrix.os}} in | |
(ubuntu*) | |
echo LD_LIBRARY_PATH="${CMAKE_INSTALL_PREFIX}/lib:$LD_LIBRARY_PATH" >> $GITHUB_ENV | |
echo PATH="$PATH" >> $GITHUB_ENV | |
;; | |
(macOS*) # future-proof | |
echo DYLD_FALLBACK_LIBRARY_PATH="${CMAKE_INSTALL_PREFIX}/lib:$DYLD_FALLBACK_LIBRARY_PATH" >> $GITHUB_ENV | |
echo PATH="$PATH" >> $GITHUB_ENV | |
;; | |
(windows*) # future-proof | |
echo PATH="${CMAKE_INSTALL_PREFIX}/lib:${CMAKE_INSTALL_PREFIX}/bin:$PATH" >> $GITHUB_ENV | |
;; | |
esac | |
fi | |
- uses: actions/setup-python@v5 | |
with: | |
python-version: '${{ steps.deps.outputs.python-version }}' | |
cache: pip | |
- name: pip install | |
working-directory: docker | |
run: PYTHON_EXECUTABLE=python3 PYTHON_INSTALL_DIR="$HOME/virtualenv" ./user_python-ubuntu.sh | |
- uses: hendrikmuhs/ccache-action@v1 | |
with: | |
key: ${{ matrix.os }}-${{ env.COMPILER }}-${{ matrix.compiler_version }}-${{ env.BUILD_TYPE }}-${{ github.ref_name }}-${{ github.run_id }} | |
restore-keys: | | |
${{ matrix.os }}-${{ env.COMPILER }}-${{ matrix.compiler_version }}-${{ env.BUILD_TYPE }}-${{ github.ref_name }} | |
${{ matrix.os }}-${{ env.COMPILER }}-${{ matrix.compiler_version }}-${{ env.BUILD_TYPE }} | |
append-timestamp: false | |
- name: export CC CXX | |
run: | | |
set -ex | |
if test '${{ env.COMPILER }}' = clang; then | |
CC=clang | |
CXX=clang++ | |
elif test '${{ env.COMPILER }}' = gcc; then | |
CC=gcc | |
CXX=g++ | |
fi | |
if test -n '${{ matrix.compiler_version }}'; then | |
CC=${CC}-${{ matrix.compiler_version }} | |
CXX=${CXX}-${{ matrix.compiler_version }} | |
sudo apt install -yq ${CXX} ${CC} | |
fi | |
# make available to jobs below | |
echo "CC=$CC" >> $GITHUB_ENV | |
echo "CXX=$CXX" >> $GITHUB_ENV | |
- name: cmake -S . | |
env: | |
EXTRA_BUILD_FLAGS: ${{ matrix.EXTRA_BUILD_FLAGS }} | |
CMAKE_BUILD_TYPE: ${{ env.BUILD_TYPE }} | |
DEVEL_BUILD: "-DDEVEL_BUILD=${{ matrix.DEVEL_BUILD }}" | |
run: | | |
set -ex | |
export PATH="/usr/lib/ccache:/usr/local/opt/ccache/libexec:$PATH" | |
export superbuild=`pwd` | |
export BUILD_FLAGS="-DCMAKE_INSTALL_PREFIX=~/install -DPYVER=3 -DUSE_SYSTEM_RocksDB=OFF -DBUILD_TESTING_Gadgetron:BOOL=ON" | |
source ~/virtualenv/bin/activate | |
cmake -S ${GITHUB_WORKSPACE} -B ./build ${BUILD_FLAGS} ${EXTRA_BUILD_FLAGS} ${DEVEL_BUILD}; | |
- name: cmake --build | |
run: | | |
source ~/virtualenv/bin/activate | |
cmake --build ./build -j 2 | |
# tmate ssh debugging | |
- if: github.event_name == 'workflow_dispatch' && github.event.inputs.tmate == 'true' | |
uses: mxschmitt/action-tmate@v3 | |
timeout-minutes: 15 | |
- if: failure() | |
name: Upload build log files for debugging | |
uses: actions/upload-artifact@v4 | |
with: | |
name: build_log_files-${{ matrix.os }}-${{ env.COMPILER }}${{ matrix.compiler_version }}-${{ env.BUILD_TYPE }}-DEVEL=${{ matrix.DEVEL_BUILD }} | |
path: ${{ github.workspace }}/build/**/*.log | |
retention-days: 7 | |
- name: ctest | |
run: ./docker/ctest_sirf.sh |