Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[TASK] Drop PHP 7.2 + 7.3 support #11

Merged
merged 2 commits into from
Oct 27, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
72 changes: 72 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,72 @@
# EditorConfig is awesome: http://EditorConfig.org
# 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
indent_style = space
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,rst.txt}]
indent_size = 3
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
indent_style = space

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

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

# HTML-Files
[*.html]
indent_size = 2
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
7 changes: 7 additions & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
/.editorconfig export-ignore
/.gitattributes export-ignore
/.github export-ignore
/.gitignore export-ignore
/Build export-ignore
/example.png export-ignore
/Tests export-ignore
53 changes: 16 additions & 37 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,34 +8,28 @@ on:
pull_request:
branches: [ main ]

env:
PHP_CS_FIXER_VERSION: '^3.0.2'
CI_BUILD_DIRECTORY: '/ramfs/data-build'
jobs:
tests:
runs-on: ubuntu-latest
strategy:
matrix:
PHP: [ '7.2', '7.3', '7.4', '8.0' ]
PHP: [ '7.4', '8.0', '8.1', '8.2', '8.3' ]

name: 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
# Workaround for issue with actions/checkout "wrong PR commit checkout":
# See:
# ** https://github.com/actions/checkout/issues/299#issuecomment-677674415
# ** https://github.com/actions/checkout/issues/1359#issuecomment-1631503791
- name: Checkout current state of Pull Request
if: github.event_name == 'pull_request'
uses: actions/checkout@v2
uses: actions/checkout@v3
with:
ref: ${{ github.event.pull_request.head.sha }}
- name: Checkout current state of Branch
if: github.event_name == 'push'
uses: actions/checkout@v2

- name: Mount RAMFS
run: |
id
sudo mkdir /ramfs
sudo mount -t tmpfs -o size=2048m none /ramfs
sudo mkdir -p /ramfs/data-build && sudo chown $USER /ramfs/data-*
uses: actions/checkout@v3
# End: Workaround for issue with actions/checkout...

- name: Setup PHP
uses: shivammathur/setup-php@v2
Expand All @@ -44,46 +38,31 @@ jobs:
coverage: pcov
tools: composer:v2

- name: CI-Bootstrap
- name: Tests setup
run: |
echo "CI_BUILD_DIRECTORY=$CI_BUILD_DIRECTORY/"
cp -r ../php-solr-explain $CI_BUILD_DIRECTORY/.
cd $CI_BUILD_DIRECTORY/php-solr-explain
./Build/Test/bootstrap.sh
echo "Current Size of php-solr-explain build Artefacts: " && du -sh $CI_BUILD_DIRECTORY/php-solr-explain
composer tests:setup

- name: CI-Build
- name: Unit Tests
run: |
cd $CI_BUILD_DIRECTORY/php-solr-explain
./Build/Test/cibuild.sh
echo "Current Size of php-solr-explain build Artefacts: " && du -sh $CI_BUILD_DIRECTORY/ && du -sh $CI_BUILD_DIRECTORY/php-solr-explain/.Build/*

# - name: Upload code coverage to Scrutinizer
# run: |
# cd $CI_BUILD_DIRECTORY/php-solr-explain
# 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
composer tests:unit -- --coverage-text

publish:
name: Publish PHAR file on Release
needs: tests
if: startsWith(github.ref, 'refs/tags/')
runs-on: ubuntu-20.04
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v2
with:
ref: ${{ github.event.pull_request.head.sha }}
uses: actions/checkout@v3

# Build PHAR
- name: Build PHAR
run: |
./Build/phar.sh
composer build:phar

- name: Upload PHAR on release
uses: softprops/action-gh-release@v1
if: startsWith(github.ref, 'refs/tags/')
with:
files: |
../php-solr-explain.phar
.Build/bin/php-solr-explain.phar
12 changes: 0 additions & 12 deletions Build/Test/bootstrap.sh

This file was deleted.

10 changes: 0 additions & 10 deletions Build/Test/cibuild.sh

This file was deleted.

23 changes: 15 additions & 8 deletions Build/phar.sh
Original file line number Diff line number Diff line change
@@ -1,12 +1,19 @@
#!/usr/bin/env bash

SCRIPT_PATH=$( cd $(dirname "${BASH_SOURCE[0]}"); pwd -P )
ROOT_PATH="$SCRIPT_PATH/../"
PHAR_BUILD_PATH="/tmp/php-solr-explain"
PHAR_COMPOSER_BINARY="/tmp/phar-composer"

cd "$ROOT_PATH"
rm -fR .Build
composer install --no-dev
if [[ ! -f $PHAR_COMPOSER_BINARY ]]; then
wget https://github.com/clue/phar-composer/releases/download/v1.4.0/phar-composer-1.4.0.phar -O $PHAR_COMPOSER_BINARY
chmod +x $PHAR_COMPOSER_BINARY
fi

cd ..
wget https://github.com/clue/phar-composer/releases/download/v1.2.0/phar-composer-1.2.0.phar -O phar-composer
php phar-composer build "$ROOT_PATH/../php-solr-explain"
rm -Rf $PHAR_BUILD_PATH
mkdir $PHAR_BUILD_PATH
git archive --format=tar --prefix=php-solr-explain/ HEAD | (cd "/tmp" && tar xf -)
composer install --no-dev --working-dir=$PHAR_BUILD_PATH

mkdir -p ".Build/bin"
/tmp/phar-composer build $PHAR_BUILD_PATH ".Build/bin/php-solr-explain.phar"

rm -Rf $PHAR_COMPOSER_BINARY $PHAR_BUILD_PATH
Loading