Use branch point also for format and copyright check
authorPaul Bauer <paul.bauer.q@gmail.com>
Thu, 23 Apr 2020 20:24:50 +0000 (20:24 +0000)
committerMark Abraham <mark.j.abraham@gmail.com>
Thu, 23 Apr 2020 20:24:50 +0000 (20:24 +0000)
Change-Id: I16a9df11223426a40e6e138ee9f3793e700ae06e

admin/gitlab-ci/lint.gitlab-ci.yml

index d9ca4945cbfb2616f489b07ed2d99818a11b604c..e158ddb5f43b339eca9072963b59aa853d57e888 100644 (file)
@@ -56,7 +56,6 @@ clang-tidy:test:
     KUBERNETES_MEMORY_LIMIT: 4Gi
   script:
     # TODO (issue #3272) `master` is not appropriate for use on release-xxxx branches, how should we handle that?
-    # See discussion at https://gitlab.com/gromacs/gromacs/-/merge_requests/67
     - REV=$(git fetch -q https://gitlab.com/gromacs/gromacs.git master && git show -s --pretty=format:"%h" `git merge-base --fork-point FETCH_HEAD HEAD`)
     - RUN_CLANG_TIDY=run-clang-tidy-$COMPILER_MAJOR_VERSION bash admin/clang-tidy.sh check --parallel=$KUBERNETES_CPU_LIMIT --warnings=clang-tidy.log --rev=$REV -B=$BUILD_DIR
     - grep -iq "found code issues" clang-tidy.log | tee code-lint.txt || true
@@ -82,8 +81,9 @@ clang-format:
     KUBERNETES_MEMORY_LIMIT: 2Gi
     EXTRA_INSTALLS: clang-format-$COMPILER_MAJOR_VERSION
   script:
-    - export CLANG_FORMAT=clang-format-$COMPILER_MAJOR_VERSION
-    - admin/clang-format.sh check --rev=HEAD^ --warnings=clang-format.log
+    # 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`)
+    - CLANG_FORMAT=clang-format-$COMPILER_MAJOR_VERSION admin/clang-format.sh check --rev=$REV --warnings=clang-format.log
     - grep -iq "needs formatting" clang-format.log | tee formatting.txt || true
     - if [ -s formatting.txt ] ; then echo "clang-format.sh found issues"; exit 1; fi
   artifacts:
@@ -105,7 +105,9 @@ copyright-check:
     KUBERNETES_CPU_REQUEST: 1
     KUBERNETES_MEMORY_LIMIT: 2Gi
   script:
-    - admin/copyright.sh check --rev=HEAD^ --warnings=copyright.log
+    # 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`)
+    - admin/copyright.sh check --rev=$REV --warnings=copyright.log
     - grep -iq "copyright year" copyright.log | tee years.log || true
     - grep -iq "copyright header" copyright.log | tee headers.log || true
     - if [[ -s years.log || -s headers.log ]] ; then