diff --git a/.github/workflows/unittests.yml b/.github/workflows/unittests.yml index c91abad..7df1798 100644 --- a/.github/workflows/unittests.yml +++ b/.github/workflows/unittests.yml @@ -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 @@ -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 @@ -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 }} diff --git a/Classes/Domain/Service/GlobFinder.php b/Classes/Domain/Service/GlobFinder.php index 607bccc..f15d487 100644 --- a/Classes/Domain/Service/GlobFinder.php +++ b/Classes/Domain/Service/GlobFinder.php @@ -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); diff --git a/Migrations/Mysql/Version20190930132259.php b/Migrations/Mysql/Version20190930132259.php index 1f97006..2e21251 100644 --- a/Migrations/Mysql/Version20190930132259.php +++ b/Migrations/Mysql/Version20190930132259.php @@ -11,7 +11,7 @@ */ 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".'); @@ -19,7 +19,7 @@ public function up(Schema $schema) $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".'); diff --git a/composer.json b/composer.json index d483d8f..c84bbaf 100644 --- a/composer.json +++ b/composer.json @@ -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": { @@ -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\"" ] } -} +} \ No newline at end of file