Skip to content

Commit 6f9d6e5

Browse files
committed
OrioleDB specific CI
1 parent c165ad8 commit 6f9d6e5

File tree

11 files changed

+135
-0
lines changed

11 files changed

+135
-0
lines changed

.github/workflows/build.yml

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
name: build
2+
3+
on:
4+
push:
5+
pull_request:
6+
7+
jobs:
8+
test:
9+
runs-on:
10+
- ubuntu-20.04
11+
strategy:
12+
fail-fast: false
13+
matrix:
14+
compiler: [clang, gcc]
15+
check_type: [normal, debug]
16+
env:
17+
LLVM_VER: 10
18+
COMPILER: ${{ matrix.compiler }}
19+
CHECK_TYPE: ${{ matrix.check_type }}
20+
steps:
21+
- name: Checkout code into workspace directory
22+
uses: actions/checkout@v2
23+
- name: Setup prerequisites
24+
run: bash ./ci/prerequisites.sh
25+
- name: Build
26+
run: bash ./ci/build.sh
27+
- name: Check
28+
run: bash ./ci/check.sh
29+
- name: Check output
30+
run: bash ./ci/check_output.sh
31+
if: ${{ success() || failure() }}

ci/build.sh

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
#!/bin/bash
2+
3+
set -eu
4+
5+
if [ $COMPILER = "clang" ]; then
6+
export CC=clang-$LLVM_VER
7+
else
8+
export CC=gcc
9+
fi
10+
11+
# configure & build
12+
if [ $CHECK_TYPE = "debug" ]; then
13+
CFLAGS="-O0" ./configure --enable-debug --enable-cassert --enable-tap-tests --with-icu
14+
else
15+
./configure --disable-debug --disable-cassert --enable-tap-tests --with-icu
16+
fi
17+
18+
make -sj4
19+
cd contrib
20+
make -sj4
21+
cd ..

ci/check.sh

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
#!/bin/bash
2+
3+
set -eu
4+
5+
# unsets limit for coredumps size
6+
ulimit -c unlimited -S
7+
# sets a coredump file pattern
8+
mkdir -p /tmp/cores-$GITHUB_SHA-$TIMESTAMP
9+
sudo sh -c "echo \"/tmp/cores-$GITHUB_SHA-$TIMESTAMP/%t_%p_%s.core\" > /proc/sys/kernel/core_pattern"
10+
11+
make check-world -j4

ci/check_output.sh

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
#!/bin/bash
2+
3+
set -eu
4+
5+
status=0
6+
7+
# show diff if it exists
8+
for f in ` find . -name regression.diffs ` ; do
9+
echo "========= Contents of $f"
10+
cat $f
11+
status=1
12+
done
13+
14+
# check core dumps if any
15+
cores=$(find /tmp/cores-$GITHUB_SHA-$TIMESTAMP/ -name '*.core' 2>/dev/null)
16+
17+
if [ -n "$cores" ]; then
18+
for corefile in $cores ; do
19+
if [[ $corefile != *_3.core ]]; then
20+
binary=$(gdb -quiet -core $corefile -batch -ex 'info auxv' | grep AT_EXECFN | perl -pe "s/^.*\"(.*)\"\$/\$1/g")
21+
echo dumping $corefile for $binary
22+
gdb --batch --quiet -ex "thread apply all bt full" -ex "quit" $binary $corefile
23+
status=1
24+
fi
25+
done
26+
fi
27+
28+
rm -rf /tmp/cores-$GITHUB_SHA-$TIMESTAMP
29+
30+
exit $status

ci/prerequisites.sh

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
#!/bin/bash
2+
3+
set -eu
4+
5+
# print the hostname to be able to identify runner by logs
6+
echo "HOSTNAME=`hostname`"
7+
TIMESTAMP=$(date +%s)
8+
echo "TIMESTAMP=$TIMESTAMP" >> $GITHUB_ENV
9+
echo "TIMESTAMP=$TIMESTAMP"
10+
11+
sudo apt-get -y install -qq wget ca-certificates
12+
13+
sudo apt-get update -qq
14+
15+
apt_packages="build-essential flex bison pkg-config libreadline-dev make gdb libipc-run-perl libicu-dev python3 python3-dev python3-pip python3-setuptools python3-testresources"
16+
17+
if [ $COMPILER = "clang" ]; then
18+
apt_packages="$apt_packages llvm-$LLVM_VER clang-$LLVM_VER clang-tools-$LLVM_VER"
19+
fi
20+
21+
# install required packages
22+
sudo apt-get -o Dpkg::Options::="--force-confdef" -o Dpkg::Options::="--force-confold" -y install -qq $apt_packages

configure

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -628,6 +628,7 @@ ac_includes_default="\
628628
ac_subst_vars='LTLIBOBJS
629629
vpath_build
630630
PG_SYSROOT
631+
ORIOLEDB_PATCHSET_VERSION
631632
PG_VERSION_NUM
632633
LDFLAGS_EX_BE
633634
PROVE
@@ -19479,6 +19480,10 @@ _ACEOF
1947919480

1948019481

1948119482

19483+
# Needed to check postgresql patches git tag during orioledb extension build
19484+
ORIOLEDB_PATCHSET_VERSION=`git describe --tags | cut -d'_' -f2`
19485+
19486+
1948219487
# If we are inserting PG_SYSROOT into CPPFLAGS, do so symbolically not
1948319488
# literally, so that it's possible to override it at build time using
1948419489
# a command like "make ... PG_SYSROOT=path". This has to be done after

configure.ac

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2418,6 +2418,10 @@ $AWK '{printf "%d%04d", $1, $2}'`"]
24182418
AC_DEFINE_UNQUOTED(PG_VERSION_NUM, $PG_VERSION_NUM, [PostgreSQL version as a number])
24192419
AC_SUBST(PG_VERSION_NUM)
24202420

2421+
# Needed to check postgresql patches git tag during orioledb extension build
2422+
[ORIOLEDB_PATCHSET_VERSION=`git describe --tags | cut -d'_' -f2`]
2423+
AC_SUBST(ORIOLEDB_PATCHSET_VERSION)
2424+
24212425
# If we are inserting PG_SYSROOT into CPPFLAGS, do so symbolically not
24222426
# literally, so that it's possible to override it at build time using
24232427
# a command like "make ... PG_SYSROOT=path". This has to be done after

meson.build

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -153,6 +153,7 @@ cdata.set('PG_VERSION_NUM', pg_version_num)
153153
# PG_VERSION_STR is built later, it depends on compiler test results
154154
cdata.set_quoted('CONFIGURE_ARGS', '')
155155

156+
orioledb_patchset_version = '22'
156157

157158

158159
###############################################################

src/Makefile.global.in

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,9 @@ VERSION_NUM = @PG_VERSION_NUM@
4242

4343
PACKAGE_URL = @PACKAGE_URL@
4444

45+
# OrioleDB patchset git tag number
46+
ORIOLEDB_PATCHSET_VERSION = @ORIOLEDB_PATCHSET_VERSION@
47+
4548
# Set top_srcdir, srcdir, and VPATH.
4649
ifdef PGXS
4750
top_srcdir = $(top_builddir)

src/bin/pg_rewind/meson.build

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22

33
pg_rewind_sources = files(
44
'datapagemap.c',
5+
'extension.c',
56
'file_ops.c',
67
'filemap.c',
78
'libpq_source.c',
@@ -23,6 +24,7 @@ pg_rewind = executable('pg_rewind',
2324
pg_rewind_sources,
2425
dependencies: [frontend_code, libpq, lz4, zstd],
2526
c_args: ['-DFRONTEND'], # needed for xlogreader et al
27+
export_dynamic: true,
2628
kwargs: default_bin_args,
2729
)
2830
bin_targets += pg_rewind
@@ -48,3 +50,7 @@ tests += {
4850
}
4951

5052
subdir('po', if_found: libintl)
53+
54+
install_headers(
55+
'pg_rewind_ext.h'
56+
)

0 commit comments

Comments
 (0)