Separate Postgres build dir from installation dir.

Previously, Postgres was built in 'tmp_install/build', and installed
into 'tmp_install'. In the CI, the 'build' directory was included in
the final neon.tar.zst artifact that includes all the necessary
binaries. That was unnecessary, the intermediate build results are not
needed, only the final binaries. Separate the build directory so that
the Postgres build happens in 'build', and it is installed into
'tmp_install'. That makes the final neon.tar.zst artifact smaller.

The changes to the python tests are needed to find the 'pg_regress'
binary in the installation directory. Previously, they would use the
'pg_regress' binary from the build directory, not the final
installation location.
This commit is contained in:
Heikki Linnakangas
2022-07-20 15:39:51 +03:00
parent e7c9d66956
commit 1bc18f2cf2
7 changed files with 68 additions and 37 deletions

View File

@@ -31,6 +31,13 @@ inputs:
runs:
using: "composite"
steps:
- name: Checkout
if: inputs.needs_postgres_source == 'true'
uses: actions/checkout@v3
with:
submodules: true
fetch-depth: 1
- name: Get Neon artifact for restoration
uses: actions/download-artifact@v3
with:
@@ -44,12 +51,11 @@ runs:
tar -xf ./neon-artifact/neon.tar.zst -C /tmp/neon/
rm -rf ./neon-artifact/
- name: Checkout
if: inputs.needs_postgres_source == 'true'
uses: actions/checkout@v3
with:
submodules: true
fetch-depth: 1
# Restore the parts of the 'build' directory that were included in the
# tarball. This includes the regression test modules in
# src/test/regress/*.so.
mkdir -p build/
cp -a /tmp/neon/pg_build/* build/
- name: Cache poetry deps
id: cache_poetry

View File

@@ -88,7 +88,9 @@ jobs:
id: cache_pg
uses: actions/cache@v3
with:
path: tmp_install/
path: |
tmp_install/
build/src/test/regress/*.so
key: v1-${{ runner.os }}-${{ matrix.build_type }}-pg-${{ steps.pg_ver.outputs.pg_rev }}-${{ hashFiles('Makefile') }}
- name: Build postgres
@@ -143,7 +145,12 @@ jobs:
fi
- name: Install postgres binaries
run: cp -a tmp_install /tmp/neon/pg_install
run: |
cp -a tmp_install /tmp/neon/pg_install
# Include modules needed by the Postgres regression tests
mkdir -p /tmp/neon/pg_build/src/test/regress
cp -a build/src/test/regress/*.so /tmp/neon/pg_build/src/test/regress
- name: Prepare neon artifact
run: ZSTD_NBTHREADS=0 tar -C /tmp/neon/ -cf ./neon.tar.zst --zstd .