diff --git a/.github/workflows/phpci.yml b/.github/workflows/phpci.yml new file mode 100644 index 0000000..042f843 --- /dev/null +++ b/.github/workflows/phpci.yml @@ -0,0 +1,174 @@ +name: "PHP-CI" + +on: + push: + pull_request: + schedule: + - cron: "30 6 * * 1" + +env: + PHP_EXTENSIONS: "intl, mbstring, json, zip, curl" + +jobs: + + php-lint: + name: "PHP Lint" + + runs-on: "ubuntu-latest" + + strategy: + matrix: + php-version: + - "7.0" + - "7.1" + - "7.2" + - "7.3" + - "7.4" + + steps: + - + name: "Checkout" + uses: "actions/checkout@v2" + - + name: "Setup PHP" + uses: "shivammathur/setup-php@v2" + with: + php-version: "${{ matrix.php-version }}" + extensions: "${{ env.PHP_EXTENSIONS }}" + - + name: "Validate composer.json and composer.lock" + run: "composer validate --strict" + - + name: "Determine composer cache directory" + id: "determine-composer-cache-directory" + run: "echo \"::set-output name=directory::$(composer config cache-dir)\"" + - + name: "Cache dependencies installed with composer" + uses: "actions/cache@v2.0.0" + with: + path: "${{ steps.determine-composer-cache-directory.outputs.directory }}" + key: "php-${{ matrix.php-version }}-composer-${{ hashFiles('composer.lock') }}" + restore-keys: "php-${{ matrix.php-version }}-composer-" + - + name: "Install composer dependencies" + run: "composer install --no-interaction --no-progress --no-suggest" + - + name: "Run Linter" + run: "composer lint:php" + + php-qs: + name: "PHP QS" + + runs-on: "ubuntu-latest" + + needs: "php-lint" + + strategy: + matrix: + command: + - "test:phpcs" + php-version: + - "7.4" + + steps: + - + name: "Checkout" + uses: "actions/checkout@v2" + - + name: "Setup PHP" + uses: "shivammathur/setup-php@v2" + with: + php-version: "${{ matrix.php-version }}" + extensions: "${{ env.PHP_EXTENSIONS }}" + - + name: "Validate composer.json and composer.lock" + run: "composer validate --strict" + - + name: "Determine composer cache directory" + id: "determine-composer-cache-directory" + run: "echo \"::set-output name=directory::$(composer config cache-dir)\"" + - + name: "Cache dependencies installed with composer" + uses: "actions/cache@v2.0.0" + with: + path: "${{ steps.determine-composer-cache-directory.outputs.directory }}" + key: "php-${{ matrix.php-version }}-composer-${{ hashFiles('composer.lock') }}" + restore-keys: "php-${{ matrix.php-version }}-composer-" + - + name: "Install composer dependencies" + run: "composer install --no-interaction --no-progress --no-suggest" + - + name: "Run command" + run: "composer ${{ matrix.command }}" + + + php-unit: + name: "PHP Unit" + + runs-on: "ubuntu-latest" + + needs: ["php-lint", "php-qs"] + + strategy: + fail-fast: false + matrix: + include: + - + typo3-version: "^8.7" + php-version: "7.0" + - + typo3-version: "^8.7" + php-version: "7.1" + - + typo3-version: "^8.7" + php-version: "7.2" + - + typo3-version: "^8.7" + php-version: "7.3" + - + typo3-version: "^8.7" + php-version: "7.4" + - + typo3-version: "^9.5" + php-version: "7.2" + - + typo3-version: "^9.5" + php-version: "7.3" + - + typo3-version: "^9.5" + php-version: "7.4" + + steps: + - + name: "Checkout" + uses: "actions/checkout@v2" + - + name: "Setup PHP" + uses: "shivammathur/setup-php@v2" + with: + php-version: "${{ matrix.php-version }}" + extensions: "${{ env.PHP_EXTENSIONS }}" + - + name: "Validate composer.json and composer.lock" + run: "composer validate --strict" + - + name: "Determine composer cache directory" + id: "determine-composer-cache-directory" + run: "echo \"::set-output name=directory::$(composer config cache-dir)\"" + - + name: "Cache dependencies installed with composer" + uses: "actions/cache@v2.0.0" + with: + path: "${{ steps.determine-composer-cache-directory.outputs.directory }}" + key: "php-${{ matrix.php-version }}-composer-${{ hashFiles('composer.lock') }}" + restore-keys: "php-${{ matrix.php-version }}-composer-" + - + name: "Install composer dependencies" + run: | + composer remove --no-update typo3/cms typo3/cms-core + composer require typo3/minimal:"${{ matrix.typo3-version }}" + - + name: "Run PHP unit tests" + run: "composer test:phpunit" + + diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml new file mode 100644 index 0000000..e506741 --- /dev/null +++ b/.github/workflows/release.yml @@ -0,0 +1,41 @@ +name: TER release + +on: + push: + tags: + - 'v[0-9]+.[0-9]+.[0-9]+' + +jobs: + release: + name: TYPO3 TER release + + if: startsWith(github.ref, 'refs/tags/') + + runs-on: ubuntu-20.04 + + env: + TYPO3_API_TOKEN: ${{ secrets.TYPO3_API_TOKEN }} + + steps: + - name: Checkout repository + uses: actions/checkout@v2 + + - name: Get version + id: get-version + run: echo ::set-output name=version::$(echo "${{ github.event.ref }}" | cut -d 'v' -f 2) + + - name: Get comment + id: get-comment + run: echo ::set-output name=comment::Released version ${{ steps.get-version.outputs.version }}. Check changelog in documentation on github for more information. + + - name: Setup PHP + uses: shivammathur/setup-php@v2 + with: + php-version: 7.4 + extensions: intl, mbstring, json, zip, curl + + - name: Install tailor + run: composer global require typo3/tailor --prefer-dist --no-progress + + - name: Publish to TER + run: php ~/.composer/vendor/bin/tailor ter:publish --comment "${{ steps.get-comment.outputs.comment }}" ${{ steps.get-version.outputs.version }} diff --git a/.travis.yml b/.travis.yml deleted file mode 100644 index 16176b9..0000000 --- a/.travis.yml +++ /dev/null @@ -1,73 +0,0 @@ -language: php - -sudo: false - -notifications: - email: - recipients: - - dev@dmk-ebusiness.de - on_success: change - on_failure: always - -matrix: - fast_finish: true - include: - - php: 5.6 - env: - - TYPO3_VERSION="typo3/cms=^7.6" - - php: 7.0 - env: - - TYPO3_VERSION="typo3/cms=^7.6" - - php: 7.1 - env: - - TYPO3_VERSION="typo3/cms=^7.6" - - php: 7.2 - env: - - TYPO3_VERSION="typo3/cms=^7.6" - - php: 7.0 - env: - - TYPO3_VERSION="typo3/cms=^8.7" - - php: 7.1 - env: - - TYPO3_VERSION="typo3/cms=^8.7" - - php: 7.2 - env: - - TYPO3_VERSION="typo3/cms=^8.7" - - php: 7.3 - env: - - TYPO3_VERSION="typo3/cms=^8.7" - - php: 7.2 - env: - - TYPO3_VERSION="typo3/minimal=^9.5" - - php: 7.3 - env: - - TYPO3_VERSION="typo3/minimal=^9.5" - - php: 7.2 - env: - - TYPO3_VERSION="typo3/minimal=^10" - - php: 7.3 - env: - - TYPO3_VERSION="typo3/minimal=^10" - allow_failures: - - php: 7.2 - env: - - TYPO3_VERSION="typo3/minimal=^10" - - php: 7.3 - env: - - TYPO3_VERSION="typo3/minimal=^10" - -cache: - directories: - - $HOME/.composer/cache - -before_install: - - composer self-update - - composer --version - -before_script: - - composer require $TYPO3_VERSION - - git checkout composer.json - - export TYPO3_PATH_WEB=$PWD/.Build/Web - -script: - - .Build/bin/phpunit --coverage-text --coverage-clover=coverage.clover diff --git a/README.md b/README.md index c56a1ef..e6923c7 100644 --- a/README.md +++ b/README.md @@ -1,9 +1,9 @@ # README -![TYPO3 compatibility](https://img.shields.io/badge/TYPO3-7.6%20%7C%208.7%20%7C%209.5-orange?maxAge=3600&style=flat-square&logo=typo3) +![TYPO3 compatibility](https://img.shields.io/badge/TYPO3-8.7%20%7C%209.5-orange?maxAge=3600&style=flat-square&logo=typo3) [![Latest Stable Version](https://img.shields.io/packagist/v/dmk/t3twig.svg?maxAge=3600&style=flat-square&logo=composer)](https://packagist.org/packages/dmk/t3twig) [![Total Downloads](https://img.shields.io/packagist/dt/dmk/t3twig.svg?maxAge=3600&style=flat-square)](https://packagist.org/packages/dmk/t3twig) -[![Build Status](https://img.shields.io/travis/DMKEBUSINESSGMBH/typo3-t3twig/master.svg?maxAge=3600&style=flat-square&logo=travis)](https://travis-ci.com/DMKEBUSINESSGMBH/typo3-t3twig) +[![Build Status](https://img.shields.io/github/workflow/status/DMKEBUSINESSGMBH/typo3-t3twig/PHP-CI.svg?maxAge=3600&style=flat-square&logo=github-actions)](https://github.com/DMKEBUSINESSGMBH/typo3-t3twig/actions?query=workflow%3APHP-CI) [![License](https://img.shields.io/packagist/l/dmk/t3twig.svg?maxAge=3600&style=flat-square&logo=gnu)](https://packagist.org/packages/dmk/t3twig) ## t3twig - Twig support for TYPO3 with rn_base plugins diff --git a/composer.json b/composer.json index ee5b4b3..a564acf 100644 --- a/composer.json +++ b/composer.json @@ -27,14 +27,16 @@ } ], "require": { - "typo3/cms-core": "~7.6.16 || ~8.7 || ~9.5", - "digedag/rn-base": ">=1.4", + "typo3/cms-core": "^8.7.32 || ^9.5.24", + "digedag/rn-base": "^1.4.0", "twig/twig": "~1.0" }, "require-dev": { - "nimut/testing-framework": "^2 || ^4", - "phpunit/phpunit": "^5 || ^6", - "mikey179/vfsstream": "^1.6" + "mikey179/vfsstream": "^1.6", + "php-parallel-lint/php-parallel-lint": "^1.2", + "friendsofphp/php-cs-fixer": "^2.16", + "nimut/testing-framework": "^2 || ^4.0 || ^5.0", + "phpunit/phpunit": "^5 || ^6" }, "suggest": { "twig/extensions": "Common additional features for Twig that do not directly belong in core. See @Documentation/reference/extensions/ThirdParty.md" @@ -62,9 +64,42 @@ "typo3/cms": "source" } }, + "scripts": { + "post-autoload-dump": [ + "mkdir -p .Build/Web/typo3conf/ext/", + "[ -L .Build/Web/typo3conf/ext/t3twig ] || ln -snvf ../../../../. .Build/Web/typo3conf/ext/t3twig" + ], + "lint:php": [ + "[ -e .Build/bin/parallel-lint ] || composer update", + ".Build/bin/parallel-lint ./Classes" + ], + "lint": [ + "@lint:php" + ], + "test:phpcs": [ + "[ -e .Build/bin/php-cs-fixer ] || composer update --ansi", + ".Build/bin/php-cs-fixer fix -v --dry-run --diff --ansi" + ], + "test:phpunit": [ + "[ -e .Build/bin/phpunit ] || composer update --ansi", + "export TYPO3_PATH_WEB=$PWD/.Build/Web && .Build/bin/phpunit -c phpunit.xml.dist --colors=always" + ], + "test": [ + "@test:phpcs", + "@test:phpunit" + ], + "fix:phpcs": [ + "[ -e .Build/bin/php-cs-fixer ] || composer update --ansi", + ".Build/bin/php-cs-fixer fix -v" + ], + "fix": [ + "@fix:phpcs" + ] + }, "extra": { "typo3/cms": { "cms-package-dir": "{$vendor-dir}/typo3/cms", + "extension-key": "t3twig", "web-dir": ".Build/Web" } } diff --git a/ext_emconf.php b/ext_emconf.php index 381e8e1..66f8588 100644 --- a/ext_emconf.php +++ b/ext_emconf.php @@ -34,7 +34,7 @@ 'constraints' => [ 'depends' => [ 'rn_base' => '1.4.0-', - 'typo3' => '6.2.10-9.5.99', + 'typo3' => '8.7.32-9.5.99', ], 'conflicts' => [], 'suggests' => []