forked from timescale/timescaledb
-
Notifications
You must be signed in to change notification settings - Fork 0
108 lines (96 loc) · 3.7 KB
/
postgres_dev.yaml
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
name: PostgreSQL bleeding edge
on:
pull_request:
jobs:
regress:
name: PG14
runs-on: ubuntu-20.04
env:
PG_SRC_DIR: pgbuild
PG_INSTALL_DIR: postgresql
MAKE_JOBS: 2
# postgres version to build against this can either be commit hash, branch or tag
PG_COMMIT: 1375422
CLANG: clang-9
LLVM_CONFIG: llvm-config-9
CC: gcc
CXX: g++
steps:
- name: Install Linux Dependencies
run: |
sudo apt-get update
sudo apt-get install flex bison lcov systemd-coredump gdb libipc-run-perl libtest-most-perl clang-9 llvm-9 llvm-9-dev llvm-9-tools
# 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
id: cache-postgresql
uses: actions/cache@v2
with:
path: ~/${{ env.PG_SRC_DIR }}
key: ${{ runner.os }}-postgresql-dev-${{ env.PG_COMMIT }}
- name: Build PostgreSQL
if: steps.cache-postgresql.outputs.cache-hit != 'true'
run: |
mkdir -p ~/$PG_SRC_DIR
cd ~/$PG_SRC_DIR
git clone https://github.com/postgres/postgres .
git checkout $PG_COMMIT
./configure --prefix=$HOME/$PG_INSTALL_DIR --enable-debug --enable-cassert --with-llvm --with-openssl --without-readline --without-libxml
make -j $MAKE_JOBS
make -j $MAKE_JOBS -C src/test/isolation
make -j $MAKE_JOBS -C contrib/postgres_fdw
- name: Install PostgreSQL
run: |
make -C ~/$PG_SRC_DIR install
make -C ~/$PG_SRC_DIR/contrib/postgres_fdw install
- name: Checkout TimescaleDB
uses: actions/checkout@v2
- name: Build TimescaleDB
run: |
./bootstrap -DCMAKE_BUILD_TYPE=Debug -DEXPERIMENTAL=ON -DPG_SOURCE_DIR=~/$PG_SRC_DIR -DPG_PATH=~/$PG_INSTALL_DIR -DWARNINGS_AS_ERRORS=OFF
make -C build
make -C build install
# this is more for informational purposes as we don't yet have pg14 test output files and treat them as being the same as PG13
- name: Run tests
run: |
find . -name '*-13.out' | xargs -IFILE bash -c 'cp FILE $(echo FILE| sed -e "s!-13.out!-14.out!")'
make -C build installcheck || true
- name: Show regression diffs
if: always()
id: collectlogs
run: |
find . -name regression.diffs -exec cat {} + > regression.log
find . -name postmaster.log -exec cat {} + > postgres.log
if [[ "${{ runner.os }}" == "Linux" ]] ; then
# wait in case there are in-progress coredumps
sleep 10
if coredumpctl -q list >/dev/null; then echo "::set-output name=coredumps::true"; fi
fi
if [[ -s regression.log ]]; then echo "::set-output name=regression_diff::true"; fi
grep -e 'FAILED' -e 'failed (ignored)' installcheck.log || true
cat regression.log
- name: Save regression diffs
if: always() && steps.collectlogs.outputs.regression_diff == 'true'
uses: actions/upload-artifact@v2
with:
name: Regression diff PG ${{ env.PG_COMMIT }}
path: regression.log
- name: Save postmaster.log
if: always()
uses: actions/upload-artifact@v2
with:
name: PostgreSQL log PG ${{ env.PG_COMMIT }}
path: postgres.log
- name: Stack trace
if: always() && steps.collectlogs.outputs.coredumps == 'true'
run: |
echo "bt full" | sudo coredumpctl gdb
./scripts/bundle_coredumps.sh
false
- name: Coredumps
if: always() && steps.collectlogs.outputs.coredumps == 'true'
uses: actions/upload-artifact@v2
with:
name: Coredumps PG ${{ env.PG_COMMIT }}
path: coredumps