Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit462f4df

Browse files
committed
ci: Move execution method of tasks into yaml templates
This is done in preparation for making the compute resources for CIconfigurable. It also looks cleaner.Reviewed-by: Daniel Gustafsson <daniel@yesql.se>Discussion:https://postgr.es/m/20230808021541.7lbzdefvma7qmn3w@awork3.anarazel.deBackpatch: 15-, where CI support was added
1 parent89daa5a commit462f4df

File tree

1 file changed

+55
-22
lines changed

1 file changed

+55
-22
lines changed

‎.cirrus.yml

Lines changed: 55 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ env:
99
GCP_PROJECT:pg-ci-images
1010
IMAGE_PROJECT:$GCP_PROJECT
1111
CONTAINER_REPO:us-docker.pkg.dev/${GCP_PROJECT}/ci
12+
DISK_SIZE:25
1213

1314
# The lower depth accelerates git clone. Use a bit of depth so that
1415
# concurrent tasks and retrying older jobs have a chance of working.
@@ -27,6 +28,45 @@ env:
2728
PG_TEST_EXTRA:kerberos ldap ssl
2829

2930

31+
# Define how to run various types of tasks.
32+
33+
# VMs provided by cirrus-ci. Each user has a limited number of "free" credits
34+
# for testing.
35+
cirrus_community_vm_template:&cirrus_community_vm_template
36+
compute_engine_instance:
37+
image_project:$IMAGE_PROJECT
38+
image:family/$IMAGE_FAMILY
39+
platform:$PLATFORM
40+
cpu:$CPUS
41+
disk:$DISK_SIZE
42+
43+
44+
default_linux_task_template:&linux_task_template
45+
env:
46+
PLATFORM:linux
47+
<<:*cirrus_community_vm_template
48+
49+
50+
default_freebsd_task_template:&freebsd_task_template
51+
env:
52+
PLATFORM:freebsd
53+
<<:*cirrus_community_vm_template
54+
55+
56+
default_windows_task_template:&windows_task_template
57+
env:
58+
PLATFORM:windows
59+
<<:*cirrus_community_vm_template
60+
61+
62+
# macos workers provided by cirrus-ci
63+
default_macos_task_template:&macos_task_template
64+
env:
65+
PLATFORM:macos
66+
macos_instance:
67+
image:$IMAGE
68+
69+
3070
# What files to preserve in case tests fail
3171
on_failure:&on_failure
3272
log_artifacts:
@@ -45,17 +85,14 @@ task:
4585
CPUS:2
4686
BUILD_JOBS:3
4787
TEST_JOBS:3
88+
IMAGE_FAMILY:pg-ci-freebsd-13
89+
DISK_SIZE:50
4890

4991
CCACHE_DIR:/tmp/ccache_dir
5092

51-
only_if:$CIRRUS_CHANGE_MESSAGE !=~ '.*\nci-os-only:.*' || $CIRRUS_CHANGE_MESSAGE =~ '.*\nci-os-only:[^\n]*freebsd.*'
93+
<<:*freebsd_task_template
5294

53-
compute_engine_instance:
54-
image_project:$IMAGE_PROJECT
55-
image:family/pg-ci-freebsd-13
56-
platform:freebsd
57-
cpu:$CPUS
58-
disk:50
95+
only_if:$CIRRUS_CHANGE_MESSAGE !=~ '.*\nci-os-only:.*' || $CIRRUS_CHANGE_MESSAGE =~ '.*\nci-os-only:[^\n]*freebsd.*'
5996

6097
sysinfo_script:|
6198
id
@@ -152,19 +189,16 @@ task:
152189
CPUS:4
153190
BUILD_JOBS:4
154191
TEST_JOBS:8# experimentally derived to be a decent choice
192+
IMAGE_FAMILY:pg-ci-bullseye
155193

156194
CCACHE_DIR:/tmp/ccache_dir
157195
DEBUGINFOD_URLS:"https://debuginfod.debian.net"
158196

159197
LINUX_CONFIGURE_FEATURES:*LINUX_CONFIGURE_FEATURES
160198

161-
only_if:$CIRRUS_CHANGE_MESSAGE !=~ '.*\nci-os-only:.*' || $CIRRUS_CHANGE_MESSAGE =~ '.*\nci-os-only:[^\n]*linux.*'
199+
<<:*linux_task_template
162200

163-
compute_engine_instance:
164-
image_project:$IMAGE_PROJECT
165-
image:family/pg-ci-bullseye
166-
platform:linux
167-
cpu:$CPUS
201+
only_if:$CIRRUS_CHANGE_MESSAGE !=~ '.*\nci-os-only:.*' || $CIRRUS_CHANGE_MESSAGE =~ '.*\nci-os-only:[^\n]*linux.*'
168202

169203
ccache_cache:
170204
folder:${CCACHE_DIR}
@@ -228,15 +262,15 @@ task:
228262
# work OK. See
229263
# https://postgr.es/m/20220927040208.l3shfcidovpzqxfh%40awork3.anarazel.de
230264
TEST_JOBS:8
265+
IMAGE:ghcr.io/cirruslabs/macos-ventura-base:latest
231266

232267
CIRRUS_WORKING_DIR:${HOME}/pgsql/
233268
CCACHE_DIR:${HOME}/ccache
234269
MACPORTS_CACHE:${HOME}/macports-cache
235270

236-
only_if:$CIRRUS_CHANGE_MESSAGE !=~ '.*\nci-os-only:.*' || $CIRRUS_CHANGE_MESSAGE =~ '.*\nci-os-only:[^\n]*(macos|darwin|osx).*'
271+
<<:*macos_task_template
237272

238-
macos_instance:
239-
image:ghcr.io/cirruslabs/macos-ventura-base:latest
273+
only_if:$CIRRUS_CHANGE_MESSAGE !=~ '.*\nci-os-only:.*' || $CIRRUS_CHANGE_MESSAGE =~ '.*\nci-os-only:[^\n]*(macos|darwin|osx).*'
240274

241275
sysinfo_script:|
242276
id
@@ -360,6 +394,8 @@ task:
360394
# build
361395
MSBFLAGS:-m -verbosity:minimal "-consoleLoggerParameters:Summary;ForceNoAlign" /p:TrackFileAccess=false -nologo
362396

397+
DISK_SIZE:50
398+
363399
# If tests hang forever, cirrus eventually times out. In that case log
364400
# output etc is not uploaded, making the problem hard to debug. Of course
365401
# tests internally should have shorter timeouts, but that's proven to not
@@ -382,14 +418,11 @@ task:
382418
# given that it explicitly prevents crash dumps from working...
383419
# 0x8001 is SEM_FAILCRITICALERRORS | SEM_NOOPENFILEERRORBOX
384420
CIRRUS_WINDOWS_ERROR_MODE:0x8001
421+
IMAGE_FAMILY:pg-ci-windows-ci-vs-2019
385422

386-
only_if:$CIRRUS_CHANGE_MESSAGE !=~ '.*\nci-os-only:.*' || $CIRRUS_CHANGE_MESSAGE =~ '.*\nci-os-only:[^\n]*windows.*'
423+
<<:*windows_task_template
387424

388-
compute_engine_instance:
389-
image_project:$IMAGE_PROJECT
390-
image:family/pg-ci-windows-ci-vs-2019
391-
platform:windows
392-
cpu:$CPUS
425+
only_if:$CIRRUS_CHANGE_MESSAGE !=~ '.*\nci-os-only:.*' || $CIRRUS_CHANGE_MESSAGE =~ '.*\nci-os-only:[^\n]*windows.*'
393426

394427
sysinfo_script:|
395428
chcp

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp