@@ -55,6 +55,78 @@ on_failure_meson: &on_failure_meson
55
55
type : text/plain
56
56
57
57
58
+ # To avoid unnecessarily spinning up a lot of VMs / containers for entirely
59
+ # broken commits, have a minimal task that all others depend on.
60
+ task :
61
+ name : SanityCheck
62
+
63
+ # If a specific OS is requested, don't run the sanity check. This shortens
64
+ # push-wait-for-ci cycle time a bit when debugging operating system specific
65
+ # failures. Uses skip instead of only_if, as cirrus otherwise warns about
66
+ # only_if conditions not matching.
67
+ skip : $CIRRUS_CHANGE_MESSAGE =~ '.*\nci-os-only:.*'
68
+
69
+ env :
70
+ CPUS : 4
71
+ BUILD_JOBS : 8
72
+ TEST_JOBS : 8
73
+ CCACHE_DIR : ${CIRRUS_WORKING_DIR}/ccache_dir
74
+ # no options enabled, should be small
75
+ CCACHE_MAXSIZE : " 150M"
76
+
77
+ # Container starts up quickly, but is slower at runtime, particularly for
78
+ # tests. Good for the briefly running sanity check.
79
+ container :
80
+ image : $CONTAINER_REPO/linux_debian_bullseye_ci:latest
81
+ cpu : $CPUS
82
+
83
+ ccache_cache :
84
+ folder : $CCACHE_DIR
85
+
86
+ create_user_script : |
87
+ useradd -m postgres
88
+ chown -R postgres:postgres .
89
+ mkdir -p ${CCACHE_DIR}
90
+ chown -R postgres:postgres ${CCACHE_DIR}
91
+ echo '* - memlock 134217728' > /etc/security/limits.d/postgres.conf
92
+ su postgres -c "ulimit -l -H && ulimit -l -S"
93
+ # Can't change container's kernel.core_pattern. Postgres user can't write
94
+ # to / normally. Change that.
95
+ chown root:postgres /
96
+ chmod g+rwx /
97
+
98
+ configure_script : |
99
+ su postgres <<-EOF
100
+ meson setup \
101
+ --buildtype=debug \
102
+ --auto-features=disabled \
103
+ -Dtap_tests=enabled \
104
+ build
105
+ EOF
106
+ build_script : |
107
+ su postgres <<-EOF
108
+ ninja -C build -j${BUILD_JOBS}
109
+ EOF
110
+ upload_caches : ccache
111
+
112
+ # Run a minimal set of tests. The main regression tests take too long for
113
+ # this purpose. For now this is a random quick pg_regress style test, and a
114
+ # tap test that exercises both a frontend binary and the backend.
115
+ test_minimal_script : |
116
+ su postgres <<-EOF
117
+ ulimit -c unlimited
118
+ meson test $MTEST_ARGS --num-processes ${TEST_JOBS} \
119
+ tmp_install cube/regress pg_ctl/001_start_stop
120
+ EOF
121
+
122
+ on_failure :
123
+ << : *on_failure_meson
124
+ cores_script : |
125
+ mkdir -m 770 /tmp/cores
126
+ find / -maxdepth 1 -type f -name 'core*' -exec mv '{}' /tmp/cores/ \;
127
+ src/tools/ci/cores_backtrace.sh linux /tmp/cores
128
+
129
+
58
130
task :
59
131
name : FreeBSD - 13 - Meson
60
132
69
141
CPPFLAGS : -DRELCACHE_FORCE_RELEASE -DCOPY_PARSE_PLAN_TREES -DWRITE_READ_PARSE_PLAN_TREES -DRAW_EXPRESSION_COVERAGE_TEST
70
142
CFLAGS : -Og -ggdb
71
143
144
+ depends_on : SanityCheck
72
145
only_if : $CIRRUS_CHANGE_MESSAGE !=~ '.*\nci-os-only:.*' || $CIRRUS_CHANGE_MESSAGE =~ '.*\nci-os-only:[^\n]*freebsd.*'
73
146
74
147
compute_engine_instance :
@@ -170,6 +243,7 @@ task:
170
243
LINUX_CONFIGURE_FEATURES : *LINUX_CONFIGURE_FEATURES
171
244
LINUX_MESON_FEATURES : *LINUX_MESON_FEATURES
172
245
246
+ depends_on : SanityCheck
173
247
only_if : $CIRRUS_CHANGE_MESSAGE !=~ '.*\nci-os-only:.*' || $CIRRUS_CHANGE_MESSAGE =~ '.*\nci-os-only:[^\n]*linux.*'
174
248
175
249
compute_engine_instance :
@@ -311,6 +385,7 @@ task:
311
385
CFLAGS : -Og -ggdb
312
386
CXXFLAGS : -Og -ggdb
313
387
388
+ depends_on : SanityCheck
314
389
only_if : $CIRRUS_CHANGE_MESSAGE !=~ '.*\nci-os-only:.*' || $CIRRUS_CHANGE_MESSAGE =~ '.*\nci-os-only:[^\n]*(macos|darwin|osx).*'
315
390
316
391
osx_instance :
@@ -430,6 +505,7 @@ task:
430
505
# 0x8001 is SEM_FAILCRITICALERRORS | SEM_NOOPENFILEERRORBOX
431
506
CIRRUS_WINDOWS_ERROR_MODE : 0x8001
432
507
508
+ depends_on : SanityCheck
433
509
only_if : $CIRRUS_CHANGE_MESSAGE !=~ '.*\nci-os-only:.*' || $CIRRUS_CHANGE_MESSAGE =~ '.*\nci-os-only:[^\n]*windows.*'
434
510
435
511
windows_container :
@@ -469,6 +545,8 @@ task:
469
545
# worth using only_if despite being manual, otherwise this task will show up
470
546
# when e.g. ci-os-only: linux is used.
471
547
only_if : $CIRRUS_CHANGE_MESSAGE !=~ '.*\nci-os-only:.*' || $CIRRUS_CHANGE_MESSAGE =~ '.*\nci-os-only:[^\n]*mingw.*'
548
+ # otherwise it'll be sorted before other tasks
549
+ depends_on : SanityCheck
472
550
473
551
windows_container :
474
552
image : $CONTAINER_REPO/windows_ci_mingw64:latest
@@ -523,9 +601,12 @@ task:
523
601
task :
524
602
name : CompilerWarnings
525
603
526
- # To limit unnecessary work only run this once the normal linux test succeeds
527
- depends_on :
528
- - Linux - Debian Bullseye - Meson
604
+ # To limit unnecessary work only run this once the SanityCheck
605
+ # succeeds. This is particularly important for this task as we intentionally
606
+ # use always: to continue after failures. Task that did not run count as a
607
+ # success, so we need to recheck SanityChecks's condition here ...
608
+ depends_on : SanityCheck
609
+ only_if : $CIRRUS_CHANGE_MESSAGE !=~ '.*\nci-os-only:.*'
529
610
530
611
env :
531
612
CPUS : 4
@@ -539,10 +620,6 @@ task:
539
620
LINUX_CONFIGURE_FEATURES : *LINUX_CONFIGURE_FEATURES
540
621
LINUX_MESON_FEATURES : *LINUX_MESON_FEATURES
541
622
542
- # task that did not run, count as a success, so we need to recheck Linux'
543
- # condition here ...
544
- only_if : $CIRRUS_CHANGE_MESSAGE !=~ '.*\nci-os-only:.*' || $CIRRUS_CHANGE_MESSAGE =~ '.*\nci-os-only:[^\n]*linux.*'
545
-
546
623
container :
547
624
image : $CONTAINER_REPO/linux_debian_bullseye_ci:latest
548
625
cpu : $CPUS
0 commit comments