diff --git a/.github/workflows/build-test.yml b/.github/workflows/build-test.yml new file mode 100644 index 0000000..8bb89f6 --- /dev/null +++ b/.github/workflows/build-test.yml @@ -0,0 +1,176 @@ +name: Build and ctest and recon_test_pack CI + +on: + push: + branches: + - master + paths-ignore: + - '.appveyor.yml' + - 'CITATION.cff' + - '**/*.md' + - '**/*.html' + - '**/*.htm' + - '**/*.tex' + + pull_request: + branches: + - master + paths-ignore: + - '.appveyor.yml' + - 'CITATION.cff' + - '**/*.md' + - '**/*.html' + - '**/*.htm' + - '**/*.tex' + +jobs: + build: + + runs-on: ${{ matrix.os }} + strategy: + matrix: + include: + - os: ubuntu-latest + compiler: gcc + compiler_version: 9 + BUILD_TYPE: "Release" + - os: ubuntu-latest + compiler: gcc + compiler_version: 9 + BUILD_TYPE: "Debug" + - os: ubuntu-latest + compiler: gcc + compiler_version: 13 + BUILD_TYPE: "Release" + - os: ubuntu-latest + compiler: clang + BUILD_TYPE: "Release" + + # let's run all of them, as opposed to aborting when one fails + fail-fast: false + + name: ${{ matrix.os }}-${{ matrix.compiler }}${{ matrix.compiler_version }}-${{ matrix.BUILD_TYPE }} + + steps: + - uses: actions/checkout@v4 + with: + submodules: recursive + + - name: set_compiler_variables + shell: bash + run: | + set -ex + if test 'XX${{ matrix.compiler }}' = 'XXclang'; then + CC="clang" + CXX="clang++" + elif test 'XX${{ matrix.compiler }}' = 'XXgcc'; then + CC="gcc" + CXX="g++" + fi + if test 'XX${{ matrix.compiler_version }}' != 'XX'; then + CC=${CC}-${{ matrix.compiler_version }} + CXX=${CXX}-${{ matrix.compiler_version }} + fi + if test 'XX${{ matrix.os }}' = 'XXmacOS-latest'; then + if test 'XX${{ matrix.compiler }}' = 'XXclang'; then + brew install llvm@${{ matrix.compiler_version }} + if test XX${HOMEBREW_PREFIX} = XX; then + HOMEBREW_PREFIX=/usr/local + fi + LDFLAGS="-L$HOMEBREW_PREFIX/opt/llvm/lib/c++ -Wl,-rpath,$HOMEBREW_PREFIX/opt/llvm/lib/c++" + # make available to jobs below + echo LDFLAGS="$LDFLAGS" >> $GITHUB_ENV + CC="$HOMEBREW_PREFIX/opt/llvm/bin/clang" + CXX="$HOMEBREW_PREFIX/opt/llvm/bin/clang++" + fi + fi + export CC CXX + # make available to jobs below + echo CC="$CC" >> $GITHUB_ENV + echo CXX="$CXX" >> $GITHUB_ENV + + - name: install_dependencies + shell: bash + run: | + set -ex + # We will install some external dependencies here + CMAKE_INSTALL_PREFIX=${GITHUB_WORKSPACE}/install + case ${{matrix.os}} in + (ubuntu*) + sudo apt update + # install compiler + if test 'XX${{ matrix.compiler }}' = 'XXclang'; then + # package is called clang, need libomp-dev for OpenMP support + sudo apt install $CC libomp-dev + else + sudo apt install $CXX + fi + # other dependencies + sudo apt install libinsighttoolkit5-dev + (macOS*) + brew install itk + ;; + esac + echo PYTHON_EXECUTABLE="$PYTHON_EXECUTABLE" >> $GITHUB_ENV + + - name: ccache + uses: hendrikmuhs/ccache-action@v1 + with: + key: ${{ matrix.os }}-${{ matrix.compiler }}${{ matrix.compiler_version }}-${{ matrix.BUILD_TYPE }} + + - name: configure + shell: bash + env: + BUILD_TYPE: ${{ matrix.BUILD_TYPE }} + BUILD_FLAGS: ${{ matrix.BUILD_FLAGS }} + run: | + set -ex + cmake --version + if test "XX$CC" != "XX"; then + $CC --version + $CXX --version + fi + CMAKE_INSTALL_PREFIX=${GITHUB_WORKSPACE}/install + # make available to jobs below + echo CMAKE_INSTALL_PREFIX="$CMAKE_INSTALL_PREFIX" >> $GITHUB_ENV + EXTRA_BUILD_FLAGS="-DCMAKE_INSTALL_PREFIX=${CMAKE_INSTALL_PREFIX} -DCMAKE_BUILD_TYPE=${BUILD_TYPE}" + echo "cmake flags $BUILD_FLAGS $EXTRA_BUILD_FLAGS" + mkdir build + cd build + cmake -S .. ${BUILD_FLAGS} ${EXTRA_BUILD_FLAGS} + + - name: build + shell: bash + env: + BUILD_TYPE: ${{ matrix.BUILD_TYPE }} + run: | + cd ${GITHUB_WORKSPACE}/build; + cmake --build . -j 2 --config ${BUILD_TYPE}} --target install + + - name: ctest + shell: bash + env: + BUILD_TYPE: ${{ matrix.BUILD_TYPE }} + run: | + set -vx + cd ${GITHUB_WORKSPACE}/build + ctest --output-on-failure -C ${BUILD_TYPE} + + - name: Upload ctest log files for debugging + uses: actions/upload-artifact@v4 + if: failure() + with: + name: ctest_log_files-${{ matrix.os }}-${{ matrix.compiler }}${{ matrix.compiler_version }}-${{ matrix.BUILD_TYPE }} + path: | + ${{ github.workspace }}/build/**/*.log + retention-days: 7 + + - name: CPack + shell: bash + env: + BUILD_TYPE: ${{ matrix.BUILD_TYPE }} + run: | + set -vx + cd ${GITHUB_WORKSPACE}/build + cpack + \ No newline at end of file diff --git a/.travis.yml b/.travis.yml deleted file mode 100644 index 11bf116..0000000 --- a/.travis.yml +++ /dev/null @@ -1,48 +0,0 @@ -language: cpp -addons: - apt: - packages: - - cmake - sources: - - kalakris-cmake -matrix: - include: - - os: osx - compiler: clang - env: ITK_VERSION=v5.2.0 - - os: linux - compiler: gcc - env: ITK_VERSION=v5.2.0 -cache: -- directories: - - $HOME/itk-v5.2.0-build - - $HOME/itk-v5.2.0 -before_script: -- export NUM_THREADS=4 -- export ITK_SOURCE_DIR=$HOME/itk-${ITK_VERSION} -- export ITK_BUILD_DIR=${ITK_SOURCE_DIR}-build -- if ! test -e ${ITK_SOURCE_DIR}/CMakeLists.txt; then rm -fr $ITK_SOURCE_DIR; fi -- if ! test -d ${ITK_SOURCE_DIR}; then git clone --branch ${ITK_VERSION} https://github.com/InsightSoftwareConsortium/ITK.git - ${ITK_SOURCE_DIR}; fi -- if ! test -d ${ITK_BUILD_DIR}; then mkdir ${ITK_BUILD_DIR}; fi -- cd ${ITK_BUILD_DIR} -- cmake ${ITK_SOURCE_DIR} -DCMAKE_BUILD_TYPE=Release -DBUILD_EXAMPLES=OFF -DBUILD_TESTING=OFF - -DModule_ITKReview=ON -- make --jobs=$NUM_THREADS --keep-going -- cd - -- cd .. -- mkdir build -- cd build -- cmake ../PETPVC -DCMAKE_BUILD_TYPE=Release -script: cmake --build . && ctest && cpack -deploy: - - provider: releases - api_key: - secure: "LWWJLSgd88a0DEc7FycHCVvZeNLMZd/2ETnsVchdcweFbYnBEMFHlVfOXaKihD9g5GNGDaHrOKsmV4R9741Zww5k9VAUI5288bJFGfibeyi+ewKm41LwTaaZMPVDhvhMcu7BAFm19EafeCgC1ft0BaBc9Ri8dvXCE8LKdUWWdPBD4S8EKN79vJfxGwXUZ/fGTbWtkHwwwYVw9Vcm038/A3vzqVIMhdYJzXYpzXiYHqoCGO4rpA4gS4oX9/EgjR/KkQNvPhOSVTWZw5gjLnVqRvWuUDqEyIfNN256SSrH6KjIParuOjidDkBgpxV7XP+haQpBAZjtoBLorkF04cs0m057KIXr6iPZhj0yorCFfq0XSLRc4mci46+bc683eVEMEsa0Ba2SrPNggIh0IMHfhOuPM6XcMxjvmj2AH2C/uXoHEf/F8shoKPeF5R57QtNFnIFAR/L1z76qVGq8gkSEHOBckNW39PJbkMsVyT0bVCoZJNZRskZoCZKb6QyMULFSojZrveUD84IR3bASeXSqAcfrmFI5kl55tsREHF8i24z+iHXf01aTvI79iv0laVdNZP54zgpKsf7PVwwQ+6vFZIMRs5FUm4JnADmofP32p7nAp5nmDTHLNm6u5MFAkWuWbRizC8zj+BPMhA8emRpVcO3u0pFCD9JgZKMVRK06DY8=" - file: "*.tar.gz" - file_glob: true - draft: true - skip_cleanup: true - on: - tags: true - all_branches: true diff --git a/CMakeLists.txt b/CMakeLists.txt index 1c34d3c..c432410 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -28,7 +28,7 @@ endif() SET(VERSION_MAJOR 1) SET(VERSION_MINOR 2) -SET(VERSION_PATCH 11) +SET(VERSION_PATCH 12) MAKE_DIRECTORY(${PROJECT_BINARY_DIR}/config) diff --git a/README.md b/README.md index 58aac4b..82abf4b 100644 --- a/README.md +++ b/README.md @@ -1,5 +1,5 @@ # PETPVC -[![Build Status](https://travis-ci.org/UCL/PETPVC.svg?branch=master)](https://travis-ci.org/UCL/PETPVC) [![Build Status](https://dev.azure.com/petpvc/petpvc/_apis/build/status/UCL.PETPVC?branchName=master)](https://dev.azure.com/petpvc/petpvc/_build/latest?definitionId=1&branchName=master) [![Build status](https://ci.appveyor.com/api/projects/status/7kk9ua9r0lybinwa/branch/master?svg=true)](https://ci.appveyor.com/project/bathomas/petpvc/branch/master) [![Codacy Badge](https://api.codacy.com/project/badge/Grade/ab83c41f20194c2c82fbc74e8788f928)](https://www.codacy.com/app/bathomas/PETPVC?utm_source=github.com&utm_medium=referral&utm_content=UCL/PETPVC&utm_campaign=badger) [![DOI](https://zenodo.org/badge/17082200.svg)](https://zenodo.org/badge/latestdoi/17082200) +[![Build Status](https://dev.azure.com/petpvc/petpvc/_apis/build/status/UCL.PETPVC?branchName=master)](https://dev.azure.com/petpvc/petpvc/_build/latest?definitionId=1&branchName=master) [![Build status](https://ci.appveyor.com/api/projects/status/7kk9ua9r0lybinwa/branch/master?svg=true)](https://ci.appveyor.com/project/bathomas/petpvc/branch/master) [![Codacy Badge](https://api.codacy.com/project/badge/Grade/ab83c41f20194c2c82fbc74e8788f928)](https://www.codacy.com/app/bathomas/PETPVC?utm_source=github.com&utm_medium=referral&utm_content=UCL/PETPVC&utm_campaign=badger) [![DOI](https://zenodo.org/badge/17082200.svg)](https://zenodo.org/badge/latestdoi/17082200) PETPVC: toolbox for partial volume correction (PVC) in positron emission tomography (PET)