mirror of https://github.com/postgres/postgres
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 workflowpull/209/head
parent
b6ccd6c87c
commit
798d897a14
@ -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 |
@ -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 |
Loading…
Reference in new issue