From c02174bb4c7e04aa6a3a25feb63f3bd65b23e302 Mon Sep 17 00:00:00 2001 From: Maciej Holyszko <14310995+falkenhawk@users.noreply.github.com> Date: Fri, 1 Oct 2021 14:16:54 +0200 Subject: [PATCH] enable postgres on gha --- .github/workflows/tests.yml | 19 +++++++++++++++++++ tests/TestConfiguration.ci.php | 9 +++++++++ 2 files changed, 28 insertions(+) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 5879e9027..a265d09cc 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -30,6 +30,10 @@ jobs: MYSQL_PASSWORD: "zftest" MYSQL_DATABASE: "zftest" MYSQL_HOST: "127.0.0.1" + POSTGRES_USER: "zftest" + POSTGRES_PASSWORD: "zftest" + POSTGRES_DB: "zftest" + POSTGRES_HOST: "127.0.0.1" # Default locales are: C C.UTF-8 POSIX en_US.utf8 LOCALES: "fr_FR@euro fr_FR fr_BE.UTF-8 de en_US" @@ -50,6 +54,21 @@ jobs: MYSQL_ALLOW_EMPTY_PASSWORD: "1" options: --health-cmd="mysqladmin ping" --health-interval=5s --health-timeout=2s --health-retries=3 + postgres: + image: postgres:12 + ports: + - 5432:5432 + env: + POSTGRES_USER: ${{ env.POSTGRES_USER }} + POSTGRES_PASSWORD: ${{ env.POSTGRES_PASSWORD }} + POSTGRES_DB: ${{ env.POSTGRES_DB }} + # Set health checks to wait until postgres has started + options: >- + --health-cmd pg_isready + --health-interval 10s + --health-timeout 5s + --health-retries 5 + steps: - name: Checkout Code uses: actions/checkout@v2 diff --git a/tests/TestConfiguration.ci.php b/tests/TestConfiguration.ci.php index 279a54ca3..a0b53fb9c 100644 --- a/tests/TestConfiguration.ci.php +++ b/tests/TestConfiguration.ci.php @@ -58,4 +58,13 @@ defined('TESTS_ZEND_DB_ADAPTER_MYSQL_PASSWORD') || define('TESTS_ZEND_DB_ADAPTER_MYSQL_PASSWORD', getenv('MYSQL_PASSWORD')); defined('TESTS_ZEND_DB_ADAPTER_MYSQL_DATABASE') || define('TESTS_ZEND_DB_ADAPTER_MYSQL_DATABASE', getenv('MYSQL_DATABASE')); +/** + * Zend_Db_Adapter_Pdo_Pgsql + */ +defined('TESTS_ZEND_DB_ADAPTER_PDO_PGSQL_ENABLED') || define('TESTS_ZEND_DB_ADAPTER_PDO_PGSQL_ENABLED', true); +defined('TESTS_ZEND_DB_ADAPTER_PDO_PGSQL_HOSTNAME') || define('TESTS_ZEND_DB_ADAPTER_PDO_PGSQL_HOSTNAME', getenv('POSTGRES_HOST')); +defined('TESTS_ZEND_DB_ADAPTER_PDO_PGSQL_USERNAME') || define('TESTS_ZEND_DB_ADAPTER_PDO_PGSQL_USERNAME', getenv('POSTGRES_USER')); +defined('TESTS_ZEND_DB_ADAPTER_PDO_PGSQL_PASSWORD') || define('TESTS_ZEND_DB_ADAPTER_PDO_PGSQL_PASSWORD', getenv('POSTGRES_PASSWORD')); +defined('TESTS_ZEND_DB_ADAPTER_PDO_PGSQL_DATABASE') || define('TESTS_ZEND_DB_ADAPTER_PDO_PGSQL_DATABASE', getenv('POSTGRES_DB')); + require_once dirname(__FILE__) . '/TestConfiguration.dist.php';