Table of Contents
The CP2K Continuous Integration (CI) system performs tests on every Pull Requests to the main cp2k repository, so as to verify that the revisions to code do not break important functionalities and workflows. The machinery is maintained at the separate repository cp2k/cp2k-ci, while the definitions and procedures are under the tools/docker directory in the main cp2k repository.
Mandatory checks
The CI always run the following four checks:
Git history
We want to keep the git history linear. If the git history of the PR contains one or more merge commits, this check will fail.
So, as instructed on Git Tips & Tricks, please always use git rebase instead of git pull when updating the branches of the local repository. For some background info see:
- https://www.endoflineblog.com/gitflow-considered-harmful
- https://www.endoflineblog.com/oneflow-a-git-branching-model-and-workflow
Precommit
Some files do not follow the project's formatting or style conventions, such as code formatting, whitespace, or other pre-commit checks. You can run ./make_pretty.sh to fix most of these issues automatically and locally prior to making the PR. This is a wrapper script for ./tools/precommit/precommit.py which connects to the online precommit server to inspect the files. It runs through the entire repository by default; to save time and touch only the files that have been revised, say ./src/particle_methods.F, append the filenames as arguments like ./make_pretty.sh ./src/particle_methods.F.
Misc
A few peripheral tests.
Regtest pdbg
Compile the CP2K program on the cloud and run through the regression test suite under the ./tests directory, which are elaborated on the manual. This is the most time-consuming and resource-extensive check of the four; therefore, when adding new input file(s) for testing new features, it is recommended to use lightweight ones that complete within seconds and require little disk space.
Optional checks
Apart from the four above, many other checks have been designed to cover a variety of compiler flavors and versions, hardware specs, environment configurations and workflows. Compiling the program and performing these checks for every PR would impose significant server load, so they are made optional before a PR is eligible for merging, but still tracked regularly in the CP2K Dashboard on a daily or weekly basis.
When appropriate, they are triggered manually on demand by any member of the cp2k-developers with a comment to the PR. For instance, saying /cp2kci gcc16 intel-ifx-psmp in the comments triggers the gcc16 and intel-ifx-psmp tests as defined in tools/docker/cp2k-ci.conf, as signalled by cp2k-ci[bot] reacting with eyes emoji.
Conventions
Analyzes the abstract syntax tree for violations to the coding conventions such as hardcoded write unit in WRITE (*, *) statements. The procedure is defined in ./tools/conventions.
Manual generation
Generates a set of the manual as html pages, including the documentation pages and the whole input reference.