Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Move MySQL testing from Travis to GitHub Actions #49

Merged
merged 4 commits into from
Mar 13, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 17 additions & 0 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,12 +28,29 @@ jobs:
- php: "8.0"
experimental: true

env:
MYSQL_USER: "zftest"
MYSQL_PASSWORD: "zftest"
MYSQL_DATABASE: "zftest"
MYSQL_HOST: "127.0.0.1"

services:
memcache:
image: memcached:1-alpine
ports:
- 11211:11211

mysql:
image: mysql/mysql-server:5.6
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

could we have 5.7?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

sure, I just wanted to test with the lowest version available. ideally should add matrix of supported versions.

ports:
- 3306:3306
env:
MYSQL_USER: "zftest"
MYSQL_PASSWORD: "zftest"
MYSQL_DATABASE: "zftest"
MYSQL_ALLOW_EMPTY_PASSWORD: "1"
options: --health-cmd="mysqladmin ping" --health-interval=5s --health-timeout=2s --health-retries=3

steps:
- name: Checkout Code
uses: actions/checkout@v2
Expand Down
16 changes: 16 additions & 0 deletions tests/TestConfiguration.ci.php
Original file line number Diff line number Diff line change
Expand Up @@ -42,4 +42,20 @@
defined('TESTS_ZEND_CACHE_MEMCACHED_ENABLED') || define('TESTS_ZEND_CACHE_MEMCACHED_ENABLED', true);
defined('TESTS_ZEND_CACHE_LIBMEMCACHED_ENABLED') || define('TESTS_ZEND_CACHE_LIBMEMCACHED_ENABLED', true);

/**
* Zend_Db_Adapter_Pdo_Mysql and Zend_Db_Adapter_Mysqli
*
* There are separate properties to enable tests for the PDO_MYSQL adapter and
* the native Mysqli adapters, but the other properties are shared between the
* two MySQL-related Zend_Db adapters.
*/
// Skip testing ext/mysqli for PHP 5.4/5.5, as the error is not fixable
// https://github.com/zf1s/zf1/pull/49/files#r565875073
defined('TESTS_ZEND_DB_ADAPTER_PDO_MYSQL_ENABLED') || define('TESTS_ZEND_DB_ADAPTER_PDO_MYSQL_ENABLED', true);
defined('TESTS_ZEND_DB_ADAPTER_MYSQLI_ENABLED') || define('TESTS_ZEND_DB_ADAPTER_MYSQLI_ENABLED', !(PHP_VERSION_ID >= 50400 && PHP_VERSION_ID < 50600));
defined('TESTS_ZEND_DB_ADAPTER_MYSQL_HOSTNAME') || define('TESTS_ZEND_DB_ADAPTER_MYSQL_HOSTNAME', getenv('MYSQL_HOST'));
defined('TESTS_ZEND_DB_ADAPTER_MYSQL_USERNAME') || define('TESTS_ZEND_DB_ADAPTER_MYSQL_USERNAME', getenv('MYSQL_USER'));
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'));

require_once dirname(__FILE__) . '/TestConfiguration.dist.php';
6 changes: 4 additions & 2 deletions tests/TestConfiguration.travis.php
Original file line number Diff line number Diff line change
Expand Up @@ -54,8 +54,10 @@
* the native Mysqli adapters, but the other properties are shared between the
* two MySQL-related Zend_Db adapters.
*/
defined('TESTS_ZEND_DB_ADAPTER_PDO_MYSQL_ENABLED') || define('TESTS_ZEND_DB_ADAPTER_PDO_MYSQL_ENABLED', true);
defined('TESTS_ZEND_DB_ADAPTER_MYSQLI_ENABLED') || define('TESTS_ZEND_DB_ADAPTER_MYSQLI_ENABLED', true);
defined('TESTS_ZEND_DB_ADAPTER_PDO_MYSQL_ENABLED') || define('TESTS_ZEND_DB_ADAPTER_PDO_MYSQL_ENABLED', false);
// Testing PDO_MYSQL only for PHP 5.4/5.5, as can't test that on GitHub Actions
// https://github.com/zf1s/zf1/pull/49/files#r565875073
defined('TESTS_ZEND_DB_ADAPTER_MYSQLI_ENABLED') || define('TESTS_ZEND_DB_ADAPTER_MYSQLI_ENABLED', (PHP_VERSION_ID >= 50400 && PHP_VERSION_ID < 50600));
defined('TESTS_ZEND_DB_ADAPTER_MYSQL_USERNAME') || define('TESTS_ZEND_DB_ADAPTER_MYSQL_USERNAME', 'travis');
defined('TESTS_ZEND_DB_ADAPTER_MYSQL_PASSWORD') || define('TESTS_ZEND_DB_ADAPTER_MYSQL_PASSWORD', '');
defined('TESTS_ZEND_DB_ADAPTER_MYSQL_DATABASE') || define('TESTS_ZEND_DB_ADAPTER_MYSQL_DATABASE', 'zftest');
Expand Down