Skip to content

Commit

Permalink
Merge pull request #106 from creative-commoners/pulls/1.15/drop-mysql…
Browse files Browse the repository at this point in the history
…5-cms6

ENH Drop MySQL 5.7 for CMS 6
  • Loading branch information
GuySartorelli authored Aug 28, 2024
2 parents c96920c + b0444a7 commit 67a055a
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 17 deletions.
15 changes: 11 additions & 4 deletions job_creator.php
Original file line number Diff line number Diff line change
Expand Up @@ -132,13 +132,15 @@ public function getInstallerVersion(

public function createJob(int $phpIndex, array $opts): array
{
$cmsMajor = BranchLogic::getCmsMajor($this->repoData, $this->branch, $this->getComposerJsonContent()) ?: MetaData::LOWEST_SUPPORTED_CMS_MAJOR;
$db = in_array($cmsMajor, ['4', '5']) ? DB_MYSQL_57 : DB_MYSQL_80;
$default = [
# ensure there's a default value for all possible return keys
# this allows us to use `if [[ "${{ matrix.key }}" == "true" ]]; then` in gha-ci/ci.yml
'installer_version' => $this->installerVersion,
'php' => $this->getPhpVersion($phpIndex),
'parent_branch' => $this->parentBranch,
'db' => DB_MYSQL_57,
'db' => $db,
'composer_require_extra' => '',
'composer_args' => '',
'composer_install' => false,
Expand Down Expand Up @@ -303,13 +305,13 @@ private function createPhpunitJobs(
'phpunit_suite' => $suite,
]);
} else {
$cmsMajor = BranchLogic::getCmsMajor($this->repoData, $this->branch, $this->getComposerJsonContent()) ?: MetaData::LOWEST_SUPPORTED_CMS_MAJOR;
$matrix['include'][] = $this->createJob(0, [
'composer_args' => '--prefer-lowest',
'db' => DB_MYSQL_57,
'db' => in_array($cmsMajor, ['4', '5']) ? DB_MYSQL_57 : DB_MARIADB,
'phpunit' => true,
'phpunit_suite' => $suite,
]);
$cmsMajor = BranchLogic::getCmsMajor($this->repoData, $this->branch, $this->getComposerJsonContent()) ?: MetaData::LOWEST_SUPPORTED_CMS_MAJOR;
if ($cmsMajor === '4') {
if (!$this->doRunPhpCoverage($run)) {
// this same mysql pdo test is also created for the phpcoverage job, so only add it here if
Expand Down Expand Up @@ -366,7 +368,12 @@ private function generatePhpToDBMap(): array
{
$map = [];
$phpVersions = $this->getListOfPhpVersionsByBranchName();
$dbs = [DB_MARIADB, DB_MYSQL_80];
$cmsMajor = BranchLogic::getCmsMajor($this->repoData, $this->branch, $this->getComposerJsonContent()) ?: MetaData::LOWEST_SUPPORTED_CMS_MAJOR;
if ($cmsMajor === '5') {
$dbs = [DB_MARIADB, DB_MYSQL_80];
} else {
$dbs = [DB_MYSQL_80, DB_MARIADB];
}
foreach ($phpVersions as $key => $phpVersion) {
if (count($phpVersions) < 3) {
$map[$phpVersion] = $dbs[$key];
Expand Down
26 changes: 13 additions & 13 deletions tests/JobCreatorTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -717,7 +717,7 @@ public function provideCreateJson(): array
[
'installer_version' => '6.x-dev',
'php' => '8.3',
'db' => DB_MYSQL_57,
'db' => DB_MARIADB,
'composer_require_extra' => '',
'composer_args' => '--prefer-lowest',
'name_suffix' => '',
Expand All @@ -732,12 +732,12 @@ public function provideCreateJson(): array
'js' => 'false',
'doclinting' => 'false',
'needs_full_setup' => 'true',
'name' => '8.3 prf-low mysql57 phpunit all',
'name' => '8.3 prf-low mariadb phpunit all',
],
[
'installer_version' => '6.x-dev',
'php' => '8.3',
'db' => DB_MARIADB,
'db' => DB_MYSQL_80,
'composer_require_extra' => '',
'composer_args' => '',
'name_suffix' => '',
Expand All @@ -752,7 +752,7 @@ public function provideCreateJson(): array
'js' => 'false',
'doclinting' => 'false',
'needs_full_setup' => 'true',
'name' => '8.3 mariadb phpunit all',
'name' => '8.3 mysql80 phpunit all',
],
]
],
Expand Down Expand Up @@ -1166,7 +1166,7 @@ public function provideCreateJsonForConfig(): array
[
'installer_version' => '',
'php' => '8.3',
'db' => DB_MYSQL_57,
'db' => DB_MARIADB,
'composer_require_extra' => '',
'composer_args' => '--prefer-lowest',
'name_suffix' => '',
Expand All @@ -1181,12 +1181,12 @@ public function provideCreateJsonForConfig(): array
'js' => 'false',
'doclinting' => 'false',
'needs_full_setup' => 'false',
'name' => '8.3 prf-low mysql57 phpunit all',
'name' => '8.3 prf-low mariadb phpunit all',
],
[
'installer_version' => '',
'php' => '8.3',
'db' => DB_MARIADB,
'db' => DB_MYSQL_80,
'composer_require_extra' => '',
'composer_args' => '',
'name_suffix' => '',
Expand All @@ -1201,7 +1201,7 @@ public function provideCreateJsonForConfig(): array
'js' => 'false',
'doclinting' => 'false',
'needs_full_setup' => 'false',
'name' => '8.3 mariadb phpunit all',
'name' => '8.3 mysql80 phpunit all',
],
],
],
Expand Down Expand Up @@ -1708,7 +1708,7 @@ public function provideComposerInstall(): array
'6.x-dev',
'silverstripe-vendormodule',
[
'8.3 mysql57 phpunit all'
'8.3 mysql80 phpunit all'
]
],
'composerinstall_definedphpversion_framework5' => [
Expand Down Expand Up @@ -1757,8 +1757,8 @@ public function provideComposerInstall(): array
'6.x-dev',
'silverstripe-vendormodule',
[
'8.3 prf-low mysql57 phpunit all',
'8.3 mariadb phpunit all',
'8.3 prf-low mariadb phpunit all',
'8.3 mysql80 phpunit all',
]
],
'composerupgrade_definedphpversion_framework5' => [
Expand Down Expand Up @@ -1789,8 +1789,8 @@ public function provideComposerInstall(): array
'6.x-dev',
'silverstripe-theme',
[
'8.3 prf-low mysql57 phpunit all',
'8.3 mariadb phpunit all',
'8.3 prf-low mariadb phpunit all',
'8.3 mysql80 phpunit all',
]
],
'composerupgrade_nophpversion_framework51' => [
Expand Down

0 comments on commit 67a055a

Please sign in to comment.