# Repository cleanliness. Source tidiness, linting, and policy compliance. clang-tidy:configure: extends: - .gromacs:base:configure - .use-clang7 - .rules:not-for-release dependencies: [] variables: BUILD_DIR: build-clang-tidy CMAKE_EXTRA_OPTIONS: -DCLANG_TIDY=clang-tidy-$COMPILER_MAJOR_VERSION -DGMX_CLANG_TIDY=ON -DGMX_COMPILER_WARNINGS=ON EXTRA_INSTALLS: clang-tidy-$COMPILER_MAJOR_VERSION CMAKE_GMXAPI_OPTIONS: "-DGMX_PYTHON_PACKAGE=OFF" # TODO: Enable GMX_PYTHON_PACKAGE for clang-tidy when dependencies are in Docker image. clang-tidy:build: extends: - .gromacs:base:build - .use-ccache - .variables:default - .use-clang7 - .rules:not-for-release stage: source-check needs: - job: clang-tidy:configure artifacts: true variables: BUILD_DIR: build-clang-tidy EXTRA_INSTALLS: clang-tidy-$COMPILER_MAJOR_VERSION clang-format: extends: - .variables:default - .use-clang7 - .rules:basic cache: {} stage: pre-build tags: [] variables: KUBERNETES_CPU_LIMIT: 1 KUBERNETES_CPU_REQUEST: 1 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 - 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: when: on_failure paths: - clang-format.log - formatting.txt copyright-check: extends: - .variables:default - .use-clang7 - .rules:basic cache: {} stage: pre-build tags: [] variables: KUBERNETES_CPU_LIMIT: 1 KUBERNETES_CPU_REQUEST: 1 KUBERNETES_MEMORY_LIMIT: 2Gi script: - admin/copyright.sh check --rev=HEAD^ --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 echo "Copyright information needs updating" ; exit 1 ; fi artifacts: when: on_failure paths: - copyright.log - years.log - headers.log check-source: extends: - .variables:default - .docs:build - .before_script:default - .rules:not-for-release cache: {} stage: source-check needs: - job: docs:build artifacts: true variables: KUBERNETES_CPU_LIMIT: 1 KUBERNETES_CPU_REQUEST: 1 KUBERNETES_MEMORY_LIMIT: 2Gi BUILD_DIR: build-docs script: - cd $BUILD_DIR - cmake --build . --target check-source - grep -qi "error" docs/doxygen/doxygen*log docs/doxygen/check-source.log | tee doxygenError.txt || true - grep -qi "warning" docs/doxygen/doxygen*log docs/doxygen/check-source.log | tee -a doxygenError.txt || true - if [ -s doxygenError.txt ] ; then echo "Found errors while running doxygen"; exit 1; fi artifacts: name: docs-artifacts-$CI_COMMIT_REF_SLUG when: always expire_in: 1 week paths: - $BUILD_DIR/docs/doxygen/doxygen-xml.log - $BUILD_DIR/docs/doxygen/check-source.log linkchecker: extends: - .webpage:build - .rules:nightly-not-for-release stage: nightly-build dependencies: - webpage:build variables: KUBERNETES_CPU_LIMIT: 1 KUBERNETES_CPU_REQUEST: 1 KUBERNETES_MEMORY_LIMIT: 2Gi BUILD_DIR: build-docs script: - cd $BUILD_DIR - linkchecker docs/html/index.html -f $CI_PROJECT_DIR/docs/linkcheckerrc -Fxml --ignore-url html-full --ignore-url html-user --ignore-url html-lib --ignore-url .tar.gz --ignore-url _sources -o xml artifacts: reports: junit: $BUILD_DIR/linkchecker-out.xml