# Repository cleanliness. Source tidiness, linting, and policy compliance. configure-clang-tidy: extends: - .gromacs:base:configure - .use-clang7 needs: - job: simple-build artifacts: false 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 except: variables: - $GROMACS_RELEASE build-clang-tidy: extends: - .gromacs:base:build - .use-ccache - .variables:default - .use-clang7 stage: source-check needs: - job: simple-build artifacts: false - job: configure-clang-tidy artifacts: true variables: BUILD_DIR: build-clang-tidy EXTRA_INSTALLS: clang-tidy-$COMPILER_MAJOR_VERSION except: variables: - $GROMACS_RELEASE run-clang-format: extends: - .gromacs:base:build - .variables:default - .use-clang7 cache: {} stage: source-check when: always needs: - job: simple-build artifacts: false variables: KUBERNETES_CPU_LIMIT: 1 KUBERNETES_CPU_REQUEST: 1 KUBERNETES_MEMORY_LIMIT: 2Gi EXTRA_INSTALLS: clang-format-$COMPILER_MAJOR_VERSION except: variables: - $GROMACS_RELEASE 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 run-copyright-check: extends: - .gromacs:base:build - .variables:default - .use-clang7 cache: {} stage: source-check when: always needs: - job: simple-build artifacts: false variables: KUBERNETES_CPU_LIMIT: 1 KUBERNETES_CPU_REQUEST: 1 KUBERNETES_MEMORY_LIMIT: 2Gi except: variables: - $GROMACS_RELEASE 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 run-check-source: extends: - .variables:default - .build-docs-binary-template - .documentation-before-script-template cache: {} stage: source-check needs: - job: simple-build artifacts: false - job: build-docs artifacts: true variables: KUBERNETES_CPU_LIMIT: 1 KUBERNETES_CPU_REQUEST: 1 KUBERNETES_MEMORY_LIMIT: 2Gi BUILD_DIR: build-docs except: variables: - $GROMACS_RELEASE 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: - .build-docs-webpage stage: nightly-build dependencies: - webpage-gmxapi only: - schedules - triggers - merge_requests - external_pull_requests except: variables: - $GROMACS_RELEASE variables: KUBERNETES_CPU_LIMIT: 1 KUBERNETES_CPU_REQUEST: 1 KUBERNETES_MEMORY_LIMIT: 2Gi BUILD_DIR: build-docs-gmxapi script: - cd $BUILD_DIR - linkchecker docs/html/index.html -f ../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