Skip to content

Commit

Permalink
Drop TYPO3 7 support and add php ci github workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
rengaw83 committed Feb 11, 2021
1 parent 69d19e9 commit c363166
Show file tree
Hide file tree
Showing 6 changed files with 258 additions and 81 deletions.
174 changes: 174 additions & 0 deletions .github/workflows/phpci.yml
Original file line number Diff line number Diff line change
@@ -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"


41 changes: 41 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -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 }}
73 changes: 0 additions & 73 deletions .travis.yml

This file was deleted.

4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -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
Expand Down
45 changes: 40 additions & 5 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down Expand Up @@ -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"
}
}
Expand Down
2 changes: 1 addition & 1 deletion ext_emconf.php
Original file line number Diff line number Diff line change
Expand Up @@ -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' => []
Expand Down

0 comments on commit c363166

Please sign in to comment.