postgresql/src/tools/ci
Tom Lane 0245f8db36 Pre-beta mechanical code beautification.
Run pgindent, pgperltidy, and reformat-dat-files.

This set of diffs is a bit larger than typical.  We've updated to
pg_bsd_indent 2.1.2, which properly indents variable declarations that
have multi-line initialization expressions (the continuation lines are
now indented one tab stop).  We've also updated to perltidy version
20230309 and changed some of its settings, which reduces its desire to
add whitespace to lines to make assignments etc. line up.  Going
forward, that should make for fewer random-seeming changes to existing
code.

Discussion: https://postgr.es/m/20230428092545.qfb3y5wcu4cm75ur@alvherre.pgsql
2023-05-19 17:24:48 -04:00
..
README Fix typo in CI README 2023-04-03 10:50:17 +02:00
cores_backtrace.sh ci: Add continuous integration for github repositories via cirrus-ci. 2021-12-30 19:02:44 -08:00
gcp_freebsd_repartition.sh ci: Add continuous integration for github repositories via cirrus-ci. 2021-12-30 19:02:44 -08:00
pg_ci_base.conf ci: Add continuous integration for github repositories via cirrus-ci. 2021-12-30 19:02:44 -08:00
windows_build_config.pl Pre-beta mechanical code beautification. 2023-05-19 17:24:48 -04:00

README

Postgres Continuous Integration (CI)
====================================

Postgres has two forms of CI:

1) All supported branches in the main postgres repository are continuously
   tested via the buildfarm. As this covers only the main repository, it
   cannot be used during development of features.

   For details see https://buildfarm.postgresql.org/

2) For not yet merged development work, CI can be enabled for some git hosting
   providers. This allows developers to test patches on a number of platforms
   before they are merged (or even submitted).


Configuring CI on personal repositories
=======================================

Currently postgres contains CI support utilizing cirrus-ci. cirrus-ci
currently is only available for github.


Enabling cirrus-ci in a github repository
=========================================

To enable cirrus-ci on a repository, go to
https://github.com/marketplace/cirrus-ci and select "Public
Repositories". Then "Install it for free" and "Complete order". The next page
allows to configure which repositories cirrus-ci has access to. Choose the
relevant repository and "Install".

See also https://cirrus-ci.org/guide/quick-start/

Once enabled on a repository, future commits and pull-requests in that
repository will automatically trigger CI builds. These are visible from the
commit history / PRs, and can also be viewed in the cirrus-ci UI at
https://cirrus-ci.com/github/<username>/<reponame>/

Hint: all build log files are uploaded to cirrus-ci and can be downloaded
from the "Artifacts" section from the cirrus-ci UI after clicking into a
specific task on a build's summary page.


Images used for CI
==================

To keep CI times tolerable, most platforms use pre-generated images. Some
platforms use containers, others use full VMs. Images for both are generated
separately from CI runs, otherwise each git repository that is being tested
would need to build its own set of containers, which would be wasteful (both
in space and time.

These images are built, on a daily basis, from the specifications in
github.com/anarazel/pg-vm-images/


Controlling CI via commit messages
==================================

The behavior of CI can be controlled by special content in commit
messages. Currently the following controls are available:

- ci-os-only: {(freebsd|linux|macos|windows|mingw)}

  Only runs CI on operating systems specified. This can be useful when
  addressing portability issues affecting only a subset of platforms.