From 8f803f284947eeaaa3531dc87e7d4406e3be7be4 Mon Sep 17 00:00:00 2001 From: Paul Bauer Date: Tue, 20 Oct 2020 14:09:51 +0000 Subject: [PATCH] Update CI rules for release-2021 Changes rules to target release-2021 branch instead of master. Update regressiontest download branch. --- admin/gitlab-ci/archive.gitlab-ci.yml | 6 +++--- admin/gitlab-ci/global.gitlab-ci.yml | 2 +- admin/gitlab-ci/lint.gitlab-ci.yml | 5 ++--- admin/gitlab-ci/rules.gitlab-ci.yml | 26 ++++++++++++++++++++++++-- cmake/gmxVersionInfo.cmake | 2 +- 5 files changed, 31 insertions(+), 10 deletions(-) diff --git a/admin/gitlab-ci/archive.gitlab-ci.yml b/admin/gitlab-ci/archive.gitlab-ci.yml index 15877d35ae..a3b1acd48b 100644 --- a/admin/gitlab-ci/archive.gitlab-ci.yml +++ b/admin/gitlab-ci/archive.gitlab-ci.yml @@ -33,9 +33,9 @@ regressiontests:prepare: KUBERNETES_CPU_LIMIT: 1 KUBERNETES_CPU_REQUEST: 1 KUBERNETES_MEMORY_REQUEST: 2Gi - # Always clone the default version for this branch, master in this case + # Always clone the default version for this branch, 2021 in this case script: - - export REGTESTBRANCH=master + - export REGTESTBRANCH=release-2021 - if [[ ! -z $REGRESSIONTESTBRANCH ]] ; then export REGTESTBRANCH=$REGRESSIONTESTBRANCH ; echo "Using $REGTESTBRANCH instead of default" ; @@ -86,7 +86,7 @@ regressiontests:package: - if [[ $GROMACS_RELEASE != "true" ]] ; then REGTESTNAME=$REGTESTNAME-dev ; fi - - export REGTESTBRANCH=master + - export REGTESTBRANCH=release-2021 - if [[ $CI_COMMIT_REF_NAME == "master" || $CI_COMMIT_REF_NAME == "release-20"[1-2][0-9] ]] ; then export REGTESTBRANCH=$CI_COMMIT_REF_NAME ; fi diff --git a/admin/gitlab-ci/global.gitlab-ci.yml b/admin/gitlab-ci/global.gitlab-ci.yml index 2463fa96b4..d7eb86ac12 100644 --- a/admin/gitlab-ci/global.gitlab-ci.yml +++ b/admin/gitlab-ci/global.gitlab-ci.yml @@ -15,7 +15,7 @@ KUBERNETES_MEMORY_LIMIT: 8Gi KUBERNETES_EXTENDED_RESOURCE_NAME: "" KUBERNETES_EXTENDED_RESOURCE_LIMIT: 0 - CACHE_FALLBACK_KEY: "$CI_JOB_NAME-$CI_JOB_STAGE-master" + CACHE_FALLBACK_KEY: "$CI_JOB_NAME-$CI_JOB_STAGE-release-2021" BUILD_DIR: build INSTALL_DIR: install CMAKE_GMXAPI_OPTIONS: "" diff --git a/admin/gitlab-ci/lint.gitlab-ci.yml b/admin/gitlab-ci/lint.gitlab-ci.yml index c750d2ca73..95c0719d0e 100644 --- a/admin/gitlab-ci/lint.gitlab-ci.yml +++ b/admin/gitlab-ci/lint.gitlab-ci.yml @@ -55,7 +55,7 @@ clang-tidy:test: # Make sure that a Python interpreter can be found for `/bin/env python` - test -x /usr/bin/python || update-alternatives --install /usr/bin/python python /usr/bin/python3 1 # TODO (issue #3272) `master` is not appropriate for use on release-xxxx branches, how should we handle that? - - REV=$(git fetch -q https://gitlab.com/gromacs/gromacs.git master && git show -s --pretty=format:"%h" `git merge-base FETCH_HEAD HEAD`) + - REV=$(git fetch -q https://gitlab.com/gromacs/gromacs.git release-2021 && git show -s --pretty=format:"%h" `git merge-base FETCH_HEAD HEAD`) - HEAD_REV=$(git show -s --pretty=format:"%h" HEAD) - if [[ "$REV" == "$HEAD_REV" ]] ; then REV="HEAD~1" ; @@ -85,8 +85,7 @@ clang-format: KUBERNETES_MEMORY_REQUEST: 2Gi EXTRA_INSTALLS: clang-format-$COMPILER_MAJOR_VERSION script: - # TODO (issue #3272) `master` is not appropriate for use on release-xxxx branches, how should we handle that? - - REV=$(git fetch -q https://gitlab.com/gromacs/gromacs.git master && git show -s --pretty=format:"%h" `git merge-base FETCH_HEAD HEAD`) + - REV=$(git fetch -q https://gitlab.com/gromacs/gromacs.git release-2021 && git show -s --pretty=format:"%h" `git merge-base FETCH_HEAD HEAD`) - HEAD_REV=$(git show -s --pretty=format:"%h" HEAD) - if [[ "$REV" == "$HEAD_REV" ]] ; then REV="HEAD~1" ; diff --git a/admin/gitlab-ci/rules.gitlab-ci.yml b/admin/gitlab-ci/rules.gitlab-ci.yml index 7bf1648b47..c534511006 100644 --- a/admin/gitlab-ci/rules.gitlab-ci.yml +++ b/admin/gitlab-ci/rules.gitlab-ci.yml @@ -73,13 +73,13 @@ .rules-element:if-post-merge-acceptance-or-mr-then-always: &if-post-merge-acceptance-or-mr-then-always if: '$CI_PIPELINE_SOURCE == "merge_request_event" || ($CI_PIPELINE_SOURCE == "push" && - $CI_COMMIT_REF_NAME == "master")' + $CI_COMMIT_REF_NAME == "release-2021")' when: always # Include job only for post submit push .rules-element:if-post-merge-acceptance-then-always: &if-post-merge-acceptance-then-always if: '$CI_PIPELINE_SOURCE == "push" && - $CI_COMMIT_REF_NAME == "master"' + $CI_COMMIT_REF_NAME == "release-2021"' when: always # When composing a rule set, note that the first matching rule is applied. @@ -177,6 +177,28 @@ - *if-schedule-then-always - *if-mr-then-always +# Jobs that run for merge requests and schedules for branch `release-2021`, +# but not when GROMACS_RELEASE is set. +# Excludes non-gromacs projects. +.rules:merge-requests:release-2021: + rules: + - *if-not-gromacs-then-never + - *if-release-then-never + - *if-post-merge-acceptance-then-never + # This next rule catches "push" and other events in branches other than `release-2021` + # but allows merge_request_events for merge requests targeting `release-2021`. + # This rule is before "web" so the web interface won't include jobs that can't succeed + # (and would not ordinarily be run). Such jobs are hard to identify in a way that is + # sufficiently general for a global rules definition. + # If extra coverage is needed through a web-triggered job in merge request branches, + # we could provide an additional short-circuiting rule based on an environment variable + # to be provided through the web interface. + - if: '$CI_MERGE_REQUEST_TARGET_BRANCH_NAME != "release-2021" && $CI_COMMIT_REF_NAME != "release-2021"' + when: never + - *if-web-then-always + - *if-schedule-then-always + - *if-mr-then-always + # Rule to run a job only in nightly release-preparation pipelines. # Checks if the GROMACS_RELEASE variable was set (typically through the GitLab web interface). # Excludes merge_requests and non-gromacs projects. diff --git a/cmake/gmxVersionInfo.cmake b/cmake/gmxVersionInfo.cmake index 005ede6bc0..3fa0b1ce31 100644 --- a/cmake/gmxVersionInfo.cmake +++ b/cmake/gmxVersionInfo.cmake @@ -256,7 +256,7 @@ if (NOT SOURCE_IS_SOURCE_DISTRIBUTION AND endif() set(REGRESSIONTEST_VERSION "${GMX_VERSION_STRING}") -set(REGRESSIONTEST_BRANCH "master") # TODO branch to 2021 +set(REGRESSIONTEST_BRANCH "release-2021") # Run the regressiontests packaging job with the correct pakage # version string, and the release box checked, in order to have it # build the regressiontests tarball with all the right naming. The -- 2.22.0