-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Expand file tree
/
Copy pathlinux-32bit-build-and-test.yaml
More file actions
364 lines (335 loc) · 13.4 KB
/
Copy pathlinux-32bit-build-and-test.yaml
File metadata and controls
364 lines (335 loc) · 13.4 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
name: Regression Linux i386
"on":
schedule:
# run daily 0:00 on main branch
# Since we use the date as a part of the cache key to ensure no
# stale cache entries hiding build failures we need to make sure
# we have a cache entry present before workflows that depend on cache
# are run.
- cron: '0 0 * * *'
push:
branches:
- main
- ?.*.x
- prerelease_test
- trigger/regression
pull_request:
jobs:
config:
runs-on: ubuntu-latest
outputs:
pg_latest: ${{ github.event_name == 'pull_request' && steps.setter.outputs.PG_LATEST_ONLY || steps.setter.outputs.PG_LATEST }}
steps:
- name: Checkout source code
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
- name: Read configuration
id: setter
run: python .github/gh_config_reader.py
check_paths:
runs-on: ubuntu-latest
outputs:
run_ci: >-
${{ github.event_name == 'push'
|| (steps.filter.outputs.src == 'true' && !contains(github.event.pull_request.labels.*.name, 'skip-ci'))
}}
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
- uses: dorny/paths-filter@7b450fff21473bca461d4b92ce414b9d0420d706 # v4.0.2
id: filter
with:
filters: .github/filters.yaml
regress:
if: needs.check_paths.outputs.run_ci == 'true'
name: PG${{ matrix.pg }} ${{ matrix.build_type }} linux-i386
runs-on: ubuntu-latest
needs: [config, check_paths]
container:
image: i386/debian:bookworm-slim@sha256:4d0f3abf8160f14d07208ff72dc4c46882bc5f0a259a8bb8652702c0ee2cc67a
options: --privileged --ulimit core=-1:-1 --ulimit fsize=-1:-1
env:
PG_SRC_DIR: pgbuild
PG_INSTALL_DIR: postgresql
CLANG: clang-14
CC: clang-14
CXX: clang++-14
DEBIAN_FRONTEND: noninteractive
# vectorized_aggregation has different output on i386 because int8 is by
# reference and currently it cannot be used for vectorized hash grouping.
# vector_agg_text and vector_agg_groupagg use the UMASH hashing library
# that we can't compile on i386.
# For the same reason of different hashing, we ignore the results of
# several bloom filter tests as well.
IGNORES: >-
append-*
bgw_db_scheduler*
chunkwise_agg_cost
columnar_scan_cost*
compress_bloom
compress_bloom_sparse_compat
compress_bloom_sparse_debug
compress_composite_bloom_debug
compress_observ-*
compress_qualpushdown_saop
compress_sort_transform
compression_allocation
merge_append_partially_compressed
net
pg_dump
telemetry
transparent_decompress_chunk-*
transparent_decompression-*
uncompressed_size
vector_agg_byte
vector_agg_expr
vector_agg_filter
vector_agg_groupagg
vector_agg_grouping
vector_agg_planning-*
vector_agg_text
vector_agg_uuid
vectorized_aggregation
SKIPS: chunk_adaptive histogram_test-*
EXTENSIONS: "postgres_fdw test_decoding"
strategy:
matrix:
pg: ${{ fromJson(needs.config.outputs.pg_latest) }}
build_type: [ Debug ]
fail-fast: false
steps:
# /__e/node16/bin/node (used by actions/checkout@v4) needs 64-bit libraries
- name: Install 64-bit libraries for GitHub actions
timeout-minutes: 15
run: |
apt-get update
apt-get install -y lib64atomic1 lib64gcc-s1 lib64stdc++6 libc6-amd64 jq
- name: Install build dependencies
timeout-minutes: 15
run: |
echo '/tmp/core.%h.%e.%t' > /proc/sys/kernel/core_pattern
apt-get install -y gcc make cmake libssl-dev libipc-run-perl \
libtest-most-perl sudo gdb git wget gawk lbzip2 flex bison lcov base-files \
locales clang-14 llvm-14 llvm-14-dev llvm-14-tools postgresql-client pkgconf \
icu-devtools
- name: Checkout TimescaleDB
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
# We are going to rebuild Postgres weekly, so that it doesn't suddenly break
# ages after the original problem.
- name: Get date for build caching
id: get-date
run: |
echo "date=$(date +"%V")" >> $GITHUB_OUTPUT
# we cache the build directory instead of the install directory here
# because extension installation will write files to install directory
# leading to a tainted cache
- name: Cache PostgreSQL ${{ matrix.pg }} ${{ matrix.build_type }}
id: cache-postgresql
uses: actions/cache@55cc8345863c7cc4c66a329aec7e433d2d1c52a9 # v6.1.0
with:
path: ~/${{ env.PG_SRC_DIR }}
key: "linux-32-bit-postgresql-${{ matrix.pg }}\
-${{ steps.get-date.outputs.date }}-${{ hashFiles('.github/**') }}"
- name: Build PostgreSQL ${{ matrix.pg }}
if: steps.cache-postgresql.outputs.cache-hit != 'true'
run: |
wget -q --tries=6 --waitretry=15 -O postgresql.tar.bz2 \
https://ftp.postgresql.org/pub/source/v${{ matrix.pg }}/postgresql-${{ matrix.pg }}.tar.bz2
mkdir -p ~/$PG_SRC_DIR
tar --extract --file postgresql.tar.bz2 --directory ~/$PG_SRC_DIR --strip-components 1
cd ~/$PG_SRC_DIR
# When building on i386 with the clang compiler, Postgres requires -msse2 to be used
./configure --prefix=$HOME/$PG_INSTALL_DIR --with-openssl \
--without-readline --without-zlib --without-libxml --enable-cassert \
--enable-debug --with-llvm --without-icu LLVM_CONFIG=llvm-config-14 CFLAGS="-msse2"
make -j $(getconf _NPROCESSORS_ONLN)
for ext in ${EXTENSIONS}; do
make -j $(getconf _NPROCESSORS_ONLN) -C contrib/${ext}
done
- name: Install PostgreSQL ${{ matrix.pg }}
run: |
useradd postgres
cd ~/$PG_SRC_DIR
make install
for ext in ${EXTENSIONS}; do
make -C contrib/${ext} install
done
chown -R postgres:postgres $HOME/$PG_INSTALL_DIR
sed -i 's/^# *\(en_US.UTF-8\)/\1/' /etc/locale.gen
locale-gen
- name: Upload config.log
if: always() && steps.cache-postgresql.outputs.cache-hit != 'true'
uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1
with:
name: config.log linux-i386 PG${{ matrix.pg }}
path: ~/${{ env.PG_SRC_DIR }}/config.log
- name: Build TimescaleDB
run: |
# The owner of the checkout directory and the files do not match. Add the directory to
# Git's "safe.directory" setting. Otherwise git would complain about
# 'detected dubious ownership in repository'
git config --global --add safe.directory $(pwd)
./bootstrap -DCMAKE_BUILD_TYPE="${{ matrix.build_type }}" \
-DPG_SOURCE_DIR=~/$PG_SRC_DIR -DPG_PATH=~/$PG_INSTALL_DIR \
-DREQUIRE_ALL_TESTS=ON \
-DTEST_PG_LOG_DIRECTORY="$(readlink -f .)"
make -j $(getconf _NPROCESSORS_ONLN) -C build
make -C build install
chown -R postgres:postgres .
- name: Upload CMake Logs
if: always()
uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1
with:
name: CMake Logs linux-i386 PG${{ matrix.pg }}
path: |
build/CMakeCache.txt
build/CMakeFiles/CMakeConfigureLog.yaml
build/CMakeFiles/CMakeError.log
build/CMakeFiles/CMakeOutput.log
build/compile_commands.json
- name: make installcheck
id: installcheck
shell: bash
run: |
set -o pipefail
export LANG=C.UTF-8
#
# Even disabling parallel plans the Sort Method on 32bits
# is always 'still in progress' for PG17 and PG18. So for now added
# those tests to SKIPS.
#
PG_MAJOR=$(echo "${{ matrix.pg }}" | sed -e 's![.].*!!')
if [ ${PG_MAJOR} -eq 17 ]; then
SKIPS="${SKIPS} constraint_exclusion_prepared-17 ordered_append*"
fi
if [ ${PG_MAJOR} -eq 18 ]; then
SKIPS="${SKIPS} constraint_exclusion_prepared-18 ordered_append*"
fi
# PostgreSQL cannot be run as root. So, switch to postgres user.
runuser -u postgres -- \
make -k -C build installcheck IGNORES="${IGNORES}" \
SKIPS="${SKIPS}" PSQL="${HOME}/${PG_INSTALL_DIR}/bin/psql" \
| tee installcheck.log
- name: Show regression diffs
if: always()
id: collectlogs
shell: bash
run: |
find . -name regression.diffs -exec cat {} + > regression.log
# TAP tests do not produce regression.diffs. Append prove's failure
# summary from installcheck.log plus, for each failing test, the failed
# assertions
sed -n '/^Test Summary Report/,/^Result:/p' installcheck.log >> regression.log 2>/dev/null || true
for t in $(grep -hoE 't/[^ ]+\.pl[[:space:]]+\(Wstat' installcheck.log 2>/dev/null | sed -E 's#t/(.+)\.pl.*#\1#'); do
echo "=== regress_log_$t ===" >> regression.log
find . -name "regress_log_$t" -exec awk '
FNR==1 { blk=0 }
{ sub(/^\[[0-9:.]+\]\([0-9.]+s\) /, "") }
/^ok |^not ok |^# Looks like|^# Running:|^1\.\.|^Bail out/ { blk=0 }
/^# Failed test/ { blk=1 }
blk { print }
' {} + >> regression.log || true
done
if [[ -s regression.log ]]; then echo "regression_diff=true" >>$GITHUB_OUTPUT; fi
grep -e 'FAILED' -e 'failed (ignored)' -e 'not ok' installcheck.log || true
cat regression.log
- name: Save regression diffs
if: always() && steps.collectlogs.outputs.regression_diff == 'true'
uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1
with:
name: Regression diff linux-i386 PG${{ matrix.pg }}
path: |
regression.log
installcheck.log
- name: Save PostgreSQL log
if: always()
uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1
with:
name: PostgreSQL log linux-i386 PG${{ matrix.pg }}
path: postmaster.*
- name: Stack trace Linux
id: coredumps
if: always()
shell: bash
run: |
# wait in case there are in-progress coredumps
sleep 10
if compgen -G "/tmp/core*" > /dev/null; then
for file in /tmp/core*
do
gdb "${HOME}/${PG_INSTALL_DIR}/bin/postgres" -c $file <<<"
set verbose on
set trace-commands on
show debug-file-directory
printf "'"'"query = '%s'\n\n"'"'", debug_query_string
bt full
# We try to find ExceptionalCondition frame to print the failed condition
# for searching in logs.
frame function ExceptionalCondition
printf "'"'"condition = '%s'\n"'"'", conditionName
# Hopefully now we should be around the failed assertion, print where
# we are.
up 1
list
info args
info locals
" 2>&1 | tee -a stacktrace.log
done
echo "coredumps=true" >>$GITHUB_OUTPUT
exit 1
fi
- name: Coredumps
if: always() && steps.coredumps.outputs.coredumps == 'true'
uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1
with:
name: Coredumps linux-i386 PG${{ matrix.pg }}
path: coredumps
- name: Save stacktraces
if: always() && steps.coredumps.outputs.coredumps == 'true'
uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1
with:
name: Stacktraces linux-i386 PG${{ matrix.pg }}
path: stacktrace.log
- name: Save TAP test logs
if: always()
uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1
with:
name: TAP test logs PG${{ matrix.pg }}
path: |
build/test/tmp_check/log
build/tsl/test/tmp_check/log
- name: Upload test results to the database
if: always()
shell: bash
env:
# GitHub Actions allow you neither to use the env context for the job name,
# nor to access the job name from the step context, so we have to
# duplicate it to work around this nonsense.
JOB_NAME: PG${{ matrix.pg }} ${{ matrix.build_type }} linux-i386
CI_STATS_DB: ${{ secrets.CI_STATS_DB }}
GITHUB_EVENT_NAME: ${{ github.event_name }}
GITHUB_REF_NAME: ${{ github.ref_name }}
GITHUB_REPOSITORY: ${{ github.repository }}
GITHUB_RUN_ATTEMPT: ${{ github.run_attempt }}
GITHUB_RUN_ID: ${{ github.run_id }}
GITHUB_RUN_NUMBER: ${{ github.run_number }}
JOB_STATUS: ${{ job.status }}
run: |
if [[ "${{ github.event_name }}" == "pull_request" ]] ;
then
GITHUB_PR_NUMBER="${{ github.event.number }}"
else
GITHUB_PR_NUMBER=0
fi
export GITHUB_PR_NUMBER
scripts/upload_ci_stats.sh
report_status:
name: Regression Linux i386 summary
needs: [check_paths, regress]
if: always()
runs-on: timescaledb-runner-arm64
steps:
- run: |
# If the detector failed, or the matrix failed, exit with error
if [[ "${{ needs.regress.result }}" == "failure" ]]; then
exit 1
fi
echo "All checks passed or were safely skipped."