[FIX] TIKA-Preview does not work on TYPO3 13.4+ #274
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: build | |
on: | |
push: | |
branches: [ 'main', 'release-12.0.x', 'release-11.0.x', 'release-10.0.x' ] | |
tags: | |
- "**" | |
pull_request: | |
branches: [ 'main', 'release-12.0.x', 'release-11.0.x', 'release-10.0.x' ] | |
env: | |
CI_BUILD_DIRECTORY: '/home/runner/work/ext-tika/ext-tika/.Build' | |
TIKA_PATH: '/home/runner/work/ext-tika/ext-tika/.Build/data-tika-binaries' | |
SOLR_IMAGE_TAG: '13.0.x-dev' | |
SOLR_CONTAINER_NAME: 'solrci-container' | |
TESTING_SOLR_PORT: 8983 | |
SOLR_VOLUME_NAME: 'solrci-volume' | |
SOLR_VOLUME_PATH: '/home/runner/work/ext-tika/ext-tika/.Build/data-solr' | |
jobs: | |
test-docs: | |
name: Test docs | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
- name: Test if the documentation will render without warnings | |
run: | | |
mkdir -p Documentation-GENERATED-temp \ | |
&& docker run --rm --pull always -v $(pwd):/project \ | |
ghcr.io/typo3-documentation/render-guides:latest --config=Documentation --no-progress --fail-on-log | |
tests: | |
runs-on: ubuntu-latest | |
strategy: | |
matrix: | |
PHP: [ '8.2', '8.3' ] | |
TYPO3: [ '^13.4', '13.4.x-dev' ] | |
env: | |
typo3DatabaseName: 'typo3_ci' | |
typo3DatabaseHost: '127.0.0.1' | |
typo3DatabaseUsername: 'root' | |
typo3DatabasePassword: 'root' | |
TYPO3_VERSION: ${{ matrix.TYPO3 }} | |
name: TYPO3 ${{ matrix.TYPO3 }} on PHP ${{ matrix.PHP }} | |
steps: | |
# Workaround for issue with actions/checkout@v4 wrong PR commit checkout: See https://github.com/actions/checkout/issues/299#issuecomment-677674415 | |
- | |
name: Checkout current state of Pull Request | |
if: github.event_name == 'pull_request' | |
uses: actions/checkout@v4 | |
with: | |
fetch-depth: 2 | |
ref: ${{ github.event.pull_request.head.sha }} | |
- | |
name: Checkout current state of Branch | |
if: github.event_name == 'push' | |
uses: actions/checkout@v4 | |
with: | |
fetch-depth: 2 | |
# End: Workaround for issue with actions/checkout@v4 wrong PR commit checkout | |
- | |
name: Cache Apache Tika Binaries | |
id: tika-binaries | |
uses: actions/cache@v4 | |
with: | |
path: $TIKA_PATH | |
key: tika-binaries | |
- | |
name: Mount RAMFS | |
run: | | |
sudo mkdir -p ${{ env.CI_BUILD_DIRECTORY }} | |
sudo mount -t tmpfs -o size=2560m 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: pcov | |
tools: composer:v2 | |
- | |
name: 'Start Docker: Solr, Tika, MySQL' | |
run: | | |
docker run --name "MySQL-CI" -v ${{ env.CI_BUILD_DIRECTORY }}/data-mysql:/var/lib/mysql -p 3306:3306 \ | |
-e MYSQL_DATABASE=$typo3DatabaseName \ | |
-e MYSQL_ROOT_PASSWORD=$typo3DatabasePassword \ | |
-d mysql:8.0 mysqld --default-authentication-plugin=mysql_native_password | |
sudo chmod g+w "$SOLR_VOLUME_PATH" | |
docker volume create --name "$SOLR_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 "$SOLR_VOLUME_NAME":"/var/solr" "typo3solr/ext-solr:$SOLR_IMAGE_TAG" | |
docker run -d -p 9998:9998 apache/tika:$(composer tika:req:tika)"-full" | |
docker ps | |
- | |
name: CI-Bootstrap | |
id: 'bootstrap' | |
env: | |
SSH_AUTH_SOCK: /tmp/ssh_agent.sock | |
run: | | |
composer info | |
composer tests:setup | |
echo "Current Size of EXT:tika build Artefacts: " \ | |
&& sudo du -sh "${{ env.CI_BUILD_DIRECTORY }}" | |
- | |
name: 'PHP Lint' | |
id: 'php-lint' | |
if: ${{ always() }} | |
run: | | |
composer tests:lint-php | |
- | |
name: 'Coding standards' | |
id: 'coding-standards' | |
if: ${{ always() }} | |
run: | | |
composer t3:standards:check | |
- | |
name: 'XML Lint' | |
id: 'xml-lint' | |
if: ${{ always() }} | |
run: | | |
composer tests:lint-xml | |
- name: 'PHPStan' | |
id: 'phpstan' | |
if: ${{ always() }} | |
run: | | |
composer tests:phpstan | |
- | |
name: 'Unit tests' | |
id: 'unit-tests' | |
if: ${{ always() }} | |
run: | | |
composer tests:unit | |
- | |
name: 'Integration tests' | |
id: 'integration-tests' | |
if: ${{ always() }} | |
run: | | |
composer tests:integration | |
publish: | |
name: Publish new version to TER | |
needs: tests | |
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@v4 | |
with: | |
ref: ${{ github.event.pull_request.head.sha }} | |
- | |
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 | |
id: get-version | |
run: echo ::set-output name=version::${GITHUB_REF/refs\/tags\//} | |
- | |
name: Get comment | |
id: get-comment | |
run: | | |
readonly local comment=$(git tag -n99 -l ${{ steps.get-version.outputs.version }} | sed "s/^[0-9.]*[ ]*//g") | |
if [[ -z "${comment// }" ]]; then | |
echo ::set-output name=comment::Released version ${{ steps.get-version.outputs.version }} of EXT:tika | |
else | |
echo ::set-output name=comment::$comment | |
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 | |
- | |
name: Publish EXT:tika to TER | |
run: | | |
export RELEASE_VERSION=${GITHUB_REF/refs\/tags\//} | |
export TER_COMMENT=$(git tag -n99 -l "$RELEASE_VERSION" | sed "s/^[0-9.]*[ ]*//g") | |
if [[ -z "${TER_COMMENT// }" ]]; then | |
export TER_COMMENT="Released version $RELEASE_VERSION of EXT:tika" | |
fi | |
echo "Following message will be printed in TER as release description:" | |
echo -e "$TER_COMMENT" | |
php ~/.composer/vendor/bin/tailor ter:publish --comment "$TER_COMMENT" "$RELEASE_VERSION" | |