MacOS CI workflows (#104)

* Initial MacOS CI build [skip CI]

* Add debug info [skip ci]

* Temporary disable other CI workflows

* Fix pg install path

* Fix pgsql dir location

* Add icu4c lib to dependencies

* Try to export libicu location

* Try another soulution for libicu

* Fix

* Fix PKG_CONFIG_PATH

* Fix

* Add more env variables

* Debug

* Fix path

* Add openssl dependency

* Add openssl paths

* Add json-c location to tde build step

* Debug

* Debug

* Debug

* Fix lib path

* Revert some changes

* Add one more flag to linker

* Set HOMEBREW_CELLAR env variable

* Try to remove explicit compiler and linker flags

* Rely on brew output rather than on HOMEBREW_CELLAR variable

* Update configure script

* Add PG start step

* Fix

* Fix

* Add tde tests step

* Remove redundant deps installation

* Remove icu4c related flags

* Try with pkg config only

* Remove explicit linker and complier flags

* Debug

* Debug

* Debug

* Try something else

* Use explicit flags instead of pkg-config

* Try fix

* One more try

* Revert to working setup

* Temporary disable workflow

* Add meson build for MacOS

* Fix libicu

* Add missing valut dependency

* Use gnu sed

* Enable first MacOS workflos, some polishing

* Rename workflows

* Update actions

* Enable rest workflows back

* Fix job names

* Apply renaming

* Fix naming in one more workflow
pull/209/head
Artem Gavrilov 2 years ago committed by GitHub
parent b6ccd6c87c
commit 798d897a14
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
  1. 73
      .github/workflows/postgresql-16-src-make-macos.yml
  2. 18
      .github/workflows/postgresql-16-src-make-ssl11.yml
  3. 69
      .github/workflows/postgresql-16-src-meson-macos.yml
  4. 12
      configure
  5. 2
      configure.ac

@ -0,0 +1,73 @@
name: postgresql-16-src-make-macos
on: [pull_request, workflow_dispatch]
jobs:
build:
name: pg-16-src-make-test
runs-on: macos-12
steps:
- name: Install dependencies
run: brew install json-c # All other required deps already installed in this image.
- name: Clone postgres repository
uses: actions/checkout@v4
with:
repository: 'postgres/postgres'
ref: 'a81e5516fa4bc53e332cb35eefe231147c0e1749'
path: 'src'
- name: Clone pg_tde repository
uses: actions/checkout@v4
with:
path: 'src/contrib/pg_tde'
- name: Create pgsql dir
run: mkdir -p $HOME/pgsql
- name: Build postgres
run: |
export LDFLAGS="-L/usr/local/opt/openssl/lib"
export CPPFLAGS="-I/usr/local/opt/openssl/include"
export PKG_CONFIG_PATH="/usr/local/opt/icu4c/lib/pkgconfig"
./configure --with-openssl --enable-tap-tests=no --prefix=$HOME/postgres
make -j
sudo make install
working-directory: src
- name: Build pg_tde
run: |
./configure
make -j
sudo make install
working-directory: src/contrib/pg_tde
- name: Start postgresql cluster with pg_tde
run: |
export PATH="$HOME/postgres/bin:$PATH"
initdb -D $HOME/pgsql/data
echo "shared_preload_libraries = 'pg_tde'" >> \
/$HOME/pgsql/data/postgresql.conf
echo "pg_tde.keyringConfigFile = '/tmp/keyring.json'" >> \
$HOME/pgsql/data/postgresql.conf
cp src/contrib/pg_tde/keyring.json /tmp/keyring.json
pg_ctl -D $HOME/pgsql/data -l logfile start
- name: Test pg_tde
run: |
make installcheck
working-directory: src/contrib/pg_tde
- name: Report on test fail
uses: actions/upload-artifact@v4
if: ${{ failure() }}
with:
name: Regressions diff and postgresql log
path: |
src/contrib/pg_tde/regression.diffs
retention-days: 3
- name: Run debug commands on failure
if: ${{ failure() }}
run: |
env
pwd

@ -37,10 +37,10 @@ jobs:
ref: 'a81e5516fa4bc53e332cb35eefe231147c0e1749'
path: 'src'
- name: Clone postgres-tde-ext repository
- name: Clone pg_tde repository
uses: actions/checkout@v2
with:
path: 'src/contrib/postgres-tde-ext'
path: 'src/contrib/pg_tde'
- name: Create pgsql dir
run: mkdir -p /opt/pgsql
@ -52,12 +52,12 @@ jobs:
sudo make install
working-directory: src
- name: Build postgres-tde-ext
- name: Build pg_tde
run: |
./configure
make -j
sudo make install
working-directory: src/contrib/postgres-tde-ext
working-directory: src/contrib/pg_tde
- name: Start postgresql cluster with pg_tde
run: |
@ -68,13 +68,13 @@ jobs:
/opt/pgsql/data/postgresql.conf
echo "pg_tde.keyringConfigFile = '/tmp/keyring.json'" >> \
/opt/pgsql/data/postgresql.conf
cp src/contrib/postgres-tde-ext/keyring.json /tmp/keyring.json
cp src/contrib/pg_tde/keyring.json /tmp/keyring.json
pg_ctl -D /opt/pgsql/data -l logfile start
- name: Test postgres-tde-ext
- name: Test pg_tde
run: |
make installcheck
working-directory: src/contrib/postgres-tde-ext
working-directory: src/contrib/pg_tde
- name: Report on test fail
uses: actions/upload-artifact@v2
@ -82,11 +82,11 @@ jobs:
with:
name: Regressions diff and postgresql log
path: |
src/contrib/postgres-tde-ext/regression.diffs
src/contrib/pg_tde/regression.diffs
logfile
retention-days: 3
- name: Report on test fail 2
if: ${{ failure() }}
run: |
cat src/contrib/postgres-tde-ext/regression.diffs
cat src/contrib/pg_tde/regression.diffs

@ -0,0 +1,69 @@
name: postgresql-16-src-meson-macos
on: [pull_request, workflow_dispatch]
jobs:
build:
name: pg-16-src-meson-test
runs-on: macos-12
steps:
- name: Install dependencies
run: brew install json-c meson vault gnu-sed # All other required deps already installed in this image.
- name: Clone postgres repository
uses: actions/checkout@v4
with:
repository: 'postgres/postgres'
ref: 'a81e5516fa4bc53e332cb35eefe231147c0e1749'
path: 'src'
- name: Clone pg_tde repository
uses: actions/checkout@v4
with:
path: 'src/contrib/pg_tde'
- name: Include pg_tde in meson build
run: |
echo "subdir('pg_tde')" >> src/contrib/meson.build
- name: Build postgres
run: |
export PKG_CONFIG_PATH="/usr/local/opt/icu4c/lib/pkgconfig"
meson setup build --prefix `pwd`/../inst --buildtype=debug -Dcassert=true
cd build && ninja && ninja install
working-directory: src
- name: Test pg_tde with keyring_file
run: |
cp ../contrib/pg_tde/keyring.json /tmp/keyring.json
meson test --suite setup -v
meson test --suite pg_tde -v --num-processes 1
working-directory: src/build
- name: Test pg_tde with keyring_vault
run: |
TV=$(mktemp)
{ exec >$TV; vault server -dev; } &
sleep 10
ROOT_TOKEN=$(cat $TV | grep "Root Token" | cut -d ":" -f 2 | xargs echo -n)
echo "Root token: $ROOT_TOKEN"
cp ../contrib/pg_tde/keyring-vault.json /tmp/keyring.json
gsed -i "s/ROOT_TOKEN/$ROOT_TOKEN/g" /tmp/keyring.json
cat /tmp/keyring.json
meson test --suite setup -v
meson test --suite pg_tde -v --num-processes 1
working-directory: src/build
- name: Report on test fail
uses: actions/upload-artifact@v4
if: ${{ failure() }}
with:
name: Regressions diff and postgresql log
path: |
src/build/testrun/pg_tde/regress/
retention-days: 3
- name: Run debug commands on failure
if: ${{ failure() }}
run: |
env
pwd

12
configure vendored

@ -2428,13 +2428,13 @@ case $host_os in *\ *) host_os=`echo "$host_os" | sed 's/ /-/g'`;; esac
# REQUIRE_LIB(name,lib,package,testfn,test_include.h)
# REQUIRE_LIB(name,lib,package,testfn,test_header_dir,test_include.h)
# name = The complete name of the library file without the extension.
# lib = The name of the library file without the 'lib' prefix and without the extension.
# package = The name of the package that holds the library
# testfn = One function included in the library that can be used for a test compilation.
# headerdir = directory that contains required header
# header = header file to check for
# headerdir = The directory that contains required header.
# header = The header file to check for
# if there's a problem during the test compilation.
@ -3510,7 +3510,7 @@ fi
then :
case $host_os in
darwin*) libpathx=($HOMEBREW_CELLAR/json-c/*)
darwin*) libpathx=($(brew --cellar)/json-c/*)
tde_CPPFLAGS="$tde_CPPFLAGS -I$libpathx/include/json-c"
tde_LDFLAGS="$tde_LDFLAGS -L$libpathx/lib -ljson-c" ;;
*) tde_CPPFLAGS="$tde_CPPFLAGS -I/usr/include/json-c"
@ -3612,7 +3612,7 @@ fi
then :
case $host_os in
darwin*) libpathx=($HOMEBREW_CELLAR/curl/*)
darwin*) libpathx=($(brew --cellar)/curl/*)
tde_CPPFLAGS="$tde_CPPFLAGS -I$libpathx/include/curl"
tde_LDFLAGS="$tde_LDFLAGS -L$libpathx/lib -lcurl" ;;
*) tde_CPPFLAGS="$tde_CPPFLAGS -I/usr/include/curl"
@ -3717,7 +3717,7 @@ fi
then :
case $host_os in
darwin*) libpathx=($HOMEBREW_CELLAR/gettext/*)
darwin*) libpathx=($(brew --cellar)/gettext/*)
tde_CPPFLAGS="$tde_CPPFLAGS -I$libpathx/include/"
tde_LDFLAGS="$tde_LDFLAGS -L$libpathx/lib -lintl" ;;
*) tde_CPPFLAGS="$tde_CPPFLAGS -I/usr/include/"

@ -18,7 +18,7 @@ AC_DEFUN([REQUIRE_LIB], [ {
AS_IF([test "x$with_$1" == xdefault],
[
case $host_os in
darwin*) libpathx=($HOMEBREW_CELLAR/$3/*)
darwin*) libpathx=($(brew --cellar)/$3/*)
tde_CPPFLAGS="$tde_CPPFLAGS -I$libpathx/include/$5"
tde_LDFLAGS="$tde_LDFLAGS -L$libpathx/lib -l$2" ;;
*) tde_CPPFLAGS="$tde_CPPFLAGS -I/usr/include/$5"

Loading…
Cancel
Save