Continuous Integration

From PostgreSQL wiki
Jump to: navigation, search

Here is some information about how to use a variety of free continuous integration services, for PostgreSQL hackers. You'll need a BitBucket, GitHub, GitLab or other public source repository account. Then you'll need to select one or more CI service and tell it to watch your account. In the case of the popular repo hosts you don't have to create a new account on the CI provider websites -- you just grant access. Finally you'll have to tell it how to build your branches with one or more control file in your source tree. You can add the control files in an extra commit that lives only in your feature development branch. The PostgreSQL master branch doesn't have any CI control files in it.

The unofficial PostgreSQL Patch Tester uses a couple of these services to test patches posted to the -hackers mailing list, and the branches it creates contain some example control files that might be useful.

AppVeyor

AppVeyor builds and tests code on Windows, Linux, macOS. Support for GitHub, GitHub Enterprise, Bitbucket, GitLab, VSTS, Kiln or custom publicly accessible repos. Discussion MingGW, Cygwin, MSVC appveyor.yml files from Peter Eisentraut

Cirrus CI

Cirrus CI supports at least Windows, Linux, FreeBSD and macOS, so it currently has the widest range of operating systems targeted by PostgreSQL (and there may more soon). It supports only Github as a source, and can be enabled for your account very easily from Github Marketplace. It's free for open source projects.

Here is a work-in-progress example of how to use it to build a PostgreSQL branch on those four operating systems. Click the green checkmark to see results, and look at the top commit in that branch for the control files. The .cirrus.yml file contains a list of to-do items for further work...

CodeCov

CodeCov is not a CI system, but is closely related and worth mentioning. If you configure Travis CI to build and test your branches with coverage enabled, you might also be interested to see code coverage information in a nice web interface on CodeCov.

Travis CI

Travis CI supports Linux, macOS and maybe more. Works only with GitHub. Controlled by a .travis.yml file.