1 # Repository cleanliness. Source tidiness, linting, and policy compliance.
3 clang-tidy:configure-push:
5 - .gromacs:base:configure
8 image: ${CI_REGISTRY}/gromacs/gromacs/ci-ubuntu-18.04-llvm-9
10 CMAKE: /usr/local/cmake-3.16.3/bin/cmake
11 COMPILER_MAJOR_VERSION: 9
12 BUILD_DIR: build-clang-tidy
13 CMAKE_EXTRA_OPTIONS: -DCLANG_TIDY=clang-tidy-$COMPILER_MAJOR_VERSION -DGMX_CLANG_TIDY=ON -DGMX_COMPILER_WARNINGS=ON -DCMAKE_EXPORT_COMPILE_COMMANDS=ON
15 clang-tidy:configure-schedule:
17 - .gromacs:base:configure
19 - .rules:nightly-not-for-release
20 image: ${CI_REGISTRY}/gromacs/gromacs/ci-ubuntu-18.04-llvm-9
22 CMAKE: /usr/local/cmake-3.16.3/bin/cmake
23 COMPILER_MAJOR_VERSION: 9
24 BUILD_DIR: build-clang-tidy
25 CMAKE_EXTRA_OPTIONS: -DCLANG_TIDY=clang-tidy-$COMPILER_MAJOR_VERSION -DGMX_CLANG_TIDY=ON -DGMX_COMPILER_WARNINGS=ON
32 - .rules:nightly-not-for-release
34 image: ${CI_REGISTRY}/gromacs/gromacs/ci-ubuntu-18.04-llvm-9
36 - job: clang-tidy:configure-schedule
38 CMAKE: /usr/local/cmake-3.16.3/bin/cmake
39 BUILD_DIR: build-clang-tidy
47 image: ${CI_REGISTRY}/gromacs/gromacs/ci-ubuntu-18.04-llvm-9
49 - job: clang-tidy:configure-push
51 CMAKE: /usr/local/cmake-3.16.3/bin/cmake
52 COMPILER_MAJOR_VERSION: 9
53 BUILD_DIR: build-clang-tidy
54 EXTRA_INSTALLS: clang-tidy-$COMPILER_MAJOR_VERSION
55 KUBERNETES_CPU_LIMIT: 4
56 KUBERNETES_CPU_REQUEST: 2
57 KUBERNETES_MEMORY_REQUEST: 4Gi
59 # Make sure that a Python interpreter can be found for `/bin/env python`
60 - test -x /usr/bin/python || update-alternatives --install /usr/bin/python python /usr/bin/python3 1
61 # TODO (issue #3272) `master` is not appropriate for use on release-xxxx branches, how should we handle that?
62 - REV=$(git fetch -q https://gitlab.com/gromacs/gromacs.git master && git show -s --pretty=format:"%h" `git merge-base FETCH_HEAD HEAD`)
63 - HEAD_REV=$(git show -s --pretty=format:"%h" HEAD)
64 - if [[ "$REV" == "$HEAD_REV" ]] ; then
67 - echo "Revision used for branch point is $REV"
69 - 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
70 - grep -i "found code issues" clang-tidy.log | tee code-lint.txt || true
71 - if [ -s code-lint.txt ] ; then echo "clang-tidy.sh found issues"; exit 1; fi
84 image: ${CI_REGISTRY}/gromacs/gromacs/ci-ubuntu-18.04-llvm-7-docs
86 COMPILER_MAJOR_VERSION: 7
87 KUBERNETES_CPU_LIMIT: 1
88 KUBERNETES_CPU_REQUEST: 1
89 KUBERNETES_MEMORY_REQUEST: 2Gi
90 EXTRA_INSTALLS: clang-format-$COMPILER_MAJOR_VERSION
92 # TODO (issue #3272) `master` is not appropriate for use on release-xxxx branches, how should we handle that?
93 - REV=$(git fetch -q https://gitlab.com/gromacs/gromacs.git master && git show -s --pretty=format:"%h" `git merge-base FETCH_HEAD HEAD`)
94 - HEAD_REV=$(git show -s --pretty=format:"%h" HEAD)
95 - if [[ "$REV" == "$HEAD_REV" ]] ; then
98 - echo "Revision used for branch point is $REV"
100 - CLANG_FORMAT=clang-format-$COMPILER_MAJOR_VERSION admin/clang-format.sh check --rev=$REV --warnings=clang-format.log
101 - grep -i "needs formatting" clang-format.log | tee formatting.txt || true
102 - if [ -s formatting.txt ] ; then echo "clang-format.sh found issues"; exit 1; fi
115 image: ${CI_REGISTRY}/gromacs/gromacs/ci-ubuntu-18.04-llvm-7-docs
117 KUBERNETES_CPU_LIMIT: 1
118 KUBERNETES_CPU_REQUEST: 1
119 KUBERNETES_MEMORY_REQUEST: 2Gi
121 # TODO (issue #3272) `master` is not appropriate for use on release-xxxx branches, how should we handle that?
122 - REV=$(git fetch -q https://gitlab.com/gromacs/gromacs.git master && git show -s --pretty=format:"%h" `git merge-base FETCH_HEAD HEAD`)
123 - HEAD_REV=$(git show -s --pretty=format:"%h" HEAD)
124 - if [[ "$REV" == "$HEAD_REV" ]] ; then
127 - echo "Revision used for branch point is $REV"
129 - admin/copyright.sh check --rev=$REV --warnings=copyright.log
130 - grep -i "copyright year" copyright.log | tee years.log || true
131 - grep -i "copyright header" copyright.log | tee headers.log || true
132 - if [[ -s years.log || -s headers.log ]] ; then
133 echo "Copyright information needs updating" ;
147 - .before_script:default
155 KUBERNETES_CPU_LIMIT: 1
156 KUBERNETES_CPU_REQUEST: 1
157 KUBERNETES_MEMORY_REQUEST: 2Gi
158 BUILD_DIR: build-docs
160 - CMAKE=${CMAKE:-$(which cmake)}
162 - $CMAKE --build . --target check-source
163 - awk '/warning.*include style.*order/,/You can use.*rst|^$/' docs/doxygen/check-source.log | tee doxygenError.txt || true
164 - awk '/warning:.*includes/,/unnecessarily|^$/' docs/doxygen/check-source.log | tee -a doxygenError.txt || true
165 - awk '/Traceback/,/.*rror|^$/' docs/doxygen/doxygen*log docs/doxygen/check-source.log | tee -a doxygenError.txt || true
166 - awk '/warning:/,/in doxygen.*|^$/' docs/doxygen/doxygen*log | tee -a doxygenError.txt || true
167 - grep -i "unused cycle suppression" docs/doxygen/check-source.log | tee -a doxygenError.txt || true
168 - if [ -s doxygenError.txt ] ; then echo "Found errors while running doxygen"; exit 1; fi
170 name: docs-artifacts-$CI_COMMIT_REF_SLUG
174 - $BUILD_DIR/docs/doxygen/doxygen-xml.log
175 - $BUILD_DIR/docs/doxygen/check-source.log
180 - .rules:nightly-not-for-release
185 KUBERNETES_CPU_LIMIT: 1
186 KUBERNETES_CPU_REQUEST: 1
187 KUBERNETES_MEMORY_REQUEST: 2Gi
188 BUILD_DIR: build-docs
191 - linkchecker docs/html/index.html -f $CI_PROJECT_DIR/docs/linkcheckerrc -Fxml --ignore-url html-full
192 --ignore-url html-user --ignore-url html-lib --ignore-url .tar.gz --ignore-url _sources
196 junit: $BUILD_DIR/linkchecker-out.xml