Skip to content

Commit 7cf4a33

Browse files
authored
Add a CI build to check postgres repository changes. (#702)
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. 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 7cf4a33

File tree

1 file changed

+59
-0
lines changed

1 file changed

+59
-0
lines changed

.github/workflows/build.yml

Lines changed: 59 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,59 @@
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: Create Extension Neon
51+
env:
52+
PGHOST: /tmp
53+
PGDATABASE: postgres
54+
run: |
55+
psql --echo-queries --command 'create extension neon;'
56+
57+
- name: Stop Postgres
58+
run: |
59+
pg_ctl stop --pgdata ./data

0 commit comments

Comments
 (0)