Skip to content

Commit

Permalink
Merge pull request #184 from dkd-kaehm/task/release-11.0.x_into_main
Browse files Browse the repository at this point in the history
[TASK] Merge release-11.0.x into main
  • Loading branch information
dkd-kaehm committed Jan 30, 2022
2 parents 40458a2 + 7cadcda commit cd588f7
Show file tree
Hide file tree
Showing 64 changed files with 2,248 additions and 1,625 deletions.
44 changes: 42 additions & 2 deletions .editorconfig
@@ -1,9 +1,10 @@
# EditorConfig is awesome: http://EditorConfig.org
# TYPO3 Standard: https://github.com/TYPO3/TYPO3.CMS/blob/master/.editorconfig
# TYPO3 Standard: https://github.com/TYPO3/coding-standards

# top-most EditorConfig file
root = true

# Unix-style newlines with a newline ending every file
[*]
charset = utf-8
end_of_line = lf
Expand All @@ -12,15 +13,54 @@ indent_size = 4
insert_final_newline = true
trim_trailing_whitespace = true

# TS/JS-Files
[*.{ts,js}]
indent_size = 2

# JSON-Files
[*.json]
indent_style = tab

# ReST-Files
[*.rst]
indent_size = 3
indent_size = 4
max_line_length = 80

# YAML-Files
[*.{yaml,yml}]
indent_size = 2

# NEON-Files
[*.neon]
indent_size = 2
indent_style = tab

# package.json
[package.json]
indent_size = 2

# composer.json (Reason: git history in composer.json)
[composer.json]
indent_size = 2

# TypoScript
[*.{typoscript,tsconfig}]
indent_size = 2

# XLF/XML-Files
[*.{xlf,xml}]
indent_style = tab

# SQL-Files
[*.sql]
indent_style = tab
indent_size = 2

# .htaccess
[{_.htaccess,.htaccess}]
indent_style = tab

# Bash scripts
[*.sh]
indent_style = space
indent_size = 2
8 changes: 4 additions & 4 deletions .github/ISSUE_TEMPLATE/bug_report.md
Expand Up @@ -28,11 +28,11 @@ A clear and concise description of what you expected to happen.
If applicable, add screenshots to help explain your problem.

**Used versions (please complete the following information):**
- TYPO3 Version: [e.g. 10.4.20]
- TYPO3 Version: [e.g. 11.5.6]
- Browser: [e.g. chrome, safari]
- EXT:solr Version: [e.g. 11.1.1]
- EXT:tika Version: [e.g. 10.0.0]
- Used Apache Solr Version: [e.g. 8.9.0]
- EXT:solr Version: [e.g. 11.5.1]
- EXT:tika Version: [e.g. 11.0.0]
- Used Apache Solr Version: [e.g. 8.11.1]
- PHP Version: [e.g. 7.4.0]
- MySQL Version: [e.g. 8.0.0]

Expand Down
141 changes: 71 additions & 70 deletions .github/workflows/ci.yml
Expand Up @@ -2,110 +2,108 @@ name: build

on:
push:
branches: [ main, release-10.0.x, release-6.0.x ]
branches: [ 'main', 'release-11.0.x', 'release-10.0.x' ]
tags:
- "**"
pull_request:
branches: [ main, release-10.0.x, release-6.0.x ]
branches: [ 'main', 'release-11.0.x', 'release-10.0.x' ]

env:
TIKA_VERSION: '1.24.1'
TIKA_PATH: /ramfs/data-tika-binaries
EXT_SOLR_VERSION: 'dev-release-11.1.x'
TYPO3_DATABASE_NAME: 'typo3_ci'
TYPO3_DATABASE_HOST: '127.0.0.1'
TYPO3_DATABASE_USERNAME: 'root'
TYPO3_DATABASE_PASSWORD: 'root'
PHP_CS_FIXER_VERSION: '^3.0.2'
CI_BUILD_DIRECTORY: '/home/runner/work/ext-tika/ext-tika/.Build'
TIKA_PATH: '/home/runner/work/ext-tika/ext-tika/.Build/data-tika-binaries'
EXT_SOLR_VERSION: 'dev-release-11.5.x'

LOCAL_IMAGE_NAME: 'solrci-image:latest'
LOCAL_CONTAINER_NAME: 'solrci-container'
SOLR_IMAGE_TAG: 'release-11.5.x'
SOLR_CONTAINER_NAME: 'solrci-container'
TESTING_SOLR_PORT: 8983
LOCAL_SOLR_VOLUME_NAME: 'solrci-volume'
LOCAL_SOLR_VOLUME_PATH: '/ramfs/data-solr'
SOLR_VOLUME_NAME: 'solrci-volume'
SOLR_VOLUME_PATH: '/home/runner/work/ext-tika/ext-tika/.Build/data-solr'

CI_BUILD_DIRECTORY: '/ramfs/data-build'
jobs:
tests:
runs-on: ubuntu-latest
strategy:
matrix:
PHP: [ '7.2', '7.3', '7.4' ]
TYPO3: [ '^10.4', '10.4.x-dev' ]
PHP: [ '7.4', '8.0', '8.1' ]
TYPO3: [ '^11.5', '11.5.x-dev' ]
env:
TYPO3_DATABASE_NAME: 'typo3_ci'
TYPO3_DATABASE_HOST: '127.0.0.1'
TYPO3_DATABASE_USERNAME: 'root'
TYPO3_DATABASE_PASSWORD: 'root'
TYPO3_VERSION: ${{ matrix.TYPO3 }}

name: TYPO3 ${{ matrix.TYPO3 }} on PHP ${{ matrix.PHP }}
steps:
# Workaround for issue with actions/checkout@v2 wrong PR commit checkout: See https://github.com/actions/checkout/issues/299#issuecomment-677674415
- name: Checkout current state of Pull Request
-
name: Checkout current state of Pull Request
if: github.event_name == 'pull_request'
uses: actions/checkout@v2
with:
fetch-depth: 2
ref: ${{ github.event.pull_request.head.sha }}
- name: Checkout current state of Branch
-
name: Checkout current state of Branch
if: github.event_name == 'push'
uses: actions/checkout@v2

- name: Cache Apache Tika Binaries
with:
fetch-depth: 2
# End: Workaround for issue with actions/checkout@v2 wrong PR commit checkout
-
name: Cache Apache Tika Binaries
id: tika-bineries
uses: actions/cache@v2
with:
path: $TIKA_PATH
key: tika-bineries

- name: Mount RAMFS
-
name: Mount RAMFS
run: |
id
sudo mkdir /ramfs
sudo mount -t tmpfs -o size=2048m none /ramfs
sudo mkdir -p /ramfs/data-{solr,mysql,build} && sudo chown $USER /ramfs/data-* && sudo chown 8983:8983 /ramfs/data-solr
- name: Setup PHP
sudo mkdir -p ${{ env.CI_BUILD_DIRECTORY }}
sudo mount -t tmpfs -o size=2048m none ${{ env.CI_BUILD_DIRECTORY }}
sudo mkdir -p ${{ env.CI_BUILD_DIRECTORY }}/data-{solr,mysql,tika-binaries} \
&& sudo chown $USER ${{ env.CI_BUILD_DIRECTORY }}/data-{mysql,tika-binaries} \
&& sudo chown 8983:8983 ${{ env.CI_BUILD_DIRECTORY }}/data-solr
-
name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.PHP }}
coverage: xdebug
tools: composer:v2

- name: CI-Bootstrap
run: |
echo "CI_BUILD_DIRECTORY=$CI_BUILD_DIRECTORY/"
cp -r ../ext-tika $CI_BUILD_DIRECTORY/.
cd $CI_BUILD_DIRECTORY/ext-tika
./Build/Test/bootstrap.sh --skip-solr-install --skip-tika-server-install
echo "Current Size of EXT:tika build Artefacts: " && du -sh $CI_BUILD_DIRECTORY/ext-tika
- name: Build ext-solr docker image
run: |
cd $CI_BUILD_DIRECTORY/ext-tika
docker build -t $LOCAL_IMAGE_NAME -f .Build/Web/typo3conf/ext/solr/Docker/SolrServer/Dockerfile .Build/Web/typo3conf/ext/solr/
- name: 'Start Docker: Solr, Tika, MySQL'
-
name: 'Start Docker: Solr, Tika, MySQL'
run: |
docker run --name "MySQL-CI" -v /ramfs/data-mysql:/var/lib/mysql -p 3306:3306 \
docker run --name "MySQL-CI" -v ${{ env.CI_BUILD_DIRECTORY }}/data-mysql:/var/lib/mysql -p 3306:3306 \
-e MYSQL_DATABASE=$TYPO3_DATABASE_NAME \
-e MYSQL_ROOT_PASSWORD=$TYPO3_DATABASE_PASSWORD \
-d mysql:8.0 mysqld --default-authentication-plugin=mysql_native_password
sudo chmod g+w "$LOCAL_SOLR_VOLUME_PATH"
docker volume create --name "$LOCAL_VOLUME_NAME" --opt type=none --opt device="$LOCAL_SOLR_VOLUME_PATH" --opt o=bind
docker run --rm --name="$LOCAL_CONTAINER_NAME" -d -p 127.0.0.1:8983:8983 -v "$LOCAL_VOLUME_NAME":"/var/solr" "$LOCAL_IMAGE_NAME"
docker run -d -p 9998:9998 apache/tika:$TIKA_VERSION"-full"
sudo chmod g+w "$SOLR_VOLUME_PATH"
docker volume create --name "$LOCAL_VOLUME_NAME" --opt type=none --opt device="$SOLR_VOLUME_PATH" --opt o=bind
docker run --rm --name="$SOLR_CONTAINER_NAME" -d -p 127.0.0.1:8983:8983 -v "$LOCAL_VOLUME_NAME":"/var/solr" "typo3solr/ext-solr:$SOLR_IMAGE_TAG"
docker run -d -p 9998:9998 apache/tika:$(composer tika:version)"-full"
docker ps
- name: CI-Build
-
name: CI-Bootstrap
run: |
composer info
./Build/Test/bootstrap.sh
echo "Current Size of EXT:tika build Artefacts: " \
&& sudo du -sh "${{ env.CI_BUILD_DIRECTORY }}"
-
name: CI-Build
run: |
cd $CI_BUILD_DIRECTORY/ext-tika
./Build/Test/cibuild.sh
echo "Current Size of EXT:tika build Artefacts: " && du -sh $CI_BUILD_DIRECTORY/ && du -sh $CI_BUILD_DIRECTORY/ext-tika/.Build/*
- name: Upload code coverage to Scrutinizer
echo "Current Size of EXT:tika build Artefacts: " \
&& sudo du -sh $CI_BUILD_DIRECTORY/ \
&& sudo du -sh $CI_BUILD_DIRECTORY/*
-
name: Upload code coverage to Scrutinizer
run: |
cd $CI_BUILD_DIRECTORY/ext-tika
mkdir -p $GITHUB_WORKSPACE/bin
wget https://scrutinizer-ci.com/ocular.phar -O $GITHUB_WORKSPACE/bin/ocular && chmod +x $GITHUB_WORKSPACE/bin/ocular
php $GITHUB_WORKSPACE/bin/ocular code-coverage:upload --format=php-clover coverage.unit.clover
php $GITHUB_WORKSPACE/bin/ocular code-coverage:upload --format=php-clover coverage.integration.clover
ocular code-coverage:upload --format=php-clover coverage.unit.clover
ocular code-coverage:upload --format=php-clover coverage.integration.clover
publish:
name: Publish new version to TER
Expand All @@ -116,21 +114,23 @@ jobs:
TYPO3_API_TOKEN: ${{ secrets.TYPO3_API_TOKEN }}

steps:
- name: Checkout repository
-
name: Checkout repository
uses: actions/checkout@v2
with:
ref: ${{ github.event.pull_request.head.sha }}

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

- name: Get comment
-
name: Get comment
id: get-comment
run: |
readonly local comment=$(git tag -n99 -l ${{ steps.get-version.outputs.version }} | sed "s/^[0-9.]*[ ]*//g")
Expand All @@ -139,17 +139,18 @@ jobs:
else
echo ::set-output name=comment::$comment
fi
- name: Setup PHP
-
name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: 7.4
extensions: intl, mbstring, json, zip, curl
tools: composer:v2

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

- name: Publish EXT:tika to TER
-
name: Publish EXT:tika to TER
run: php ~/.composer/vendor/bin/tailor ter:publish --comment "${{ steps.get-comment.outputs.comment }}" ${{ steps.get-version.outputs.version }}


11 changes: 11 additions & 0 deletions .php-cs-fixer.php
@@ -0,0 +1,11 @@
<?php

declare(strict_types=1);

$config = \TYPO3\CodingStandards\CsFixerConfig::create();
$config->getFinder()
->exclude([
'.Build'
])
->in(__DIR__);
return $config;
45 changes: 23 additions & 22 deletions .scrutinizer.yml
Expand Up @@ -12,12 +12,10 @@ tools:
php_cpd:
enabled: true

# we do this on GitHub-Actions via typo3/coding-standards
php_code_sniffer:
enabled: true
config:
standard: TYPO3CMS

# we do this on travis
enabled: false
# we do this on GitHub-Actions via typo3/coding-standards
php_cs_fixer:
enabled: false

Expand All @@ -38,25 +36,28 @@ tools:
timeout: 2400

checks:
php:
excluded_dependencies:
- typo3/cms-install
avoid_superglobals: false
php:
excluded_dependencies:
- typo3/cms-install
avoid_superglobals: false

build_failure_conditions:
- 'patches.label("Doc Comments").count > 10'
- 'patches.label("Spacing").count > 15'
- 'issues.label("coding-style").count > 10'
- 'issues.severity(>= MAJOR).count > 60'
- 'project.metric("scrutinizer.quality", < 8)'
- 'project.metric_change("scrutinizer.test_coverage", < -0.10)'

build:
environment:
# We want to test with the smallest supported by TYPO3 PHP version
php: 7.2
dependencies:
override:
- composer install --dev --no-interaction --no-scripts
# We want to test with the smallest supported TYPO3 PHP version
php:
version: 7.4.27
pecl_extensions:
- zip
nodes:
analysis:
dependencies:
after:
- composer require --dev squizlabs/php_codesniffer:^3.6
# tests:
# override:
# - php-scrutinizer-run
# - command: phpcs-run
# use_website_config: false
tests:
override:
- php-scrutinizer-run

0 comments on commit cd588f7

Please sign in to comment.