1 # Repository cleanliness. Source tidiness, linting, and policy compliance.
5 - .gromacs:base:configure
7 - .rules:not-for-release
10 BUILD_DIR: build-clang-tidy
11 CMAKE_EXTRA_OPTIONS: -DCLANG_TIDY=clang-tidy-$COMPILER_MAJOR_VERSION -DGMX_CLANG_TIDY=ON -DGMX_COMPILER_WARNINGS=ON
12 EXTRA_INSTALLS: clang-tidy-$COMPILER_MAJOR_VERSION
13 CMAKE_GMXAPI_OPTIONS: "-DGMX_PYTHON_PACKAGE=OFF"
14 # TODO: Enable GMX_PYTHON_PACKAGE for clang-tidy when dependencies are in Docker image.
22 - .rules:nightly-not-for-release
25 - job: clang-tidy:configure
27 BUILD_DIR: build-clang-tidy
28 EXTRA_INSTALLS: clang-tidy-$COMPILER_MAJOR_VERSION
36 - .rules:not-for-release
39 - job: clang-tidy:configure
41 BUILD_DIR: build-clang-tidy
42 EXTRA_INSTALLS: clang-tidy-$COMPILER_MAJOR_VERSION
43 KUBERNETES_CPU_LIMIT: 4
44 KUBERNETES_CPU_REQUEST: 2
45 KUBERNETES_MEMORY_LIMIT: 4Gi
47 # TODO (issue #3272) `master` is not appropriate for use on release-xxxx branches, how should we handle that?
48 # See discussion at https://gitlab.com/gromacs/gromacs/-/merge_requests/67
49 - REV=$(git fetch -q https://gitlab.com/gromacs/gromacs.git master && git show -s --pretty=format:"%h" `git merge-base FETCH_HEAD HEAD`)
50 - 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
51 - grep -iq "found code issues" clang-tidy.log | tee code-lint.txt || true
52 - if [ -s code-lint.txt ] ; then echo "clang-tidy.sh found issues"; exit 1; fi
68 KUBERNETES_CPU_LIMIT: 1
69 KUBERNETES_CPU_REQUEST: 1
70 KUBERNETES_MEMORY_LIMIT: 2Gi
71 EXTRA_INSTALLS: clang-format-$COMPILER_MAJOR_VERSION
73 - export CLANG_FORMAT=clang-format-$COMPILER_MAJOR_VERSION
74 - admin/clang-format.sh check --rev=HEAD^ --warnings=clang-format.log
75 - grep -iq "needs formatting" clang-format.log | tee formatting.txt || true
76 - if [ -s formatting.txt ] ; then echo "clang-format.sh found issues"; exit 1; fi
92 KUBERNETES_CPU_LIMIT: 1
93 KUBERNETES_CPU_REQUEST: 1
94 KUBERNETES_MEMORY_LIMIT: 2Gi
96 - admin/copyright.sh check --rev=HEAD^ --warnings=copyright.log
97 - grep -iq "copyright year" copyright.log | tee years.log || true
98 - grep -iq "copyright header" copyright.log | tee headers.log || true
99 - if [[ -s years.log || -s headers.log ]] ; then
100 echo "Copyright information needs updating" ;
114 - .before_script:default
115 - .rules:not-for-release
122 KUBERNETES_CPU_LIMIT: 1
123 KUBERNETES_CPU_REQUEST: 1
124 KUBERNETES_MEMORY_LIMIT: 2Gi
125 BUILD_DIR: build-docs
128 - cmake --build . --target check-source
129 - grep -qi "error" docs/doxygen/doxygen*log docs/doxygen/check-source.log | tee doxygenError.txt || true
130 - grep -qi "warning" docs/doxygen/doxygen*log docs/doxygen/check-source.log | tee -a doxygenError.txt || true
131 - if [ -s doxygenError.txt ] ; then echo "Found errors while running doxygen"; exit 1; fi
133 name: docs-artifacts-$CI_COMMIT_REF_SLUG
137 - $BUILD_DIR/docs/doxygen/doxygen-xml.log
138 - $BUILD_DIR/docs/doxygen/check-source.log
143 - .rules:nightly-not-for-release
148 KUBERNETES_CPU_LIMIT: 1
149 KUBERNETES_CPU_REQUEST: 1
150 KUBERNETES_MEMORY_LIMIT: 2Gi
151 BUILD_DIR: build-docs
154 - linkchecker docs/html/index.html -f $CI_PROJECT_DIR/docs/linkcheckerrc -Fxml --ignore-url html-full
155 --ignore-url html-user --ignore-url html-lib --ignore-url .tar.gz --ignore-url _sources
159 junit: $BUILD_DIR/linkchecker-out.xml