Skip to content

Commit aab9690

Browse files
committed
Add a CI build to check postgres repository changes.
The CI builds Postgres from the source code in this branch installed in the neon vendor/postgres-vXX directory, and then runs the Postgres regression tests and a very simple Neon test that just does CREATE EXTENSION neon. This allows making sure we can still build Neon with the current code in the branch, and load the neon shared library at the server's start-up. We might want to add more commands in contrib/neon/sql/neon.sql for more coverage. Actual neon testing is still maintained in the neon repository, the goal of this CI action is to have a minimum amount of feedback when contributing to the Postgres repository.
1 parent 9b9cb4b commit aab9690

File tree

6 files changed

+77
-0
lines changed

6 files changed

+77
-0
lines changed

.github/workflows/build.yml

Lines changed: 60 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,60 @@
1+
name: Build Postgres
2+
3+
on:
4+
push:
5+
branches:
6+
- REL_16_STABLE_neon
7+
pull_request:
8+
branches:
9+
- REL_16_STABLE_neon
10+
11+
jobs:
12+
build_postgres:
13+
name: Build Postgres
14+
runs-on: ubuntu-latest
15+
steps:
16+
- name: Install Postgres Build Dependencies
17+
run: |
18+
sudo apt-get install build-essential coreutils libreadline-dev zlib1g-dev flex bison libxml2-dev libxslt-dev libssl-dev libxml2-utils xsltproc git
19+
20+
- name: Install Neon Build Dependencies
21+
run: |
22+
sudo apt install libtool libseccomp-dev clang pkg-config cmake postgresql-client protobuf-compiler libprotobuf-dev libcurl4-openssl-dev openssl libicu-dev
23+
24+
- name: Checkout Neon main branch
25+
run: |
26+
git clone https://github.com/neondatabase/neon ./neon
27+
28+
- name: Checkout postgres repository
29+
uses: actions/checkout@v4
30+
with:
31+
path: './neon/vendor/postgres-v16'
32+
33+
- name: Build PostgreSQL and Neon Extension
34+
run: |
35+
make -s -j`nproc` -C ./neon -s neon-pg-ext-v16
36+
37+
- name: Run PostgreSQL Test Suite
38+
run: |
39+
make -s -j`nproc` -C ./neon/build/v16 check
40+
41+
- name: Append Postgres binaries to the PATH
42+
run: |
43+
echo "./neon/pg_install/v16/bin" >> "$GITHUB_PATH"
44+
45+
- name: Start Postgres
46+
run: |
47+
pg_ctl init --pgdata ./data
48+
pg_ctl start --pgdata ./data -o '-c shared_preload_libraries=neon'
49+
50+
- name: Minimal Check for Neon Extension
51+
env:
52+
PGHOST: /tmp
53+
PGDATA: ./data
54+
PG_CONFIG: ./neon/pg_install/v16/bin/pg_config
55+
run: |
56+
make -C ./neon/vendor/postgres-v16/contrib/neon installcheck
57+
58+
- name: Stop Postgres
59+
run: |
60+
pg_ctl stop --pgdata ./data

contrib/neon/Makefile

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
# contrib/neon/Makefile
2+
3+
REGRESS = neon
4+
5+
PG_CONFIG = pg_config
6+
PGXS := $(shell $(PG_CONFIG) --pgxs)
7+
include $(PGXS)

contrib/neon/README.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
This directory is meant to run limited testing on the Neon extension.
2+
3+
The Neon extension is managed separately at
4+
https://github.com/neondatabase/neon, see the CI integration for usage of
5+
this directory.
6+
7+
make installcheck

contrib/neon/expected/neon.out

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
create extension neon;

contrib/neon/results/neon.out

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
create extension neon;

contrib/neon/sql/neon.sql

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
create extension neon;

0 commit comments

Comments
 (0)