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

!!! FEATURE: Add Support for Neos 7 and 8 #11

Merged
merged 2 commits into from
May 23, 2022
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
47 changes: 24 additions & 23 deletions .github/workflows/unittests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,25 +4,19 @@ on: [push, pull_request]

jobs:
unittests:
name: '[PHP ${{ matrix.php-versions }} | Flow ${{ matrix.flow-versions }}] Unit Tests'
name: '[PHP ${{ matrix.php-version }} | Flow ${{ matrix.flow-version }}] Unit Tests'
runs-on: ubuntu-latest
# services:
# mariadb:
# image: mariadb:10.2
# env:
# MYSQL_USER: neos
# MYSQL_PASSWORD: neos
# MYSQL_DATABASE: flow_functional_testing
# MYSQL_ROOT_PASSWORD: neos
# ports:
# - 3306/tcp
# options: --health-cmd="mysqladmin ping" --health-interval=10s --health-timeout=5s --health-retries=3

strategy:
fail-fast: false
matrix:
php-versions: [7.2, 7.3, 7.4]
flow-versions: [5.3, 6.3]
php-version: [7.4, 8.0, 8.1]
flow-version: [7.3, 8.0]

exclude:
# Disable Flow 8.0 on PHP 7, as 8.0 is required
- php-version: 7.4
flow-version: 8.0

env:
FLOW_CONTEXT: Testing/Unit
Expand All @@ -31,21 +25,28 @@ jobs:
steps:
- uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php-versions }}
extensions: mbstring, xml, json, zlib, iconv, intl, pdo_sqlite, mysql
php-version: ${{ matrix.php-version }}
extensions: mbstring, xml, json, zlib, iconv, intl, pdo_sqlite
ini-values: opcache.fast_shutdown=0

- name: Cache composer dependencies
- name: "[1/4] Create composer project - Cache composer dependencies"
uses: actions/cache@v1
with:
path: ~/.composer/cache
key: php-${{ matrix.php-versions }}-flow-${{ matrix.flow-versions }}-composer-${{ hashFiles('composer.json') }}
key: php-${{ matrix.php-version }}-flow-${{ matrix.flow-version }}-composer-${{ hashFiles('composer.json') }}
restore-keys: |
php-${{ matrix.php-versions }}-flow-${{ matrix.flow-versions }}-composer-
php-${{ matrix.php-versions }}-flow-
php-${{ matrix.php-version }}-flow-${{ matrix.flow-version }}-composer-
php-${{ matrix.php-version }}-flow-
- name: "[2/4] Create composer project - No install"
run: composer create-project neos/flow-base-distribution ${{ env.FLOW_DIST_FOLDER }} --prefer-dist --no-progress --no-install "^${{ matrix.flow-version }}"

- name: "[3/4] Create composer project - Require behat in compatible version"
run: composer require --dev --no-update "neos/behat:@dev"
working-directory: ${{ env.FLOW_DIST_FOLDER }}

- name: Install composer dependencies
run: composer create-project neos/flow-base-distribution ${{ env.FLOW_DIST_FOLDER }} --prefer-dist --no-progress "^${{ matrix.flow-versions }}"
- name: "[4/4] Create composer project - Install project"
run: composer install
working-directory: ${{ env.FLOW_DIST_FOLDER }}

- name: Checkout code
uses: actions/checkout@v2
Expand All @@ -57,5 +58,5 @@ jobs:
working-directory: ${{ env.FLOW_DIST_FOLDER }}

- name: Run tests
run: bin/phpunit -c DistributionPackages/Netlogix.Migrations/phpunit.xml.dist --bootstrap "Build/BuildEssentials/PhpUnit/UnitTestBootstrap.php"
run: bin/phpunit -c DistributionPackages/Netlogix.Migrations/phpunit.xml.dist --testsuite="Unit" --bootstrap "Build/BuildEssentials/PhpUnit/UnitTestBootstrap.php"
working-directory: ${{ env.FLOW_DIST_FOLDER }}
6 changes: 3 additions & 3 deletions Classes/Domain/Service/GlobFinder.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,12 @@

namespace Netlogix\Migrations\Domain\Service;

use Doctrine\DBAL\Migrations\Finder\AbstractFinder;
use Doctrine\Migrations\Finder\Finder;

final class GlobFinder extends AbstractFinder
final class GlobFinder extends Finder
{

public function findMigrations($directory, $namespace = null)
public function findMigrations(string $directory, ?string $namespace = null): array
{
$dir = $this->getRealPath($directory);

Expand Down
4 changes: 2 additions & 2 deletions Migrations/Mysql/Version20190930132259.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,15 +11,15 @@
*/
class Version20190930132259 extends AbstractMigration
{
public function up(Schema $schema)
public function up(Schema $schema): void
{
// this up() migration is autogenerated, please modify it to your needs
$this->abortIf($this->connection->getDatabasePlatform()->getName() != 'mysql', 'Migration can only be executed safely on "mysql".');

$this->addSql('CREATE TABLE netlogix_migrationstatus (version VARCHAR(255) NOT NULL, PRIMARY KEY(version)) DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci ENGINE = InnoDB');
}

public function down(Schema $schema)
public function down(Schema $schema): void
{
// this down() migration is autogenerated, please modify it to your needs
$this->abortIf($this->connection->getDatabasePlatform()->getName() != 'mysql', 'Migration can only be executed safely on "mysql".');
Expand Down
37 changes: 31 additions & 6 deletions composer.json
Original file line number Diff line number Diff line change
@@ -1,12 +1,15 @@
{
"description": "Custom migrations",
"homepage": "http://websolutions.netlogix.de/",
"license": ["MIT"],
"license": [
"MIT"
],
"name": "netlogix/migrations",
"type": "neos-package",
"require": {
"php": "^7.2 || ^7.3 || ^7.4 || ^8.0",
"neos/flow": "^5.0 || ^6.0"
"php": "^7.4 || ~8.0 || ~8.1",
"neos/flow": "^7.3 || ^8.0",
"doctrine/migrations": "^3.1"
},
"autoload": {
"psr-4": {
Expand All @@ -21,11 +24,33 @@
"extra": {
"neos": {
"package-key": "Netlogix.Migrations"
}
},
"applied-flow-migrations": [
"TYPO3.Form-20160601101500",
"Neos.Twitter.Bootstrap-20161124204912",
"Neos.Form-20161124205254",
"Neos.Party-20161124225257",
"Neos.Kickstart-20161124230102",
"Neos.Imagine-20161124231742",
"Neos.Kickstarter-20161125110814",
"Neos.SwiftMailer-20161130105617",
"Neos.ContentRepository.Search-20161210231100",
"Neos.Seo-20170127154600",
"Neos.Flow-20180415105700",
"Neos.Neos-20180907103800",
"Neos.Neos.Ui-20190319094900",
"Neos.Flow-20190425144900",
"Neos.Flow-20190515215000",
"Neos.Flow-20200813181400",
"Neos.Flow-20201003165200",
"Neos.Flow-20201109224100",
"Neos.Flow-20201205172733",
"Neos.Flow-20201207104500"
]
},
"scripts": {
"unit-tests": [
"FLOW_CONTEXT=Testing/Unit bin/phpunit -c PhpUnit.xml --bootstrap \"Build/BuildEssentials/PhpUnit/UnitTestBootstrap.php\""
"FLOW_CONTEXT=Testing/Unit bin/phpunit -c phpunit.xml.dist --bootstrap \"Build/BuildEssentials/PhpUnit/UnitTestBootstrap.php\""
]
}
}
}