Skip to content

Commit 16cc2a1

Browse files
committed
CI updata 1: percona server for postgresql basic build and test
This action is similar to what we had before, executin tests on Ubuntu 22.04 with both meson and make, all tests passing. The test is refactored to easily support other configurations, but those are not part of this commit yet because of failures. Oters will be added in separate commits with required script/code changes. The commit also contains a compilation / possibly bug fix reported by newer GCC versions
1 parent 9090f12 commit 16cc2a1

File tree

12 files changed

+127
-132
lines changed

12 files changed

+127
-132
lines changed

.github/workflows/postgresql-current-make-debug.yml

Lines changed: 0 additions & 60 deletions
This file was deleted.

.github/workflows/postgresql-current-meson-debug.yml

Lines changed: 0 additions & 68 deletions
This file was deleted.

.github/workflows/psp.yml

Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
name: PSP
2+
on:
3+
pull_request:
4+
workflow_dispatch:
5+
6+
jobs:
7+
build:
8+
name: Percona Postgres
9+
strategy:
10+
matrix:
11+
ubuntu_version: [22]
12+
build_type: [debug,debugoptimized]
13+
build_script: [make, meson]
14+
runs-on: ubuntu-${{ matrix.ubuntu_version }}.04
15+
steps:
16+
17+
- name: Clone repository
18+
uses: actions/checkout@v4
19+
with:
20+
path: 'src'
21+
submodules: recursive
22+
ref: ${{ github.ref }}
23+
24+
- name: Install dependencies
25+
run: src/.scripts/ubuntu-deps.sh
26+
27+
- name: Setup kmip and vault
28+
run: src/.scripts/setup-keyring-servers.sh
29+
30+
- name: Build and test postgres
31+
run: src/.scripts/${{ matrix.build_script }}-build.sh ${{ matrix.build_type }}
32+
33+
- name: Test postgres
34+
run: src/.scripts/${{ matrix.build_script }}-test.sh
35+
36+
- name: Report on test fail
37+
uses: actions/upload-artifact@v4
38+
if: ${{ failure() }}
39+
with:
40+
name: testlog-ubuntu-${{ matrix.ubuntu_version }}.04-meson-${{ matrix.build_type }}
41+
path: |
42+
src/build/testrun/
43+
retention-days: 3

.scripts/make-build.sh

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
#!/bin/bash
2+
3+
SCRIPT_DIR="$( cd -- "$(dirname "$0")" >/dev/null 2>&1 ; pwd -P )"
4+
5+
cd "$SCRIPT_DIR/../"
6+
7+
if [ "$1" = "debugoptimized" ]; then
8+
export CFLAGS="-O2"
9+
export CXXFLAGS="-O2"
10+
fi
11+
12+
./configure --enable-debug --enable-cassert --enable-tap-tests
13+
make

.scripts/make-test.sh

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
#!/bin/bash
2+
3+
SCRIPT_DIR="$( cd -- "$(dirname "$0")" >/dev/null 2>&1 ; pwd -P )"
4+
5+
cd "$SCRIPT_DIR/../"
6+
7+
make check-world

.scripts/meson-build.sh

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
#!/bin/bash
2+
3+
SCRIPT_DIR="$( cd -- "$(dirname "$0")" >/dev/null 2>&1 ; pwd -P )"
4+
5+
cd "$SCRIPT_DIR/../"
6+
7+
meson setup build --prefix `pwd`/../inst --buildtype=$1 -Dcassert=true -Dtap_tests=enabled
8+
cd build && ninja && ninja install

.scripts/meson-test.sh

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
#!/bin/bash
2+
3+
SCRIPT_DIR="$( cd -- "$(dirname "$0")" >/dev/null 2>&1 ; pwd -P )"
4+
5+
cd "$SCRIPT_DIR/../build"
6+
7+
meson test

.scripts/setup-keyring-servers.sh

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
#!/bin/bash
2+
3+
SCRIPT_DIR="$( cd -- "$(dirname "$0")" >/dev/null 2>&1 ; pwd -P )"
4+
5+
cd /tmp
6+
7+
wget https://raw.githubusercontent.com/OpenKMIP/PyKMIP/refs/heads/master/bin/create_certificates.py
8+
python3 create_certificates.py
9+
cat client_certificate_jane_doe.pem >> client_key_jane_doe.pem
10+
11+
mkdir policies
12+
cd policies
13+
wget https://raw.githubusercontent.com/OpenKMIP/PyKMIP/refs/heads/master/examples/policy.json
14+
wget https://raw.githubusercontent.com/OpenKMIP/PyKMIP/refs/heads/master/examples/legacy_policy.json
15+
cd ..
16+
17+
echo $SCRIPT_DIR
18+
pykmip-server -f "$SCRIPT_DIR/../contrib/pg_tde/pykmip-server.conf" -l /tmp/kmip-server.log &
19+
20+
TV=$(mktemp)
21+
{ exec >$TV; vault server -dev; } &
22+
sleep 10
23+
ROOT_TOKEN=$(cat $TV | grep "Root Token" | cut -d ":" -f 2 | xargs echo -n)
24+
echo "ROOT_TOKEN=$ROOT_TOKEN" >> $GITHUB_ENV
25+
echo "Root token: $ROOT_TOKEN"

.scripts/ubuntu-deps.sh

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
#!/bin/bash
2+
3+
sudo apt update
4+
5+
sudo apt install -y libreadline6-dev systemtap-sdt-dev zlib1g-dev libssl-dev libpam0g-dev bison flex libxml2 libxml2-utils libxml2-dev libxslt-dev xsltproc libkrb5-dev libldap2-dev libsystemd-dev gettext tcl-dev libperl-dev pkg-config libselinux1-dev python3-dev uuid-dev liblz4-dev meson ninja-build gpg wget libcurl4-openssl-dev
6+
7+
bash -c "$(wget -O - https://apt.llvm.org/llvm.sh)"
8+
9+
# Perl test dependencies
10+
11+
sudo apt install -y libipc-run-perl python3-pykmip libhttp-server-simple-perl
12+
13+
sudo /usr/bin/perl -MCPAN -e 'install IPC::Run'
14+
sudo /usr/bin/perl -MCPAN -e 'install Text::Trim'
15+
16+
# Vault
17+
wget -O- https://apt.releases.hashicorp.com/gpg | sudo gpg --dearmor -o /usr/share/keyrings/hashicorp-archive-keyring.gpg
18+
echo "deb [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/hashicorp-archive-keyring.gpg] https://apt.releases.hashicorp.com $(lsb_release -cs) main" | sudo tee /etc/apt/sources.list.d/hashicorp.list
19+
sudo apt update && sudo apt install -y vault

contrib/pg_tde/kmip-server.conf

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ certificate_path=/tmp/server_certificate.pem
55
key_path=/tmp/server_key.pem
66
ca_path=/tmp/root_certificate.pem
77
auth_suite=TLS1.2
8-
policy_path=/path/to/policy/file
8+
policy_path=/tmp/policies
99
enable_tls_client_auth=True
1010
tls_cipher_suites=
1111
TLS_RSA_WITH_AES_128_CBC_SHA256

0 commit comments

Comments
 (0)