-
Notifications
You must be signed in to change notification settings - Fork 0
62 lines (56 loc) · 2 KB
/
build_and_test.yml
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
name: pg_stringtheory Build and Test
on:
push:
paths:
- '.github/**'
- 'src/**'
- 'expected/**'
- 'sql/**'
- '*.control'
- '*.sql'
- Makefile
jobs:
build-and-test:
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest]
version: [REL_14_STABLE, REL_15_STABLE, REL_16_STABLE]
runs-on: ${{ matrix.os }}
steps:
- name: Test details
run: echo Build and test pg_stringtheory on ${{ matrix.os }} with PostgreSQL ${{ matrix.version }} branch
- name: Checkout and build PostgreSQL code
run: |
sudo apt-get update -qq
sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys E298A3A825C0D65DFD57CBB651716619E084DAB9
sudo apt-get install -y build-essential libreadline-dev zlib1g-dev flex bison libxml2-dev libxslt-dev libssl-dev libxml2-utils xsltproc ccache pkg-config libc++-dev libc++abi-dev libglib2.0-dev libtinfo5 cmake libstdc++-12-dev
rm -rf postgres
git clone --branch ${{ matrix.version }} --single-branch --depth 1 https://github.com/postgres/postgres.git
pushd postgres
git branch
./configure --prefix=$PWD/inst/ --enable-cassert --enable-debug --with-openssl
make -j4 install
- name: Start Postgres
run: |
pushd postgres
cd inst/bin
./initdb -D data
./pg_ctl -D data -l logfile start
popd
- name: Checkout pg_stringtheory extension code
uses: actions/checkout@v4
with:
path: stringtheory
- name: Build and test pg_stringtheory extension
id: regression-tests
run: |
export PATH="${PWD}/postgres/inst/bin:$PATH"
pushd stringtheory
make install
make installcheck
popd
- name: Print regression.diffs if regression tests failed
if: failure() && steps.regression-tests.outcome != 'success'
run: |
cat stringtheory/regression.diffs