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-11-tsan
10 CMAKE: /usr/local/cmake-3.16.3/bin/cmake
11 COMPILER_MAJOR_VERSION: 11
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-push-cuda:
17 - .gromacs:base:configure
21 image: ${CI_REGISTRY}/gromacs/gromacs/ci-ubuntu-20.04-llvm-11-cuda-11.2.1-hipsycl-2bc21b677a
23 CMAKE: /usr/local/cmake-3.16.3/bin/cmake
24 COMPILER_MAJOR_VERSION: 11
25 BUILD_DIR: build-clang-tidy
26 CMAKE_EXTRA_OPTIONS: -DCLANG_TIDY=clang-tidy-$COMPILER_MAJOR_VERSION -DGMX_CLANG_TIDY=ON -DGMX_COMPILER_WARNINGS=ON -DCMAKE_EXPORT_COMPILE_COMMANDS=ON -DGMX_CLANG_CUDA=ON
28 clang-tidy:configure-schedule:
30 - .gromacs:base:configure
32 - .rules:nightly-not-for-release
33 image: ${CI_REGISTRY}/gromacs/gromacs/ci-ubuntu-18.04-llvm-11-tsan
35 CMAKE: /usr/local/cmake-3.16.3/bin/cmake
36 COMPILER_MAJOR_VERSION: 11
37 BUILD_DIR: build-clang-tidy
38 CMAKE_EXTRA_OPTIONS: -DCLANG_TIDY=clang-tidy-$COMPILER_MAJOR_VERSION -DGMX_CLANG_TIDY=ON -DGMX_COMPILER_WARNINGS=ON
40 clang-tidy:configure-schedule-cuda:
42 - .gromacs:base:configure
45 - .rules:nightly-not-for-release
46 image: ${CI_REGISTRY}/gromacs/gromacs/ci-ubuntu-20.04-llvm-11-cuda-11.2.1-hipsycl-2bc21b677a
49 COMPILER_MAJOR_VERSION: 11
50 BUILD_DIR: build-clang-tidy
51 CMAKE_EXTRA_OPTIONS: -DCLANG_TIDY=clang-tidy-$COMPILER_MAJOR_VERSION -DGMX_CLANG_TIDY=ON -DGMX_COMPILER_WARNINGS=ON -DGMX_CLANG_CUDA=ON
58 - .rules:nightly-not-for-release
60 image: ${CI_REGISTRY}/gromacs/gromacs/ci-ubuntu-18.04-llvm-11-tsan
62 - job: clang-tidy:configure-schedule
64 CMAKE: /usr/local/cmake-3.16.3/bin/cmake
65 BUILD_DIR: build-clang-tidy
67 clang-tidy:build-cuda:
72 - .rules:nightly-not-for-release
74 image: ${CI_REGISTRY}/gromacs/gromacs/ci-ubuntu-20.04-llvm-11-cuda-11.2.1-hipsycl-2bc21b677a
76 - job: clang-tidy:configure-schedule-cuda
79 BUILD_DIR: build-clang-tidy
87 image: ${CI_REGISTRY}/gromacs/gromacs/ci-ubuntu-18.04-llvm-11-tsan
89 - job: clang-tidy:configure-push
91 CMAKE: /usr/local/cmake-3.16.3/bin/cmake
92 COMPILER_MAJOR_VERSION: 11
93 BUILD_DIR: build-clang-tidy
94 EXTRA_INSTALLS: clang-tidy-$COMPILER_MAJOR_VERSION
95 KUBERNETES_CPU_LIMIT: 4
96 KUBERNETES_CPU_REQUEST: 2
97 KUBERNETES_MEMORY_REQUEST: 4Gi
99 # Make sure that a Python interpreter can be found for `/bin/env python`
100 - test -x /usr/bin/python || update-alternatives --install /usr/bin/python python /usr/bin/python3 1
101 # TODO (issue #3272) `master` is not appropriate for use on release-xxxx branches, how should we handle that?
102 - REV=$(git fetch -q https://gitlab.com/gromacs/gromacs.git master && git show -s --pretty=format:"%h" `git merge-base FETCH_HEAD HEAD`)
103 - HEAD_REV=$(git show -s --pretty=format:"%h" HEAD)
104 - if [[ "$REV" == "$HEAD_REV" ]] ; then
107 - echo "Revision used for branch point is $REV"
109 - 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
110 - grep -i "found code issues|warnings" clang-tidy.log | tee code-lint.txt || true
111 - if [ -s code-lint.txt ] ; then echo "clang-tidy.sh found issues"; exit 1; fi
118 clang-tidy:test-cuda:
120 - .gromacs:base:build
124 image: ${CI_REGISTRY}/gromacs/gromacs/ci-ubuntu-18.04-llvm-8-cuda-10.0
126 - job: clang-tidy:configure-push-cuda
128 COMPILER_MAJOR_VERSION: 8
129 BUILD_DIR: build-clang-tidy
130 EXTRA_INSTALLS: clang-tidy-$COMPILER_MAJOR_VERSION
131 KUBERNETES_CPU_LIMIT: 4
132 KUBERNETES_CPU_REQUEST: 2
133 KUBERNETES_MEMORY_REQUEST: 4Gi
135 # Make sure that a Python interpreter can be found for `/bin/env python`
136 - test -x /usr/bin/python || update-alternatives --install /usr/bin/python python /usr/bin/python3 1
137 # TODO (issue #3272) `master` is not appropriate for use on release-xxxx branches, how should we handle that?
138 - REV=$(git fetch -q https://gitlab.com/gromacs/gromacs.git master && git show -s --pretty=format:"%h" `git merge-base FETCH_HEAD HEAD`)
139 - HEAD_REV=$(git show -s --pretty=format:"%h" HEAD)
140 - if [[ "$REV" == "$HEAD_REV" ]] ; then
143 - echo "Revision used for branch point is $REV"
145 - 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
146 - grep -i "found code issues|warnings" clang-tidy.log | tee code-lint.txt || true
147 - if [ -s code-lint.txt ] ; then echo "clang-tidy.sh found issues"; exit 1; fi
160 image: ${CI_REGISTRY}/gromacs/gromacs/ci-ubuntu-18.04-llvm-11-tsan
162 COMPILER_MAJOR_VERSION: 11
163 KUBERNETES_CPU_LIMIT: 1
164 KUBERNETES_CPU_REQUEST: 1
165 KUBERNETES_MEMORY_REQUEST: 2Gi
166 EXTRA_INSTALLS: clang-format-$COMPILER_MAJOR_VERSION
168 # TODO (issue #3272) `master` is not appropriate for use on release-xxxx branches, how should we handle that?
169 - REV=$(git fetch -q https://gitlab.com/gromacs/gromacs.git master && git show -s --pretty=format:"%h" `git merge-base FETCH_HEAD HEAD`)
170 - HEAD_REV=$(git show -s --pretty=format:"%h" HEAD)
171 - if [[ "$REV" == "$HEAD_REV" ]] ; then
174 - echo "Revision used for branch point is $REV"
176 - CLANG_FORMAT=clang-format-$COMPILER_MAJOR_VERSION admin/clang-format.sh check --rev=$REV --warnings=clang-format.log
177 - grep -i "needs formatting" clang-format.log | tee formatting.txt || true
178 - if [ -s formatting.txt ] ; then echo "clang-format.sh found issues"; exit 1; fi
191 image: ${CI_REGISTRY}/gromacs/gromacs/ci-ubuntu-18.04-llvm-11-tsan
193 KUBERNETES_CPU_LIMIT: 1
194 KUBERNETES_CPU_REQUEST: 1
195 KUBERNETES_MEMORY_REQUEST: 2Gi
197 - REV=$(git fetch -q https://gitlab.com/gromacs/gromacs.git master && git show -s --pretty=format:"%h" `git merge-base FETCH_HEAD HEAD`)
198 - HEAD_REV=$(git show -s --pretty=format:"%h" HEAD)
199 - if [[ "$REV" == "$HEAD_REV" ]] ; then
202 - echo "Revision used for branch point is $REV"
204 - admin/copyright.sh check --rev=$REV --warnings=copyright.log
205 - grep -i "copyright year" copyright.log | tee years.log || true
206 - grep -i "copyright header" copyright.log | tee headers.log || true
207 - if [[ -s years.log || -s headers.log ]] ; then
208 echo "Copyright information needs updating" ;
222 - .before_script:default
230 KUBERNETES_CPU_LIMIT: 1
231 KUBERNETES_CPU_REQUEST: 1
232 KUBERNETES_MEMORY_REQUEST: 2Gi
233 BUILD_DIR: build-docs
235 - CMAKE=${CMAKE:-$(which cmake)}
237 - $CMAKE --build . --target check-source
238 - awk '/warning.*include style.*order/,/You can use.*rst|^$/' docs/doxygen/check-source.log | tee doxygenError.txt || true
239 - awk '/warning:.*includes/,/unnecessarily|^$/' docs/doxygen/check-source.log | tee -a doxygenError.txt || true
240 - awk '/Traceback/,/.*rror|^$/' docs/doxygen/doxygen*log docs/doxygen/check-source.log | tee -a doxygenError.txt || true
241 - awk '/warning:/,/in doxygen.*|^$/' docs/doxygen/doxygen*log | tee -a doxygenError.txt || true
242 - grep -i "unused cycle suppression" docs/doxygen/check-source.log | tee -a doxygenError.txt || true
243 - if [ -s doxygenError.txt ] ; then echo "Found errors while running doxygen"; exit 1; fi
245 name: docs-artifacts-$CI_COMMIT_REF_SLUG
249 - $BUILD_DIR/docs/doxygen/doxygen-xml.log
250 - $BUILD_DIR/docs/doxygen/check-source.log
255 - .rules:nightly-not-for-release
260 KUBERNETES_CPU_LIMIT: 1
261 KUBERNETES_CPU_REQUEST: 1
262 KUBERNETES_MEMORY_REQUEST: 2Gi
263 BUILD_DIR: build-docs
266 - linkchecker docs/html/index.html -f $CI_PROJECT_DIR/docs/linkcheckerrc -Fxml --ignore-url html-full
267 --ignore-url html-user --ignore-url html-lib --ignore-url .tar.gz --ignore-url _sources
271 junit: $BUILD_DIR/linkchecker-out.xml