Skip to content

Commit

Permalink
Merge branch 'release/11.0.0'
Browse files Browse the repository at this point in the history
  • Loading branch information
astehlik committed Feb 10, 2024
2 parents 9c08d57 + 6c9b2ff commit ea4430b
Show file tree
Hide file tree
Showing 62 changed files with 971 additions and 1,346 deletions.
15 changes: 15 additions & 0 deletions .github/workflows/composer/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
name: 'composer install'
description: 'Install composer dependencies for testing'
inputs:
php_version:
description: 'PHP version to use'
required: true
runs:
using: "composite"
steps:
- uses: php-actions/composer@v6
with:
php_version: ${{ inputs.php_version }}
php_extensions: zip
- run: sudo chown -R $(id -u):$(id -g) .
shell: bash
54 changes: 54 additions & 0 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
name: publish
on:
push:
tags:
- '*'
jobs:
publish:
name: Publish new version to TER
if: startsWith(github.ref, 'refs/tags/')
runs-on: ubuntu-latest
env:
TYPO3_EXTENSION_KEY: cacheopt
TYPO3_API_TOKEN: ${{ secrets.TYPO3_API_TOKEN }}
steps:
- name: Checkout repository
uses: actions/checkout@v3

- name: Check tag
run: |
if ! [[ ${{ github.ref }} =~ ^refs/tags/v[0-9]{1,3}.[0-9]{1,3}.[0-9]{1,3}$ ]]; then
exit 1
fi
- name: Get version
id: get-version
run: echo "version=${GITHUB_REF/refs\/tags\/v/}" >> $GITHUB_ENV

- name: Get comment
id: get-comment
run: |
git fetch --depth=1 origin +refs/tags/*:refs/tags/*
readonly local comment=$(git tag -l --format='%(contents:subject)' v${{ env.version }} | sed "s/^v[0-9.]*[ ]*//g")
if [[ -z "${comment// }" ]]; then
echo "comment=Released version ${{ env.version }} of ${{ env.TYPO3_EXTENSION_KEY }}" >> $GITHUB_ENV
else
echo "comment=$comment" >> $GITHUB_ENV
fi
- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: 8.2
extensions: intl, mbstring, json, zip, curl
tools: composer:v2

- name: Install tailor
run: composer global require typo3/tailor --prefer-dist --no-progress --no-suggest

- name: Cleanup repository for TER upload
run: touch ready_for_release.txt && bash Build/cleanup_for_ter.sh

- name: Publish to TER
run: php ~/.composer/vendor/bin/tailor ter:publish --comment "${{ env.comment }}" ${{ env.version }}
183 changes: 183 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,183 @@
---
on:
push:
pull_request:
workflow_dispatch:

env:
TYPO3_EXTENSION_KEY: cacheopt
MAIN_PHP_VERSION: 8.2

jobs:
"composer-validate":
name: "Composer validate"
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: ./.github/workflows/composer
with:
php_version: "${{ env.MAIN_PHP_VERSION }}"
- run: |
bash .Build/bin/t3_run_tests.sh -s composerValidate -p ${{ env.MAIN_PHP_VERSION }}
"composer-normalize":
name: "Composer normalize"
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: ./.github/workflows/composer
with:
php_version: "${{ env.MAIN_PHP_VERSION }}"
- run: |
bash .Build/bin/t3_run_tests.sh -s composerNormalize -n -p ${{ env.MAIN_PHP_VERSION }}
"check-codestyle-codesniffer":
name: "PHP code style check"
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: ./.github/workflows/composer
with:
php_version: "${{ env.MAIN_PHP_VERSION }}"
- uses: shivammathur/setup-php@v2
with:
php-version: "${{ env.MAIN_PHP_VERSION }}"
- run: |
bash .Build/bin/t3_check_codestyle.sh PSRCacheopt
"check-codestyle-php-cs-fixer":
name: "PHP code style check"
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: ./.github/workflows/composer
with:
php_version: "8.1"
- run: |
bash .Build/bin/t3_run_tests.sh -s cgl -n -p 8.1
"php-unit-tests":
name: "PHP Unit tests"
strategy:
matrix:
php_version: ["7.4", "8.2"]
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: ./.github/workflows/composer
with:
php_version: ${{ matrix.php_version }}
- run: |
bash .Build/bin/t3_run_tests.sh -s unit -p ${{ matrix.php_version }}
"php-functional-tests-sqlite-82":
name: "Functional tests on SQLite"
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: ./.github/workflows/composer
with:
php_version: "${{ env.MAIN_PHP_VERSION }}"
- run: |
bash .Build/bin/t3_run_tests.sh -s functional -d sqlite -p ${{ env.MAIN_PHP_VERSION }}
"php-functional-tests-mariadb-main":
name: "Functional tests on MariaDB"
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: ./.github/workflows/composer
with:
php_version: ${{ env.MAIN_PHP_VERSION }}
- run: |
bash .Build/bin/t3_run_tests.sh -s functional -p ${{ env.MAIN_PHP_VERSION }}
"php-lint":
name: "PHP linting"
strategy:
matrix:
php_version: ["7.4", "8.0", "8.1", "8.2"]
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: ./.github/workflows/composer
with:
php_version: ${{ matrix.php_version }}
- run: |
bash .Build/bin/t3_run_tests.sh -s lintPhp -p ${{ matrix.php_version }}
"coverage-phpunit":
name: "Test coverage by Unit Tests"
runs-on: ubuntu-latest
if: github.ref == 'refs/heads/develop'
steps:
- uses: actions/checkout@v2
- uses: ./.github/workflows/composer
with:
php_version: ${{ env.MAIN_PHP_VERSION }}
- run: |
bash .Build/bin/t3_run_tests.sh -s unit -p ${{ env.MAIN_PHP_VERSION }} -x -z coverage -e "--coverage-clover Logs/clover-unit.xml --whitelist ../Classes"
- uses: actions/upload-artifact@v3
with:
name: coverage-phpunit
path: .Build/Logs/clover-unit.xml
retention-days: 1

"coverage-functional":
name: "Test coverage by Functional Tests"
runs-on: ubuntu-latest
if: github.ref == 'refs/heads/develop'
steps:
- uses: actions/checkout@v2
- uses: ./.github/workflows/composer
with:
php_version: ${{ env.MAIN_PHP_VERSION }}
- run: |
bash .Build/bin/t3_run_tests.sh -s functional -d mysql -j 5.7 -p ${{ env.MAIN_PHP_VERSION }} -x -z coverage -e "--coverage-clover Logs/clover-functional.xml --whitelist ../Classes"
- uses: actions/upload-artifact@v3
with:
name: coverage-functional
path: .Build/Logs/clover-functional.xml
retention-days: 1

"coverage-upload":
name: Upload coverage report to Code Climage
needs:
- coverage-phpunit
- coverage-functional
runs-on: ubuntu-latest
if: github.ref == 'refs/heads/develop'
env:
CC_TEST_REPORTER_ID: ${{ secrets.CC_TEST_REPORTER_ID }}
steps:
- uses: actions/checkout@v2
- uses: actions/download-artifact@v3
with:
name: coverage-phpunit
- uses: actions/download-artifact@v3
with:
name: coverage-functional
- run: curl -L https://codeclimate.com/downloads/test-reporter/test-reporter-latest-linux-amd64 > ./cc-test-reporter
- run: chmod +x ./cc-test-reporter
- run: ./cc-test-reporter before-build
- run: |
./cc-test-reporter format-coverage -t clover -o clover-unit.json clover-unit.xml
- run: |
./cc-test-reporter format-coverage -t clover -o clover-functional.json clover-functional.xml
- run: |
./cc-test-reporter sum-coverage --parts=2 --output=clover-sum.json clover-unit.json clover-functional.json
- run: |
./cc-test-reporter upload-coverage --input=clover-sum.json
"typo3-scan":
name: "Scan for deprecated and breaking code using typo3scan"
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: ./.github/workflows/composer
with:
php_version: "${{ env.MAIN_PHP_VERSION }}"
- uses: shivammathur/setup-php@v2
with:
php-version: "${{ env.MAIN_PHP_VERSION }}"
- run: php .Build/bin/typo3scan scan --target 11 .
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
.Build
Build/testing-docker/.env
composer.lock
.php-cs-fixer.cache
50 changes: 0 additions & 50 deletions .travis.yml

This file was deleted.

18 changes: 18 additions & 0 deletions Build/cleanup_for_ter.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
#!/bin/bash

set -e

if [ ! -f ready_for_release.txt ]; then
echo "The file ready_for_release.txt does not exists. Make sure you run this script in the right directory!"
exit 1
fi

if [ -d ".git" ]; then
git clean -fdX
fi

rm -Rf .git
rm -Rf .github
rm -Rf Build
rm -f .gitignore
rm ready_for_release.txt
23 changes: 23 additions & 0 deletions Build/php-cs-fixer/config.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
<?php

declare(strict_types=1);

use PhpCsFixer\Config;
use PhpCsFixer\Finder;

if (PHP_SAPI !== 'cli') {
exit('This script supports command line usage only. Please check your command.');
}

$rules = include __DIR__ . '/../../.Build/vendor/de-swebhosting/php-codestyle/PhpCsFixer/Psr12DefaultRules.php';

return (new Config())
->setFinder(
(new Finder())
->ignoreVCSIgnored(true)
->in(realpath(__DIR__ . '/../../'))
->exclude(['.Build'])
->notName(['ext_emconf.php', 'ext_localconf.php', 'ext_tables.php'])
)
->setRiskyAllowed(true)
->setRules($rules);

0 comments on commit ea4430b

Please sign in to comment.