Skip to content

Commit

Permalink
enable postgres on gha
Browse files Browse the repository at this point in the history
  • Loading branch information
falkenhawk committed Oct 1, 2021
1 parent abfdc0d commit c02174b
Show file tree
Hide file tree
Showing 2 changed files with 28 additions and 0 deletions.
19 changes: 19 additions & 0 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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"

Expand All @@ -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
Expand Down
9 changes: 9 additions & 0 deletions tests/TestConfiguration.ci.php
Original file line number Diff line number Diff line change
Expand Up @@ -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';

0 comments on commit c02174b

Please sign in to comment.