Skip to content

Build pg_probackup

Build pg_probackup #90

Workflow file for this run

name: Test1
on:
push:
branches:
- "**"
pull_request:
branches:
- main
# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:
jobs:
Test:
strategy:
matrix:
pg_version: [15]
# pg_version: [11, 12, 13, 14, 15]
os: [ubuntu-22.04]
tests: [tap, python]
test_mode: [normal, legacy, paranoia]
exclude:
- tests: tap
test_mode: paranoia
- tests: python
test_mode: normal
- tests: python
test_mode: legacy
fail-fast: false
name: ${{ format('Ptrack ({0}, PostgreSQL {1}, {2} tests, {3} mode)', matrix.os, matrix.pg_version, matrix.tests, matrix.test_mode) }}
container:
image: ${{ format('ghcr.io/postgres-dev/{0}:1.0', matrix.os) }}
env:
PG_BRANCH: ${{ format('REL_{0}_STABLE', matrix.pg_version) }}
PREFIX: /home/dev/pgsql
LD_LIBRARY_PATH: /home/dev/pgsql/lib
PGDATA: /home/dev/data
TESTS: ${{ matrix.tests }}
TEST_MODE: ${{ matrix.test_mode }}
options: --privileged
steps:
- name: Get Postgres sources
uses: actions/checkout@v3
with:
repository: postgres/postgres
ref: ${{ format('REL_{0}_STABLE', matrix.pg_version) }}
path: postgres
- name: Get Ptrack sources
uses: actions/checkout@v3
with:
path: ptrack
- name: Get Pg_probackup sources
uses: actions/checkout@v3
with:
repository: postgrespro/pg_probackup
path: pg_probackup
- name: Apply ptrack patches
run: make patch
working-directory: ptrack
- name: Install Postgres
run: |
if [ "$TESTS" = tap -a "$MODE" = legacy ]; then
./configure CFLAGS='-DEXEC_BACKEND' --disable-atomics --prefix=$PREFIX --enable-debug --enable-cassert --enable-depend --enable-tap-tests --quiet
else
./configure --prefix=$PREFIX --enable-debug --enable-cassert --enable-depend --enable-tap-tests
fi &&
make -sj $(nproc) install &&
make -C contrib -sj $(nproc) install &&
echo $PREFIX/bin >> $GITHUB_PATH
working-directory: postgres
- name: Install Ptrack
run: make install USE_PGXS=1
working-directory: ptrack
- name: Install Pg_probackup
run: make install-pg-probackup USE_PGXS=1 PG_CONFIG=$PREFIX/bin/pg_config top_srcdir=../postgres
working-directory: ptrack
# The sources are checked out by the root but ptrack tests need to write
# to the source tree
- name: Change the permissions of the ptrack folder
run: chown "dev:" ptrack
- name: Test
run: make test-${{ matrix.tests }}
working-directory: ptrack
shell: runuser dev {0}
runs-on: ubuntu-latest