Install PostgreSQL ourselves in macOS CI workflow

It used to be part of macos-12 image but is not present in the later
ones for whatever reason.

Installing postgresql formula using brew already initializes the
database cluster but does it in a non-default directory, so adjust
PGDATA definition accordingly and remove "pg_ctl init" which is not
needed any longer.
This commit is contained in:
Vadim Zeitlin
2024-10-10 18:43:21 +02:00
parent 214fae86e0
commit 698495c33b
3 changed files with 15 additions and 4 deletions
+2 -3
View File
@@ -116,7 +116,7 @@ jobs:
;;
macOS)
set_env_var PGDATA /usr/local/var/postgres
set_env_var PGDATA /opt/homebrew/var/postgresql@14
;;
esac
@@ -141,8 +141,7 @@ jobs:
set_env_var BUILD_EXAMPLES YES
fi
- name: Install dependencies under Linux
if: runner.os == 'Linux'
- name: Install dependencies
run: ./scripts/ci/install.sh
- name: Prepare for build
-1
View File
@@ -13,7 +13,6 @@ case "$(uname)" in
;;
Darwin)
pg_ctl init
pg_ctl start
pg_isready --timeout=60
createuser --superuser postgres
+13
View File
@@ -52,6 +52,19 @@ case "$(uname)" in
FreeBSD)
pkg install -q -y bash cmake
;;
Darwin)
case "${SOCI_CI_BACKEND}" in
postgresql)
brew install postgresql
;;
esac
;;
*)
echo "Unknown platform: $(uname)"
exit 1
;;
esac
install_script="${SOCI_SOURCE_DIR}/scripts/ci/install_${SOCI_CI_BACKEND}.sh"