Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adding basic github actions which test different build modes #7

Merged
merged 1 commit into from
Aug 23, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
50 changes: 50 additions & 0 deletions .github/workflows/postgresql-16-pgdg-package-pgxs.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
name: postgresql-16-pgdg-package-pgxs
on: [pull_request, workflow_dispatch]

jobs:
build:
name: pg-16-pgdg-package-pgxs-build
runs-on: ubuntu-22.04
steps:
- name: Remove old postgres
run: |
sudo apt-get update
sudo apt purge postgresql-client-common postgresql-common \
postgresql postgresql*
sudo rm -rf /var/lib/postgresql /var/log/postgresql /etc/postgresql \
/usr/lib/postgresql /usr/include/postgresql /usr/share/postgresql \
/etc/postgresql
sudo rm -f /usr/bin/pg_config

- name: Install dependencies
run: |
sudo apt-get install -y libreadline6-dev systemtap-sdt-dev wget \
zlib1g-dev libssl-dev libpam0g-dev bison flex libipc-run-perl
sudo /usr/bin/perl -MCPAN -e 'install IPC::RUN'
sudo /usr/bin/perl -MCPAN -e 'install Text::Trim'

- name: Install PG Distribution Postgresql 16
run: |
sudo sh -c 'echo "deb http://apt.postgresql.org/pub/repos/apt \
$(lsb_release -cs)-pgdg main 16" > /etc/apt/sources.list.d/pgdg.list'
sudo wget --quiet -O - \
https://www.postgresql.org/media/keys/ACCC4CF8.asc |
sudo apt-key add -
sudo apt update
sudo apt -y install postgresql-16 postgresql-server-dev-16

- name: Clone postgres-tde-ext repository
uses: actions/checkout@master
with:
path: 'src/postgres-tde-ext'

- name: Change src owner to postgres
run: |
sudo chmod o+rx ~
sudo chown -R postgres:postgres src

- name: Build postgres-tde-ext
run: |
sudo -u postgres bash -c 'make USE_PGXS=1'
sudo make USE_PGXS=1 install
working-directory: src/postgres-tde-ext
57 changes: 57 additions & 0 deletions .github/workflows/postgresql-16-src-make.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
name: postgresql-16-src-make
on: [pull_request, workflow_dispatch]

jobs:
build:
name: pg-16-src-make-test
runs-on: ubuntu-22.04
steps:


- name: Remove old postgres
run: |
sudo apt purge postgresql-client-common postgresql-common \
postgresql postgresql*
sudo rm -rf /var/lib/postgresql /var/log/postgresql /etc/postgresql \
/usr/lib/postgresql /usr/include/postgresql /usr/share/postgresql \
/etc/postgresql
sudo rm -f /usr/bin/pg_config

- name: Install dependencies
run: |
sudo apt-get update
sudo apt-get install -y libreadline6-dev systemtap-sdt-dev \
zlib1g-dev libssl-dev libpam0g-dev bison flex \
libipc-run-perl -y docbook-xsl docbook-xsl libxml2 libxml2-utils \
libxml2-dev libxslt-dev xsltproc libkrb5-dev libldap2-dev \
libsystemd-dev gettext tcl-dev libperl-dev pkg-config clang-11 \
llvm-11 llvm-11-dev libselinux1-dev python3-dev \
uuid-dev liblz4-dev
sudo /usr/bin/perl -MCPAN -e 'install IPC::RUN'
sudo /usr/bin/perl -MCPAN -e 'install Text::Trim'

- name: Clone postgres repository
uses: actions/checkout@v2
with:
repository: 'postgres/postgres'
ref: 'REL_16_STABLE'
path: 'src'

- name: Clone postgres-tde-ext repository
uses: actions/checkout@v2
with:
path: 'src/contrib/postgres-tde-ext'

- name: Create pgsql dir
run: mkdir -p /opt/pgsql

- name: Build postgres
run: |
./configure --prefix=/usr --with-openssl
make -j
working-directory: src

- name: Build postgres-tde-ext
run: |
make -j
working-directory: src/contrib/postgres-tde-ext
53 changes: 53 additions & 0 deletions .github/workflows/postgresql-16-src-meson.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
name: postgresql-16-src-meson
on: [pull_request, workflow_dispatch]

jobs:
build:
name: pg-16-src-meson-test
runs-on: ubuntu-22.04
steps:


- name: Remove old postgres
run: |
sudo apt purge postgresql-client-common postgresql-common \
postgresql postgresql*
sudo rm -rf /var/lib/postgresql /var/log/postgresql /etc/postgresql \
/usr/lib/postgresql /usr/include/postgresql /usr/share/postgresql \
/etc/postgresql
sudo rm -f /usr/bin/pg_config

- name: Install dependencies
run: |
sudo apt-get update
sudo apt-get install -y libreadline6-dev systemtap-sdt-dev \
zlib1g-dev libssl-dev libpam0g-dev bison flex \
libipc-run-perl -y docbook-xsl docbook-xsl libxml2 libxml2-utils \
libxml2-dev libxslt-dev xsltproc libkrb5-dev libldap2-dev \
libsystemd-dev gettext tcl-dev libperl-dev pkg-config clang-11 \
llvm-11 llvm-11-dev libselinux1-dev python3-dev \
uuid-dev liblz4-dev meson ninja-build
sudo /usr/bin/perl -MCPAN -e 'install IPC::RUN'
sudo /usr/bin/perl -MCPAN -e 'install Text::Trim'

- name: Clone postgres repository
uses: actions/checkout@v2
with:
repository: 'postgres/postgres'
ref: 'REL_16_STABLE'
path: 'src'

- name: Clone postgres-tde-ext repository
uses: actions/checkout@v2
with:
path: 'src/contrib/postgres-tde-ext'

- name: Include postgres-tde-ext in meson build
run: |
echo "subdir('postgres-tde-ext')" >> src/contrib/meson.build

- name: Build postgres
run: |
meson setup build
cd build && ninja
working-directory: src
2 changes: 1 addition & 1 deletion src/access/pg_tde_io.c
Original file line number Diff line number Diff line change
Expand Up @@ -325,7 +325,7 @@ RelationAddBlocks(Relation relation, BulkInsertState bistate,
* [auto]vacuum trying to truncate later pages as REL_TRUNCATE_MINIMUM is
* way larger.
*/
first_block = ExtendBufferedRelBy(EB_REL(relation), MAIN_FORKNUM,
first_block = ExtendBufferedRelBy(BMR_REL(relation), MAIN_FORKNUM,
bistate ? bistate->strategy : NULL,
EB_LOCK_FIRST,
extend_by_pages,
Expand Down
2 changes: 1 addition & 1 deletion src/access/pg_tde_visibilitymap.c
Original file line number Diff line number Diff line change
Expand Up @@ -631,7 +631,7 @@ vm_extend(Relation rel, BlockNumber vm_nblocks)
{
Buffer buf;

buf = ExtendBufferedRelTo(EB_REL(rel), VISIBILITYMAP_FORKNUM, NULL,
buf = ExtendBufferedRelTo(BMR_REL(rel), VISIBILITYMAP_FORKNUM, NULL,
EB_CREATE_FORK_IF_NEEDED |
EB_CLEAR_SIZE_CACHE,
vm_nblocks,
Expand Down