From 4ba6a2fc3c907182544aa63c00e401bd5cef027f Mon Sep 17 00:00:00 2001 From: Jean-Christophe Fillion-Robin Date: Tue, 2 Apr 2024 15:11:41 -0400 Subject: [PATCH] ENH: Switch from CircleCI to GitHub Action for building CTK Streamline the build process by eliminating reliance on the `slicer/buildenv-qt5-centos7:latest` Docker image in favor of direct host-based builds. Python, Qt, VTK, and DCMTK are now installed directly on the host system. Build on ubuntu-latest (22.04) installs Qt 5.15.2 --- .circleci/config.yml | 66 ---------------------------- .github/workflows/ci.yml | 95 ++++++++++++++++++++++++++++++++++++++++ 2 files changed, 95 insertions(+), 66 deletions(-) delete mode 100644 .circleci/config.yml create mode 100644 .github/workflows/ci.yml diff --git a/.circleci/config.yml b/.circleci/config.yml deleted file mode 100644 index 25300f39d6..0000000000 --- a/.circleci/config.yml +++ /dev/null @@ -1,66 +0,0 @@ -version: 2 -jobs: - - build-qt5: - working_directory: /usr/src/CTK - docker: - - image: slicer/buildenv-qt5-centos7:latest - steps: - - checkout - - run: - name: Configure and build - command: | - mkdir /usr/src/CTK-build - cd /usr/src/CTK-build - cmake \ - -DCTK_QT_VERSION:STRING=5 \ - -DCTK_ENABLE_Widgets:BOOL=ON \ - ../CTK - make -j4 - - save_cache: - key: ctk-src-{{ .Revision }} - paths: /usr/src/CTK - - save_cache: - key: ctk-build-qt5-{{ .Revision }} - paths: /usr/src/CTK-build - - save_cache: - key: ctk-qt5-libraries-{{ .Revision }} - paths: /opt/qt - -# test-qt5: -# docker: -# - image: thewtex/opengl:debian -# steps: -# - restore_cache: -# keys: -# - ctk-src-{{ .Revision }} -# - restore_cache: -# keys: -# - ctk-build-qt5-{{ .Revision }} -# - restore_cache: -# keys: -# - ctk-qt5-libraries-{{ .Revision }} -# - run: -# name: Workaround the difference between cmake install path in 'slicer/buildenv-*' and 'thewtex/opengl:debian' images -# command: | -# mkdir -p /usr/src/cmake-3.11.0-Linux-x86_64/bin -# ln -s $(which cmake) /usr/src/cmake-3.11.0-Linux-x86_64/bin/cmake -# ln -s $(which cpack) /usr/src/cmake-3.11.0-Linux-x86_64/bin/cpack -# ln -s $(which ctest) /usr/src/cmake-3.11.0-Linux-x86_64/bin/ctest -# - run: -# command: | -# export APP="sudo chown -R user.user /usr/src/CTK-build && cd /usr/src/CTK-build/CTK-build && ctest -VV" -# /usr/bin/supervisord -c /etc/supervisor/supervisord.conf -# [ "$(cat /tmp/graphical-app.return_code)" = 0 ] -# environment: -# QT_X11_NO_MITSHM: "1" -# XDG_RUNTIME_DIR: "/tmp/runtime-user" - -workflows: - version: 2 - build-test: - jobs: - - build-qt5 -# - test-qt5: -# requires: -# - build-qt5 diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml new file mode 100644 index 0000000000..cb269a6817 --- /dev/null +++ b/.github/workflows/ci.yml @@ -0,0 +1,95 @@ +name: CI (Build) + +on: + # Triggers the workflow on push or pull request events + push: + branches: + - "master" + pull_request: + branches: + - "*" + # Allows running this workflow manually from the Actions tab + workflow_dispatch: + + +permissions: + contents: read + +jobs: + build: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@9bb56186c3b09b4f86b1c65136769dd318469633 # v4.1.2 + + - name: Setup CMake + uses: jwlawson/actions-setup-cmake@959f1116cf9f1ae42fff8ec1a4aaae6d4a0e348b # v2.0.1 + with: + cmake-version: "3.16.3" + + - name: Display CMake version + run: | + cmake --version + + - name: Retrieve new lists of APT packages + run: sudo apt-get update + + - name: Install DCMTK + run: | + sudo apt-get install -y \ + dcmtk \ + libdcmtk-dev + + - name: Install Qt + run: | + sudo apt-get install -y \ + qtbase5-dev \ + qtmultimedia5-dev \ + qttools5-dev \ + libqt5xmlpatterns5-dev \ + libqt5svg5-dev \ + qtwebengine5-dev \ + qtscript5-dev \ + qtbase5-private-dev \ + libqt5x11extras5-dev \ + libxt-dev + + - name: Install VTK + run: | + sudo apt-get install -y \ + libvtk9-dev \ + libvtk9-qt-dev + + - name: Configure CTK + run: | + cmake \ + -DCTK_QT_VERSION:STRING=5 \ + -DCTK_ENABLE_Widgets:BOOL=ON \ + -DCTK_USE_SYSTEM_VTK:BOOL=ON \ + -DCTK_LIB_Visualization/VTK/Widgets:BOOL=ON \ + -DCTK_LIB_Visualization/VTK/Widgets_USE_TRANSFER_FUNCTION_CHARTS:BOOL=ON \ + -DCTK_USE_SYSTEM_DCMTK:BOOL=ON \ + -DCTK_APP_ctkDICOM:BOOL=ON \ + -DCTK_LIB_DICOM/Core:BOOL=ON \ + -DCTK_LIB_DICOM/Widgets:BOOL=ON \ + -DCTK_LIB_Scripting/Python/Core:BOOL=ON \ + -DCTK_LIB_Scripting/Python/Core_PYTHONQT_USE_VTK:BOOL=ON \ + -DCTK_LIB_Scripting/Python/Core_PYTHONQT_WRAP_QTCORE:BOOL=ON \ + -DCTK_LIB_Scripting/Python/Core_PYTHONQT_WRAP_QTGUI:BOOL=ON \ + -DCTK_LIB_Scripting/Python/Core_PYTHONQT_WRAP_QTUITOOLS:BOOL=ON \ + -DCTK_LIB_Scripting/Python/Core_PYTHONQT_WRAP_QTNETWORK:BOOL=ON \ + -DCTK_LIB_Scripting/Python/Core_PYTHONQT_WRAP_QTMULTIMEDIA:BOOL=ON \ + -DCTK_LIB_Scripting/Python/Core_PYTHONQT_WRAP_QTWEBKIT:BOOL=OFF \ + -DCTK_LIB_Scripting/Python/Widgets:BOOL=ON \ + -DCTK_ENABLE_Python_Wrapping:BOOL=ON \ + -B CTK-build \ + -S . + + + - name: Display Qt5_DIR + run: | + cat CTK-build/CMakeCache.txt | grep ^Qt5_DIR + + - name: Build CTK + run: | + cmake \ + --build CTK-build -- -j4