PostgreSQL/.cirrus.yml
Andres Freund 49cba82bec ci: Per-repo configuration for manually trigger tasks
We do not want to trigger some tasks by default, to avoid using too many
compute credits. These tasks have to be manually triggered to be run. But
e.g. for cfbot we do have sufficient resources, so we always want to start
those tasks.

With this commit, an individual repository can be configured to trigger
them automatically using an environment variable defined under
"Repository Settings", for example:

REPO_CI_AUTOMATIC_TRIGGER_TASKS="mingw netbsd openbsd"

This will enable cfbot to turn them on by default when running tests for the
Commitfest app.

Backpatch this back to PG 15, even though PG 15 does not have any manually
triggered task. Keeping the CI infrastructure the same seems advantageous.

Author: Andres Freund <andres@anarazel.de>
Co-authored-by: Thomas Munro <thomas.munro@gmail.com>
Co-authored-by: Nazir Bilal Yavuz <byavuz81@gmail.com>
Reviewed-by: Nazir Bilal Yavuz <byavuz81@gmail.com>
Discussion: https://postgr.es/m/20240413021221.hg53rvqlvldqh57i%40awork3.anarazel.de
Backpatch-through: 16
2025-08-14 11:54:03 -04:00

92 lines
2.5 KiB
YAML

# CI configuration file for CI utilizing cirrus-ci.org
#
# For instructions on how to enable the CI integration in a repository and
# further details, see src/tools/ci/README
#
#
# The actual CI tasks are defined in .cirrus.tasks.yml. To make the compute
# resources for CI configurable on a repository level, the "final" CI
# configuration is the combination of:
#
# 1) the contents of this file
#
# 2) computed environment variables
#
# Used to enable/disable tasks based on the execution environment. See
# .cirrus.star: compute_environment_vars()
#
# 3) if defined, the contents of the file referenced by the, repository
# level, REPO_CI_CONFIG_GIT_URL variable (see
# https://cirrus-ci.org/guide/programming-tasks/#fs for the accepted
# format)
#
# This allows running tasks in a different execution environment than the
# default, e.g. to have sufficient resources for cfbot.
#
# 4) .cirrus.tasks.yml
#
# This composition is done by .cirrus.star
env:
# Source of images / containers
GCP_PROJECT: pg-ci-images
IMAGE_PROJECT: $GCP_PROJECT
CONTAINER_REPO: us-docker.pkg.dev/${GCP_PROJECT}/ci
DISK_SIZE: 25
# Define how to run various types of tasks.
# VMs provided by cirrus-ci. Each user has a limited number of "free" credits
# for testing.
cirrus_community_vm_template: &cirrus_community_vm_template
compute_engine_instance:
image_project: $IMAGE_PROJECT
image: family/$IMAGE_FAMILY
platform: $PLATFORM
cpu: $CPUS
disk: $DISK_SIZE
default_linux_task_template: &linux_task_template
env:
PLATFORM: linux
<<: *cirrus_community_vm_template
default_freebsd_task_template: &freebsd_task_template
env:
PLATFORM: freebsd
<<: *cirrus_community_vm_template
default_netbsd_task_template: &netbsd_task_template
env:
PLATFORM: netbsd
<<: *cirrus_community_vm_template
default_openbsd_task_template: &openbsd_task_template
env:
PLATFORM: openbsd
<<: *cirrus_community_vm_template
default_windows_task_template: &windows_task_template
env:
PLATFORM: windows
<<: *cirrus_community_vm_template
# macos workers provided by cirrus-ci
default_macos_task_template: &macos_task_template
env:
PLATFORM: macos
macos_instance:
image: $IMAGE
# Contents of REPO_CI_CONFIG_GIT_URL, if defined, will be inserted here,
# followed by the contents .cirrus.tasks.yml. This allows
# REPO_CI_CONFIG_GIT_URL to override how the task types above will be
# executed, e.g. using a custom compute account or permanent workers.