From e555c3b35827cf0992cadb4706d8bc76e93f5195 Mon Sep 17 00:00:00 2001 From: Jean-Christophe Fillion-Robin Date: Mon, 4 Jun 2018 16:10:25 -0400 Subject: [PATCH] ci: Switch to CircleCI 2.0 --- .circleci/config.yml | 124 +++++++++++++++++++++++++++++++++++++++++++ .gitignore | 6 --- circle.yml | 14 ----- 3 files changed, 124 insertions(+), 20 deletions(-) create mode 100644 .circleci/config.yml delete mode 100644 circle.yml diff --git a/.circleci/config.yml b/.circleci/config.yml new file mode 100644 index 0000000000..94db68e319 --- /dev/null +++ b/.circleci/config.yml @@ -0,0 +1,124 @@ +version: 2 +jobs: + build-qt4: + working_directory: /usr/src/CTK + docker: + - image: slicer/buildenv-qt4-centos5:latest + steps: + - checkout + - run: + name: Configure and build + command: | + mkdir /usr/src/CTK-build + cd /usr/src/CTK-build + cmake \ + -DCTK_QT_VERSION:STRING=4 \ + -DCTK_ENABLE_Widgets:BOOL=ON \ + ../CTK + make -j4 + - save_cache: + key: ctk-src-{{ .Revision }} + paths: /usr/src/CTK + - save_cache: + key: ctk-build-qt4-{{ .Revision }} + paths: /usr/src/CTK-build + - save_cache: + key: ctk-qt4-libraries-{{ .Revision }} + paths: /usr/src/qt-install + + test-qt4: + docker: + - image: thewtex/opengl:debian + steps: + - restore_cache: + keys: + - ctk-src-{{ .Revision }} + - restore_cache: + keys: + - ctk-build-qt4-{{ .Revision }} + - restore_cache: + keys: + - ctk-qt4-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/bin + ln -s $(which cmake) /usr/src/cmake-3.11.0/bin/cmake + ln -s $(which cpack) /usr/src/cmake-3.11.0/bin/cpack + ln -s $(which ctest) /usr/src/cmake-3.11.0/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" + + 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-qt4 + - test-qt4: + requires: + - build-qt4 + - build-qt5 + - test-qt5: + requires: + - build-qt5 diff --git a/.gitignore b/.gitignore index 533b4d104b..fd44437741 100644 --- a/.gitignore +++ b/.gitignore @@ -1,13 +1,7 @@ -# Ignore all dotfiles... -.* - # Ignore all back-up files... *~ *.bak -# except for .gitignore -!.gitignore - # Exclude Kdevelop4 files ... .kdev* diff --git a/circle.yml b/circle.yml deleted file mode 100644 index 232bc6466f..0000000000 --- a/circle.yml +++ /dev/null @@ -1,14 +0,0 @@ -machine: - services: - - docker - -dependencies: - override: - - docker info - - docker pull commontk/ctk-test:opengl-qt4 - - docker pull commontk/ctk-test:opengl-qt5 - -test: - override: - - ~/CTK/CMake/CircleCI/run.sh qt4 $CIRCLE_SHA1 $CIRCLE_BRANCH $SITE_BUILD_TYPE - - ~/CTK/CMake/CircleCI/run.sh qt5 $CIRCLE_SHA1 $CIRCLE_BRANCH $SITE_BUILD_TYPE