diff --git a/.github/workflows/changelog.yml b/.github/workflows/changelog.yml new file mode 100644 index 0000000..9e71e9b --- /dev/null +++ b/.github/workflows/changelog.yml @@ -0,0 +1,40 @@ +name: Changelog +on: + issue_comment: + types: [created] +jobs: + edit: + name: add entry + if: ${{ startsWith(github.event.comment.body, '@votca-bot changelog:') }} + runs-on: ubuntu-latest + steps: + - name: Check if message comes from PR + uses: octokit/request-action@v2.x + id: issue_info + with: + route: GET /repos/:repository/issues/:pull_number + repository: ${{ github.repository }} + pull_number: ${{ github.event.issue.number }} + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + - name: Get PR info + if: ${{ fromJSON(steps.issue_info.outputs.data).pull_request }} + uses: octokit/request-action@v2.x + id: pr_info + with: + route: GET /repos/:repository/pulls/:pull_number + repository: ${{ github.repository }} + pull_number: ${{ github.event.issue.number }} + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + - name: Checkout head branch from PR + if: ${{ fromJSON(steps.issue_info.outputs.data).pull_request }} + uses: actions/checkout@v2.2.0 + with: + repository: ${{ fromJSON(steps.pr_info.outputs.data).head.repo.full_name }} + ref: ${{ fromJSON(steps.pr_info.outputs.data).head.ref }} + token: ${{ secrets.VOTCA_BOT_TOKEN }} + - name: Create and commit changelog entry + if: ${{ fromJSON(steps.issue_info.outputs.data).pull_request }} + uses: votca/actions/changelog@master + with: + message: ${{ github.event.comment.body }} + pr_number: ${{ github.event.issue.number }} diff --git a/.github/workflows/continuous-integration-workflow.yml b/.github/workflows/continuous-integration-workflow.yml new file mode 100644 index 0000000..528bc50 --- /dev/null +++ b/.github/workflows/continuous-integration-workflow.yml @@ -0,0 +1,75 @@ +name: CI +on: + pull_request: + branches: + - master + - stable + +jobs: + CI: + continue-on-error: ${{ matrix.distro == 'ubuntu_devel' || matrix.distro == 'fedora_rawhide' || matrix.continue-on-error == true }} + strategy: + matrix: + distro: [latest, fedora_rawhide, opensuse, ubuntu, ubuntu_devel, ubuntu_rolling, ubuntu_18.04, intel] + toolchain: [gnu, clang] + cmake_build_type: [Release, Debug] + minimal: [false] + own_gmx: [false] + module_build: [false] + coverage: [false] + no_regression_testing: [true] + include: + - distro: latest + toolchain: gnu + cmake_build_type: Release + module_build: true + no_regression_testing: true + runs-on: ubuntu-latest + container: votca/buildenv:${{ matrix.distro }} + steps: + - uses: actions/checkout@v2.2.0 + with: + fetch-depth: 0 + - name: Run Votca Setup + id: setup + uses: votca/actions/setup@master + with: + distro: ${{ matrix.distro }} + toolchain: ${{ matrix.toolchain }} + minimal: ${{ matrix.minimal == true }} + module: ${{ matrix.module_build == true }} + own_gmx: ${{ matrix.own_gmx == true }} + regression_testing: ${{ matrix.no_regression_testing != true }} + coverage: ${{ matrix.coverage }} + cmake_build_type: ${{ matrix.cmake_build_type }} + ctest_args: ${{ matrix.ctest_args }} + cmake_args: ${{ matrix.cmake_args }} + - uses: actions/cache@v2 + with: + path: ~/.ccache + key: ${{ steps.setup.outputs.cache_key }} + restore-keys: ${{ steps.setup.outputs.cache_restore_key }} + - name: CMake + run: mkdir builddir && cd builddir && cmake ${{ steps.setup.outputs.cmake_args }} ../votca + - name: Build + run: | + ccache -z + cmake --build builddir -- -j ${{ steps.setup.outputs.jobs }} + ccache -s + - name: Tests + run: ctest --output-on-failure ${{ steps.setup.outputs.ctest_args }} + working-directory: builddir + - name: Doxygen + if: ${{ ! matrix.module_build }} + run: cmake --build builddir --target doxygen + - name: Build Sphinx + if: ${{ steps.setup.outputs.build_sphinx == 'true' }} + run: cmake --build builddir --target doc + - name: Test DESTDIR Install + if: ${{ ! matrix.module_build }} + run: DESTDIR=${PWD}/install cmake --build builddir --target install && rm -rf ${PWD}/install/usr && rmdir ${PWD}/install + - name: Install + run: sudo cmake --build builddir --target install + - name: Check Formatting + if: ${{ steps.setup.outputs.check_format == 'true' }} + run: cmake --build builddir --target format && git -C votca/${{ steps.setup.outputs.module }} diff --exit-code diff --git a/.github/workflows/create-pr.yml b/.github/workflows/create-pr.yml new file mode 100644 index 0000000..ac09e6b --- /dev/null +++ b/.github/workflows/create-pr.yml @@ -0,0 +1,37 @@ +name: Create PR +on: + push: + branches: + - stable + +jobs: + PR: + name: Create + if: github.repository_owner == 'votca' + runs-on: ubuntu-latest + steps: + - name: Checkout code + uses: actions/checkout@master + with: + ref: ${{ github.event.ref }} + fetch-depth: 0 + token: ${{ secrets.VOTCA_BOT_TOKEN }} + - name: Try to merge master branch + run: | + git config --global user.name "Votca Bot" + git config --global user.email "github@votca.org" + git checkout -b stable_fixes + git merge origin/master || true + git push origin stable_fixes + - name: Create Pull Request + uses: actions/github-script@0.3.0 + with: + github-token: ${{ secrets.VOTCA_BOT_TOKEN }} + script: | + github.pulls.create({ + owner: 'votca', + repo: 'xtp', + title: 'Fixes from stable', + head: 'stable_fixes', + base: 'master' + }) diff --git a/.github/workflows/create-release.yml b/.github/workflows/create-release.yml new file mode 100644 index 0000000..71f3bc9 --- /dev/null +++ b/.github/workflows/create-release.yml @@ -0,0 +1,28 @@ +name: Make Release +on: + push: + tags: + - 'v[1-9]*' + +jobs: + release: + name: Make Release + if: github.repository_owner == 'votca' + runs-on: ubuntu-latest + steps: + - name: Checkout code + uses: actions/checkout@v2 + - name: Create Changlog + uses: votca/actions/release_changelog@master + with: + version: ${{ github.ref }} + changelog: 'release_changelog.md' + - name: Create Release + uses: actions/create-release@v1 + env: + GITHUB_TOKEN: ${{ secrets.VOTCA_BOT_TOKEN }} + with: + tag_name: ${{ github.ref }} + release_name: ${{ github.ref }} + prerelease: ${{ contains(github.ref, 'rc') }} + body_path: 'release_changelog.md' diff --git a/.github/workflows/format.yml b/.github/workflows/format.yml new file mode 100644 index 0000000..7767b1a --- /dev/null +++ b/.github/workflows/format.yml @@ -0,0 +1,46 @@ +name: Format +on: + issue_comment: + types: [created] +jobs: + edit: + name: clang-format + if: ${{ github.event.comment.body == '@votca-bot format' }} + runs-on: ubuntu-latest + container: votca/buildenv:format + steps: + - name: Check if message comes from PR + uses: octokit/request-action@v2.x + id: issue_info + with: + route: GET /repos/:repository/issues/:pull_number + repository: ${{ github.repository }} + pull_number: ${{ github.event.issue.number }} + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + - name: Get PR info + if: ${{ fromJSON(steps.issue_info.outputs.data).pull_request }} + uses: octokit/request-action@v2.x + id: pr_info + with: + route: GET /repos/:repository/pulls/:pull_number + repository: ${{ github.repository }} + pull_number: ${{ github.event.issue.number }} + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + - name: Checkout head branch from PR + if: ${{ fromJSON(steps.issue_info.outputs.data).pull_request }} + uses: actions/checkout@master + with: + repository: ${{ fromJSON(steps.pr_info.outputs.data).head.repo.full_name }} + ref: ${{ fromJSON(steps.pr_info.outputs.data).head.ref }} + token: ${{ secrets.VOTCA_BOT_TOKEN }} + - name: Run clang-format + if: ${{ fromJSON(steps.issue_info.outputs.data).pull_request }} + run: find . -type f -regex ".*\.\(c\|h\|cc\|cpp\|hpp\)" -print0 | xargs -0 clang-format -i -style=file + - name: Commit and push + if: ${{ fromJSON(steps.issue_info.outputs.data).pull_request }} + run: | + git config --global user.name "Votca Bot" + git config --global user.email "github@votca.org" + git add -u + git commit -m "Format code using $(clang-format --version)" || true + git push diff --git a/.github/workflows/forward-to-votca.yml b/.github/workflows/forward-to-votca.yml new file mode 100644 index 0000000..7c992af --- /dev/null +++ b/.github/workflows/forward-to-votca.yml @@ -0,0 +1,18 @@ +name: Forward +on: + push: + branches: + - master + - stable + +jobs: + VOTCA: + if: github.repository_owner == 'votca' + runs-on: ubuntu-latest + steps: + - name: Update submodule + uses: votca/actions/forward@master + with: + module: ${{ github.repository }} + token: ${{ secrets.VOTCA_BOT_TOKEN }} + diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index f92cb50..ae2f582 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -1,5 +1,4 @@ stages: - - canary - build .build_script: @@ -35,13 +34,14 @@ - pushd build - cmake .. -DCMAKE_VERBOSE_MAKEFILE=ON -DENABLE_TESTING=ON -DBUILD_XTP=ON -DENABLE_WERROR=ON -DCMAKE_INSTALL_PREFIX=/usr -DCMAKE_BUILD_TYPE=${CMAKE_BUILD_TYPE} + ${CMAKE_GENERATOR:+-G${CMAKE_GENERATOR}} -DMODULE_BUILD=${MODULE_BUILD} ${MODULE_BUILD:+-DCMAKE_INSTALL_PREFIX=/home/votca/votca.install} - -DWITH_MKL=${WITH_MKL} -DCMAKE_DISABLE_FIND_PACKAGE_MKL=${DISABLE_MKL} + -DCMAKE_DISABLE_FIND_PACKAGE_MKL=${DISABLE_MKL} -DUSE_CUDA=${USE_CUDA} - - cmake --build . -- -j2 + - cmake --build . --parallel 2 - ctest --output-on-failure - - test -z "${MODULE_BUILD}" && DESTDIR=${PWD}/install cmake --build . --target install && rm -rf ${PWD}/install/usr && rmdir ${PWD}/install - - sudo cmake --build . --target install + - test -z "${MODULE_BUILD}" && DESTDIR=${PWD}/install cmake --install . && rm -rf ${PWD}/install/usr && rmdir ${PWD}/install + - sudo cmake --install . - if [[ ${CLANG_FORMAT} ]]; then cmake --build . --target format && git -C ${CI_PROJECT_DIR}/votca/${CI_PROJECT_NAME} diff --exit-code; fi - ccache -s @@ -51,135 +51,13 @@ image: votca/buildenv:${DISTRO} extends: .build_script -Debug GCC: - stage: canary - variables: - CC: "gcc" - CXX: "g++" - CMAKE_BUILD_TYPE: "Debug" - CLANG_FORMAT: "yes" - extends: .build - -None GCC: - variables: - CC: "gcc" - CXX: "g++" - CMAKE_BUILD_TYPE: "" - extends: .build - -None Clang: - variables: - CC: "clang" - CXX: "clang++" - CMAKE_BUILD_TYPE: "" - extends: .build - -Debug Clang: - variables: - CC: "clang" - CXX: "clang++" - CMAKE_BUILD_TYPE: "Debug" - extends: .build - -Release GCC: - variables: - CC: "gcc" - CXX: "g++" - CMAKE_BUILD_TYPE: "Release" - extends: .build - -Release Clang: - variables: - CC: "clang" - CXX: "clang++" - CMAKE_BUILD_TYPE: "Release" - extends: .build - -Debug GCC Ubuntu: - variables: - CC: "gcc" - CXX: "g++" - CMAKE_BUILD_TYPE: "Debug" - DISTRO: "ubuntu" - extends: .build - -Debug Clang Ubuntu: - variables: - CC: "clang" - CXX: "clang++" - CMAKE_BUILD_TYPE: "Debug" - DISTRO: "ubuntu" - extends: .build - -Release GCC Ubuntu: - variables: - CC: "gcc" - CXX: "g++" - CMAKE_BUILD_TYPE: "Release" - DISTRO: "ubuntu" - extends: .build - -Release Clang Ubuntu: - variables: - CC: "clang" - CXX: "clang++" - CMAKE_BUILD_TYPE: "Release" - DISTRO: "ubuntu" - extends: .build - -Debug GCC Rawhide: - variables: - CC: "gcc" - CXX: "g++" - CMAKE_BUILD_TYPE: "Debug" - DISTRO: "fedora_rawhide" - extends: .build - allow_failure: true - -Debug Clang Rawhide: - variables: - CC: "clang" - CXX: "clang++" - CMAKE_BUILD_TYPE: "Debug" - DISTRO: "fedora_rawhide" - extends: .build - allow_failure: true - -Release GCC Rawhide: - variables: - CC: "gcc" - CXX: "g++" - CMAKE_BUILD_TYPE: "Release" - DISTRO: "fedora_rawhide" - extends: .build - allow_failure: true - -Release Clang Rawhide: - variables: - CC: "clang" - CXX: "clang++" - CMAKE_BUILD_TYPE: "Release" - DISTRO: "fedora_rawhide" - extends: .build - allow_failure: true - -Release GCC Module: - variables: - CC: "gcc" - CXX: "g++" - CMAKE_BUILD_TYPE: "Release" - MODULE_BUILD: "yes" - extends: .build - Debug GPU Ubuntu: variables: CC: "gcc" CXX: "g++" CMAKE_BUILD_TYPE: "Debug" USE_CUDA: "yes" - WITH_MKL: "no" DISABLE_MKL: "yes" - NO_INSTALL: "yes" before_script: - source /opt/gromacs-2019/bin/GMXRC.bash extends: .build_script diff --git a/.travis.yml b/.travis.yml deleted file mode 100644 index 0d62c09..0000000 --- a/.travis.yml +++ /dev/null @@ -1,136 +0,0 @@ -# the original source of this file can be found in votca/votca repository -# add changes there! -# To update: -# wget -O .travis.yml https://raw.githubusercontent.com/votca/votca/master/.travis.yml -language: cpp - -sudo: required - -services: -- docker - -git: - quiet: true - -stages: - - canary - - test - - deploy - -jobs: - include: - - stage: canary - env: ENV=3 - - stage: deploy - if: repo = votca/votca AND type != pull_request - env: ENV=1 - -env: - matrix: - - ENV=1 - - ENV=2 - - ENV=3 - - ENV=4 - - ENV=5 - - ENV=6 - - ENV=7 - - ENV=8 - - ENV=9 - - ENV=10 - - ENV=11 - - ENV=12 - - ENV=13 - - ENV=14 - - ENV=15 - - ENV=16 - - ENV=17 - - ENV=18 - - ENV=19 - - ENV=20 - -before_script: - - git checkout -b current_commit - - cd ../../ - - if [[ ${TRAVIS_REPO_SLUG} = */votca ]]; then - if [[ ${TRAVIS_BRANCH} = next ]]; then - git -C ${TRAVIS_REPO_SLUG} submodule foreach git checkout master; - git -C ${TRAVIS_REPO_SLUG} submodule foreach git pull; - fi; - cp -vr ${TRAVIS_REPO_SLUG}/docker ${HOME}; - mv -v ${TRAVIS_REPO_SLUG} $HOME/docker; - else - git clone -q --recursive https://github.com/votca/votca.git $HOME/docker/votca; - if [[ ${TRAVIS_BRANCH} != master ]]; then - git -C ${HOME}/docker/votca checkout -b ${TRAVIS_BRANCH} ${TRAVIS_TAG:-origin/${TRAVIS_BRANCH}} && git -C ${HOME}/docker/votca submodule update --recursive --init; - fi; - git -C ${HOME}/docker/votca/${TRAVIS_REPO_SLUG#*/} fetch ${PWD}/${TRAVIS_REPO_SLUG} current_commit; - git -C ${HOME}/docker/votca/${TRAVIS_REPO_SLUG#*/} checkout -f FETCH_HEAD; - cp -vr ${HOME}/docker/votca/docker/* ${HOME}/docker; - if [[ -d ${TRAVIS_REPO_SLUG}/docker ]]; then cp -vr ${TRAVIS_REPO_SLUG}/docker/* ${HOME}/docker; fi; - fi - - source ${HOME}/docker/set_env.sh - - test -n "${SKIP}" || cp -r $HOME/.ccache ${HOME}/docker/ccache - - sed -i "1s/latest/${DISTRO:-latest}/" ${HOME}/docker/Dockerfile - - if [[ ! ${SKIP} ]]; then - travis_retry timeout 540 docker pull $(sed -n '1s/FROM //p' ${HOME}/docker/Dockerfile) | cat; - fi - -script: - - if [[ ! ${SKIP} ]]; then - travis_retry docker build "${docker_opts[@]}" - ${TRAVIS_TAG:+-t votca/votca:${TRAVIS_TAG}} - -t votca/votca:latest -t votca/votca:${TRAVIS_BRANCH} ${HOME}/docker/ && - rm -rf $HOME/.ccache && - CON=$(docker run -d votca/votca:${TRAVIS_BRANCH} /bin/bash) && - docker cp ${CON}:/home/votca/.ccache ${HOME}/; - fi - -after_success: - - if [[ ${TRAVIS_REPO_SLUG} != votca/votca || ${TRAVIS_BUILD_STAGE_NAME} != "Deploy" || ${SKIP} ]]; then travis_terminate 0; fi - - shopt -s extglob && [[ ${TRAVIS_BRANCH} = @(master|stable|v1.*) ]] && DEPLOY=yes - - if [[ ${TRAVIS_BRANCH} = master ]]; then DOCKER_TAG=latest; else DOCKER_TAG="${TRAVIS_BRANCH}"; fi - - if [[ ${DOCKER_USERNAME} && ${DOCKER_PASSWORD} && ${TRAVIS_PULL_REQUEST} == false && ${DEPLOY} ]]; then - docker login -u="$DOCKER_USERNAME" -p="$DOCKER_PASSWORD"; - docker push "${TRAVIS_REPO_SLUG}:${DOCKER_TAG}"; - fi - - if true; then - git clone --depth=1 https://github.com/votca/doxygen.git "$HOME/devdoc"; - cd $HOME/devdoc; - rm -f *; - git checkout -- CNAME; - docker cp ${CON}:/home/votca/votca/build/share/doc/html . ; - mv html/* .; rmdir html; - docker cp ${CON}:/home/votca/votca/build/csg-manual/manual.pdf . ; - docker cp ${CON}:/home/votca/votca/build/xtp/manual/xtp-manual.pdf . ; - git add --all .; - if [[ ${TRAVIS_BRANCH} = master && ${encrypted_7abbb71c3ba6_key} && ${encrypted_7abbb71c3ba6_iv} && ${TRAVIS_PULL_REQUEST} == false ]]; then - git config --global user.name "Automatic Deployment (Travis CI)"; - git config --global user.email "votca-commits@googlegroups.com"; - git commit -m "Documentation Update"; - openssl aes-256-cbc -K $encrypted_7abbb71c3ba6_key -iv $encrypted_7abbb71c3ba6_iv -in keys/deploy3.enc -out ~/.ssh/id_rsa -d; - chmod 600 ~/.ssh/id_rsa; - git push git@github.com:votca/doxygen.git gh-pages; - else - git status; - git diff --cached --no-color | head -c 1k; - fi; - fi - -branches: - only: - - master - - development - - stable - - next - - /^v\d+\.\d+(\.\d+|_rc\d+)?$/ - -cache: - - ccache - -compiler: - - gcc - - clang - -notifications: - email: - - votca-commits@googlegroups.com diff --git a/CHANGELOG.md b/CHANGELOG.md index 1ee34cb..dd03936 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,10 @@ For more detailed information about the changes see the history of the [repository](https://github.com/votca/xtp/commits/master). + +## Version 1.6.2 (released 22.08.20) +* move CI to GitHub Actions (#512, #514, #516, #519) +* add more checks to the dft_parse_part (#521) +* make unit tests work in parallel (#530) ## Version 1.6.1 (released 21.06.20) * fix warnings on Ubuntu 20.04 (#438, #460) diff --git a/CMakeLists.txt b/CMakeLists.txt index fbb3070..5d139ac 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -2,7 +2,7 @@ project(votca-xtp) -set(PROJECT_VERSION "1.6.1") +set(PROJECT_VERSION "1.6.2") set(PROJECT_CONTACT "bugs@votca.org") string(REGEX REPLACE "^[1-9]+\\.([1-9]+).*$" "\\1" SOVERSION "${PROJECT_VERSION}") if (NOT ${SOVERSION} MATCHES "[1-9]+") diff --git a/src/libxtp/jobcalculators/eqm.cc b/src/libxtp/jobcalculators/eqm.cc index 73236c9..f01cb0f 100644 --- a/src/libxtp/jobcalculators/eqm.cc +++ b/src/libxtp/jobcalculators/eqm.cc @@ -228,7 +228,7 @@ WriteLoggerToFile(work_dir + "/dft.log", dft_logger); } - if (!_do_dft_parse) { + if (!_do_dft_parse && (_do_gwbse || _do_esp)) { // load the DFT data from serialized orbitals object std::string ORB_FILE = eqm_work_dir + "/molecules/" + frame_dir + "/" + orb_file; diff --git a/src/tests/CMakeLists.txt b/src/tests/CMakeLists.txt index 9432a1a..a7e89f9 100644 --- a/src/tests/CMakeLists.txt +++ b/src/tests/CMakeLists.txt @@ -88,7 +88,8 @@ add_executable(unit_${PROG} ${PROG}.cc) target_link_libraries(unit_${PROG} votca_xtp Boost::unit_test_framework) target_compile_definitions(unit_${PROG} PRIVATE BOOST_TEST_DYN_LINK) - add_test(unit_${PROG} unit_${PROG}) + file(MAKE_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/Run_unit_${PROG}) + add_test(NAME unit_${PROG} COMMAND $ WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/Run_unit_${PROG}) # run tests for xtp (for coverage) as well set_tests_properties(unit_${PROG} PROPERTIES LABELS "xtp;votca;unit") endforeach(PROG) diff --git a/tutorials/.github/workflows/continuous-integration-workflow.yml b/tutorials/.github/workflows/continuous-integration-workflow.yml new file mode 100644 index 0000000..7bf526d --- /dev/null +++ b/tutorials/.github/workflows/continuous-integration-workflow.yml @@ -0,0 +1,72 @@ +name: CI +on: + pull_request: + branches: + - master + - stable + +jobs: + CI: + continue-on-error: ${{ matrix.distro == 'ubuntu_devel' || matrix.distro == 'fedora_rawhide' || matrix.continue-on-error == true }} + strategy: + matrix: + distro: [latest, fedora_rawhide, opensuse, ubuntu, ubuntu_devel, ubuntu_rolling, ubuntu_18.04] + toolchain: [gnu] + cmake_build_type: [Release] + minimal: [false] + own_gmx: [false] + module_build: [false] + coverage: [false] + no_regression_testing: [true] + include: + - distro: latest + toolchain: gnu + cmake_build_type: Release + module_build: true + no_regression_testing: true + runs-on: ubuntu-latest + container: votca/buildenv:${{ matrix.distro }} + steps: + - uses: actions/checkout@v2.2.0 + with: + fetch-depth: 0 + - name: Run Votca Setup + id: setup + uses: votca/actions/setup@master + with: + distro: ${{ matrix.distro }} + toolchain: ${{ matrix.toolchain }} + minimal: ${{ matrix.minimal == true }} + module: ${{ matrix.module_build == true }} + own_gmx: ${{ matrix.own_gmx == true }} + regression_testing: ${{ matrix.no_regression_testing != true }} + coverage: ${{ matrix.coverage }} + cmake_build_type: ${{ matrix.cmake_build_type }} + ctest_args: ${{ matrix.ctest_args }} + cmake_args: ${{ matrix.cmake_args }} + - uses: actions/cache@v2 + with: + path: ~/.ccache + key: ${{ steps.setup.outputs.cache_key }} + restore-keys: ${{ steps.setup.outputs.cache_restore_key }} + - name: CMake + run: mkdir builddir && cd builddir && cmake ${{ steps.setup.outputs.cmake_args }} ../votca + - name: Build + run: | + ccache -z + cmake --build builddir -- -j ${{ steps.setup.outputs.jobs }} + ccache -s + - name: Tests + run: ctest --output-on-failure ${{ steps.setup.outputs.ctest_args }} + working-directory: builddir + - name: Build Sphinx + if: ${{ steps.setup.outputs.build_sphinx == 'true' }} + run: cmake --build builddir --target doc + - name: Test DESTDIR Install + if: ${{ ! matrix.module_build }} + run: DESTDIR=${PWD}/install cmake --build builddir --target install && rm -rf ${PWD}/install/usr && rmdir ${PWD}/install + - name: Install + run: sudo cmake --build builddir --target install + - name: Check for untracked files + run: git status --porcelain && git status --porcelain | sed Q1 + working-directory: votca/${{ steps.setup.outputs.module }} diff --git a/tutorials/.github/workflows/create-pr.yml b/tutorials/.github/workflows/create-pr.yml new file mode 100644 index 0000000..eb54dec --- /dev/null +++ b/tutorials/.github/workflows/create-pr.yml @@ -0,0 +1,37 @@ +name: Create PR +on: + push: + branches: + - stable + +jobs: + PR: + name: Create + if: github.repository_owner == 'votca' + runs-on: ubuntu-latest + steps: + - name: Checkout code + uses: actions/checkout@master + with: + ref: ${{ github.event.ref }} + fetch-depth: 0 + token: ${{ secrets.VOTCA_BOT_TOKEN }} + - name: Try to merge master branch + run: | + git config --global user.name "Votca Bot" + git config --global user.email "github@votca.org" + git checkout -b stable_fixes + git merge origin/master || true + git push origin stable_fixes + - name: Create Pull Request + uses: actions/github-script@0.3.0 + with: + github-token: ${{ secrets.VOTCA_BOT_TOKEN }} + script: | + github.pulls.create({ + owner: 'votca', + repo: 'xtp-tutorials', + title: 'Fixes from stable', + head: 'stable_fixes', + base: 'master' + }) diff --git a/tutorials/.github/workflows/create-release.yml b/tutorials/.github/workflows/create-release.yml new file mode 100644 index 0000000..dfb35ef --- /dev/null +++ b/tutorials/.github/workflows/create-release.yml @@ -0,0 +1,20 @@ +name: Make Release +on: + push: + tags: + - 'v[1-9]*' + +jobs: + release: + name: Make Release + if: github.repository_owner == 'votca' + runs-on: ubuntu-latest + steps: + - name: Create Release + uses: actions/create-release@v1 + env: + GITHUB_TOKEN: ${{ secrets.VOTCA_BOT_TOKEN }} + with: + tag_name: ${{ github.ref }} + release_name: ${{ github.ref }} + prerelease: ${{ contains(github.ref, 'rc') }} diff --git a/tutorials/.github/workflows/forward-to-votca.yml b/tutorials/.github/workflows/forward-to-votca.yml new file mode 100644 index 0000000..7c992af --- /dev/null +++ b/tutorials/.github/workflows/forward-to-votca.yml @@ -0,0 +1,18 @@ +name: Forward +on: + push: + branches: + - master + - stable + +jobs: + VOTCA: + if: github.repository_owner == 'votca' + runs-on: ubuntu-latest + steps: + - name: Update submodule + uses: votca/actions/forward@master + with: + module: ${{ github.repository }} + token: ${{ secrets.VOTCA_BOT_TOKEN }} + diff --git a/tutorials/.gitlab-ci.yml b/tutorials/.gitlab-ci.yml index f92cb50..ae2f582 100644 --- a/tutorials/.gitlab-ci.yml +++ b/tutorials/.gitlab-ci.yml @@ -1,5 +1,4 @@ stages: - - canary - build .build_script: @@ -35,13 +34,14 @@ - pushd build - cmake .. -DCMAKE_VERBOSE_MAKEFILE=ON -DENABLE_TESTING=ON -DBUILD_XTP=ON -DENABLE_WERROR=ON -DCMAKE_INSTALL_PREFIX=/usr -DCMAKE_BUILD_TYPE=${CMAKE_BUILD_TYPE} + ${CMAKE_GENERATOR:+-G${CMAKE_GENERATOR}} -DMODULE_BUILD=${MODULE_BUILD} ${MODULE_BUILD:+-DCMAKE_INSTALL_PREFIX=/home/votca/votca.install} - -DWITH_MKL=${WITH_MKL} -DCMAKE_DISABLE_FIND_PACKAGE_MKL=${DISABLE_MKL} + -DCMAKE_DISABLE_FIND_PACKAGE_MKL=${DISABLE_MKL} -DUSE_CUDA=${USE_CUDA} - - cmake --build . -- -j2 + - cmake --build . --parallel 2 - ctest --output-on-failure - - test -z "${MODULE_BUILD}" && DESTDIR=${PWD}/install cmake --build . --target install && rm -rf ${PWD}/install/usr && rmdir ${PWD}/install - - sudo cmake --build . --target install + - test -z "${MODULE_BUILD}" && DESTDIR=${PWD}/install cmake --install . && rm -rf ${PWD}/install/usr && rmdir ${PWD}/install + - sudo cmake --install . - if [[ ${CLANG_FORMAT} ]]; then cmake --build . --target format && git -C ${CI_PROJECT_DIR}/votca/${CI_PROJECT_NAME} diff --exit-code; fi - ccache -s @@ -51,135 +51,13 @@ image: votca/buildenv:${DISTRO} extends: .build_script -Debug GCC: - stage: canary - variables: - CC: "gcc" - CXX: "g++" - CMAKE_BUILD_TYPE: "Debug" - CLANG_FORMAT: "yes" - extends: .build - -None GCC: - variables: - CC: "gcc" - CXX: "g++" - CMAKE_BUILD_TYPE: "" - extends: .build - -None Clang: - variables: - CC: "clang" - CXX: "clang++" - CMAKE_BUILD_TYPE: "" - extends: .build - -Debug Clang: - variables: - CC: "clang" - CXX: "clang++" - CMAKE_BUILD_TYPE: "Debug" - extends: .build - -Release GCC: - variables: - CC: "gcc" - CXX: "g++" - CMAKE_BUILD_TYPE: "Release" - extends: .build - -Release Clang: - variables: - CC: "clang" - CXX: "clang++" - CMAKE_BUILD_TYPE: "Release" - extends: .build - -Debug GCC Ubuntu: - variables: - CC: "gcc" - CXX: "g++" - CMAKE_BUILD_TYPE: "Debug" - DISTRO: "ubuntu" - extends: .build - -Debug Clang Ubuntu: - variables: - CC: "clang" - CXX: "clang++" - CMAKE_BUILD_TYPE: "Debug" - DISTRO: "ubuntu" - extends: .build - -Release GCC Ubuntu: - variables: - CC: "gcc" - CXX: "g++" - CMAKE_BUILD_TYPE: "Release" - DISTRO: "ubuntu" - extends: .build - -Release Clang Ubuntu: - variables: - CC: "clang" - CXX: "clang++" - CMAKE_BUILD_TYPE: "Release" - DISTRO: "ubuntu" - extends: .build - -Debug GCC Rawhide: - variables: - CC: "gcc" - CXX: "g++" - CMAKE_BUILD_TYPE: "Debug" - DISTRO: "fedora_rawhide" - extends: .build - allow_failure: true - -Debug Clang Rawhide: - variables: - CC: "clang" - CXX: "clang++" - CMAKE_BUILD_TYPE: "Debug" - DISTRO: "fedora_rawhide" - extends: .build - allow_failure: true - -Release GCC Rawhide: - variables: - CC: "gcc" - CXX: "g++" - CMAKE_BUILD_TYPE: "Release" - DISTRO: "fedora_rawhide" - extends: .build - allow_failure: true - -Release Clang Rawhide: - variables: - CC: "clang" - CXX: "clang++" - CMAKE_BUILD_TYPE: "Release" - DISTRO: "fedora_rawhide" - extends: .build - allow_failure: true - -Release GCC Module: - variables: - CC: "gcc" - CXX: "g++" - CMAKE_BUILD_TYPE: "Release" - MODULE_BUILD: "yes" - extends: .build - Debug GPU Ubuntu: variables: CC: "gcc" CXX: "g++" CMAKE_BUILD_TYPE: "Debug" USE_CUDA: "yes" - WITH_MKL: "no" DISABLE_MKL: "yes" - NO_INSTALL: "yes" before_script: - source /opt/gromacs-2019/bin/GMXRC.bash extends: .build_script diff --git a/tutorials/.travis.yml b/tutorials/.travis.yml deleted file mode 100644 index 0d62c09..0000000 --- a/tutorials/.travis.yml +++ /dev/null @@ -1,136 +0,0 @@ -# the original source of this file can be found in votca/votca repository -# add changes there! -# To update: -# wget -O .travis.yml https://raw.githubusercontent.com/votca/votca/master/.travis.yml -language: cpp - -sudo: required - -services: -- docker - -git: - quiet: true - -stages: - - canary - - test - - deploy - -jobs: - include: - - stage: canary - env: ENV=3 - - stage: deploy - if: repo = votca/votca AND type != pull_request - env: ENV=1 - -env: - matrix: - - ENV=1 - - ENV=2 - - ENV=3 - - ENV=4 - - ENV=5 - - ENV=6 - - ENV=7 - - ENV=8 - - ENV=9 - - ENV=10 - - ENV=11 - - ENV=12 - - ENV=13 - - ENV=14 - - ENV=15 - - ENV=16 - - ENV=17 - - ENV=18 - - ENV=19 - - ENV=20 - -before_script: - - git checkout -b current_commit - - cd ../../ - - if [[ ${TRAVIS_REPO_SLUG} = */votca ]]; then - if [[ ${TRAVIS_BRANCH} = next ]]; then - git -C ${TRAVIS_REPO_SLUG} submodule foreach git checkout master; - git -C ${TRAVIS_REPO_SLUG} submodule foreach git pull; - fi; - cp -vr ${TRAVIS_REPO_SLUG}/docker ${HOME}; - mv -v ${TRAVIS_REPO_SLUG} $HOME/docker; - else - git clone -q --recursive https://github.com/votca/votca.git $HOME/docker/votca; - if [[ ${TRAVIS_BRANCH} != master ]]; then - git -C ${HOME}/docker/votca checkout -b ${TRAVIS_BRANCH} ${TRAVIS_TAG:-origin/${TRAVIS_BRANCH}} && git -C ${HOME}/docker/votca submodule update --recursive --init; - fi; - git -C ${HOME}/docker/votca/${TRAVIS_REPO_SLUG#*/} fetch ${PWD}/${TRAVIS_REPO_SLUG} current_commit; - git -C ${HOME}/docker/votca/${TRAVIS_REPO_SLUG#*/} checkout -f FETCH_HEAD; - cp -vr ${HOME}/docker/votca/docker/* ${HOME}/docker; - if [[ -d ${TRAVIS_REPO_SLUG}/docker ]]; then cp -vr ${TRAVIS_REPO_SLUG}/docker/* ${HOME}/docker; fi; - fi - - source ${HOME}/docker/set_env.sh - - test -n "${SKIP}" || cp -r $HOME/.ccache ${HOME}/docker/ccache - - sed -i "1s/latest/${DISTRO:-latest}/" ${HOME}/docker/Dockerfile - - if [[ ! ${SKIP} ]]; then - travis_retry timeout 540 docker pull $(sed -n '1s/FROM //p' ${HOME}/docker/Dockerfile) | cat; - fi - -script: - - if [[ ! ${SKIP} ]]; then - travis_retry docker build "${docker_opts[@]}" - ${TRAVIS_TAG:+-t votca/votca:${TRAVIS_TAG}} - -t votca/votca:latest -t votca/votca:${TRAVIS_BRANCH} ${HOME}/docker/ && - rm -rf $HOME/.ccache && - CON=$(docker run -d votca/votca:${TRAVIS_BRANCH} /bin/bash) && - docker cp ${CON}:/home/votca/.ccache ${HOME}/; - fi - -after_success: - - if [[ ${TRAVIS_REPO_SLUG} != votca/votca || ${TRAVIS_BUILD_STAGE_NAME} != "Deploy" || ${SKIP} ]]; then travis_terminate 0; fi - - shopt -s extglob && [[ ${TRAVIS_BRANCH} = @(master|stable|v1.*) ]] && DEPLOY=yes - - if [[ ${TRAVIS_BRANCH} = master ]]; then DOCKER_TAG=latest; else DOCKER_TAG="${TRAVIS_BRANCH}"; fi - - if [[ ${DOCKER_USERNAME} && ${DOCKER_PASSWORD} && ${TRAVIS_PULL_REQUEST} == false && ${DEPLOY} ]]; then - docker login -u="$DOCKER_USERNAME" -p="$DOCKER_PASSWORD"; - docker push "${TRAVIS_REPO_SLUG}:${DOCKER_TAG}"; - fi - - if true; then - git clone --depth=1 https://github.com/votca/doxygen.git "$HOME/devdoc"; - cd $HOME/devdoc; - rm -f *; - git checkout -- CNAME; - docker cp ${CON}:/home/votca/votca/build/share/doc/html . ; - mv html/* .; rmdir html; - docker cp ${CON}:/home/votca/votca/build/csg-manual/manual.pdf . ; - docker cp ${CON}:/home/votca/votca/build/xtp/manual/xtp-manual.pdf . ; - git add --all .; - if [[ ${TRAVIS_BRANCH} = master && ${encrypted_7abbb71c3ba6_key} && ${encrypted_7abbb71c3ba6_iv} && ${TRAVIS_PULL_REQUEST} == false ]]; then - git config --global user.name "Automatic Deployment (Travis CI)"; - git config --global user.email "votca-commits@googlegroups.com"; - git commit -m "Documentation Update"; - openssl aes-256-cbc -K $encrypted_7abbb71c3ba6_key -iv $encrypted_7abbb71c3ba6_iv -in keys/deploy3.enc -out ~/.ssh/id_rsa -d; - chmod 600 ~/.ssh/id_rsa; - git push git@github.com:votca/doxygen.git gh-pages; - else - git status; - git diff --cached --no-color | head -c 1k; - fi; - fi - -branches: - only: - - master - - development - - stable - - next - - /^v\d+\.\d+(\.\d+|_rc\d+)?$/ - -cache: - - ccache - -compiler: - - gcc - - clang - -notifications: - email: - - votca-commits@googlegroups.com diff --git a/tutorials/CMakeLists.txt b/tutorials/CMakeLists.txt index 89bb875..b0631b6 100644 --- a/tutorials/CMakeLists.txt +++ b/tutorials/CMakeLists.txt @@ -2,7 +2,7 @@ project(xtp-tutorials) -set(PROJECT_VERSION "1.6.1") +set(PROJECT_VERSION "1.6.2") set(CMAKE_MODULE_PATH ${CMAKE_CURRENT_SOURCE_DIR}/CMakeModules) include(GNUInstallDirs)