mirror of
https://github.com/SOCI/soci.git
synced 2026-01-07 05:30:40 -06:00
Launch PostgreSQL database ourselves under macOS
It is installed there but not started by default, so just launch it ourselves. Note that we must not use PGHOST etc variables under Mac, as the server seems to be configured to only listen on the local socket by default, so don't define them globally and do it only for Linux manually instead.
This commit is contained in:
18
.github/workflows/ci.yml
vendored
18
.github/workflows/ci.yml
vendored
@@ -69,10 +69,6 @@ jobs:
|
||||
env:
|
||||
SOCI_CI: true
|
||||
SOCI_CI_BACKEND: ${{ matrix.backend }}
|
||||
PGHOST: localhost
|
||||
PGPORT: 5432
|
||||
PGUSER: postgres
|
||||
PGPASSWORD: Password12!
|
||||
SOCI_MYSQL_ROOT_PASSWORD: root
|
||||
|
||||
steps:
|
||||
@@ -89,6 +85,20 @@ jobs:
|
||||
set_env_var SOCI_CI_BRANCH $GITHUB_REF
|
||||
set_env_var SOCI_SOURCE_DIR $GITHUB_WORKSPACE
|
||||
set_env_var SOCI_SOURCE_DIR `pwd`
|
||||
|
||||
case "${{runner.os}}" in
|
||||
Linux)
|
||||
set_env_var PGHOST localhost
|
||||
set_env_var PGPORT 5432
|
||||
set_env_var PGUSER postgres
|
||||
set_env_var PGPASSWORD 'Password12!'
|
||||
;;
|
||||
|
||||
macOS)
|
||||
set_env_var PGDATA /usr/local/var/postgres
|
||||
;;
|
||||
esac
|
||||
|
||||
if [ "${{matrix.no_boost}}" = true ]; then
|
||||
set_env_var WITH_BOOST OFF
|
||||
fi
|
||||
|
||||
@@ -5,5 +5,11 @@
|
||||
#
|
||||
source ${SOCI_SOURCE_DIR}/scripts/ci/common.sh
|
||||
|
||||
if [ $(uname) = Darwin ]; then
|
||||
pg_ctl start
|
||||
pg_isready --timeout=60
|
||||
createuser --superuser postgres
|
||||
fi
|
||||
|
||||
psql --version
|
||||
psql -c 'create database soci_test;' -U postgres
|
||||
|
||||
Reference in New Issue
Block a user