diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 4dd7a50f..5e0f89ba 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -43,8 +43,11 @@ env: jobs: test-current-versions: - name: Tests - Current + name: Tests runs-on: ubuntu-latest + strategy: + matrix: + ext-parallel: [ '', 'parallel' ] steps: - name: Checkout code uses: actions/checkout@v4 @@ -53,10 +56,13 @@ jobs: - name: Setup PHP uses: shivammathur/setup-php@v2 + id: setup-php with: php-version: 8.3 coverage: xdebug - extensions: ast + extensions: ast, ${{ matrix.ext-parallel }} + env: + phpts: zts - name: Build project run: make build --no-print-directory diff --git a/.phan.php b/.phan.php index bb249315..e767a30b 100644 --- a/.phan.php +++ b/.phan.php @@ -23,14 +23,17 @@ 'directory_list' => [ 'src', - 'vendor/jbzoo/ci-report-converter/src', - 'vendor/jbzoo/cli/src', 'vendor/jbzoo/data/src', + 'vendor/jbzoo/cli/src', 'vendor/jbzoo/utils/src', - 'vendor/league/csv/src', + 'vendor/jbzoo/ci-report-converter/src', + 'vendor/symfony/console', 'vendor/symfony/finder', + + 'vendor/league/csv/src', 'vendor/markrogoyski/math-php/src', 'vendor/respect/validation', + 'vendor/hds-solutions/parallel-sdk', ], ]); diff --git a/Dockerfile b/Dockerfile index e5cd65d4..2a32d95e 100644 --- a/Dockerfile +++ b/Dockerfile @@ -17,11 +17,11 @@ COPY . /tmp RUN make build-version ######################################################################################## -FROM php:8.3-cli-alpine +FROM php:8.3-zts-alpine # Install PHP extensions ADD --chmod=0755 https://github.com/mlocati/docker-php-extension-installer/releases/latest/download/install-php-extensions /usr/local/bin/ -RUN install-php-extensions opcache @composer +RUN install-php-extensions opcache parallel @composer # Install application # run `make build-version` before! diff --git a/composer.json b/composer.json index 39305c66..f8a1b4d8 100644 --- a/composer.json +++ b/composer.json @@ -1,6 +1,6 @@ { "name" : "jbzoo/csv-blueprint", - "type" : "project", + "type" : "project", "description" : "CLI Utility for Validating and Generating CSV Files Based on Custom Rules. It ensures your data meets specified criteria, streamlining data management and integrity checks.", "license" : "MIT", "keywords" : [ @@ -28,9 +28,7 @@ "require" : { "php" : "^8.1", - "ext-mbstring" : "*", - "league/csv" : "^9.15.0", "jbzoo/data" : "^7.1.1", "jbzoo/cli" : "^7.2.2", "jbzoo/utils" : "^7.2.1", @@ -39,11 +37,14 @@ "symfony/yaml" : ">=6.4.3", "symfony/filesystem" : ">=6.4.3", "symfony/finder" : ">=6.4.0", + "symfony/polyfill-mbstring" : "^1.29.0", + + "league/csv" : "^9.15.0", "markrogoyski/math-php" : "^2.9.0", "respect/validation" : "^2.3.6", "giggsey/libphonenumber-for-php-lite" : "^8.13.33", "giggsey/locale" : "^2.5", - "symfony/polyfill-mbstring" : "^1.29.0" + "hds-solutions/parallel-sdk" : "^2.1.4" }, "require-dev" : { @@ -53,6 +54,10 @@ "fakerphp/faker" : "^1.23.1" }, + "suggest" : { + "ext-parallel" : "Parallel processing of CSV files for better performance" + }, + "bin" : ["csv-blueprint"], "autoload" : { diff --git a/composer.lock b/composer.lock index 4009a556..5fa0db8a 100644 --- a/composer.lock +++ b/composer.lock @@ -4,7 +4,7 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", "This file is @generated automatically" ], - "content-hash": "36f97cb9f275e6a0d29b9241ab3084ca", + "content-hash" : "77174ecf96d9315e44afe847234f52fa", "packages": [ { "name": "bluepsyduck/symfony-process-manager", @@ -199,6 +199,58 @@ }, "time": "2023-11-01T17:19:48+00:00" }, + { + "name" : "hds-solutions/parallel-sdk", + "version" : "v2.1.4", + "source" : { + "type" : "git", + "url" : "https://github.com/hschimpf/parallel-sdk.git", + "reference" : "91a38540d1b0c8723fb064781d25bfcf9ce5ce17" + }, + "dist" : { + "type" : "zip", + "url" : "https://api.github.com/repos/hschimpf/parallel-sdk/zipball/91a38540d1b0c8723fb064781d25bfcf9ce5ce17", + "reference" : "91a38540d1b0c8723fb064781d25bfcf9ce5ce17", + "shasum" : "" + }, + "require" : { + "php" : ">=8.0" + }, + "require-dev" : { + "phpunit/phpunit" : "^9.6", + "roave/security-advisories" : "dev-latest", + "symfony/console" : "^6.0" + }, + "suggest" : { + "ext-parallel" : "Allows to run multi-threaded processes", + "symfony/console" : "Allows usage of a shared ProgressBar between the Workers" + }, + "type" : "library", + "autoload" : { + "files" : [ + "src/helpers.php" + ], + "psr-4" : { + "HDSSolutions\\Console\\Parallel\\" : "src/" + } + }, + "notification-url" : "https://packagist.org/downloads/", + "license" : [ + "GPL-3.0" + ], + "authors" : [ + { + "name" : "Hermann D. Schimpf", + "email" : "hschimpf@hds-solutions.net" + } + ], + "description" : "SDK to implement parallel php extension", + "support" : { + "issues" : "https://github.com/hschimpf/parallel-sdk/issues", + "source" : "https://github.com/hschimpf/parallel-sdk/tree/v2.1.4" + }, + "time" : "2024-03-27T17:42:48+00:00" + }, { "name": "jbzoo/ci-report-converter", "version": "7.2.1", @@ -7362,16 +7414,16 @@ }, { "name": "squizlabs/php_codesniffer", - "version": "3.9.0", + "version" : "3.9.1", "source": { "type": "git", "url": "https://github.com/PHPCSStandards/PHP_CodeSniffer.git", - "reference": "d63cee4890a8afaf86a22e51ad4d97c91dd4579b" + "reference" : "267a4405fff1d9c847134db3a3c92f1ab7f77909" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/PHPCSStandards/PHP_CodeSniffer/zipball/d63cee4890a8afaf86a22e51ad4d97c91dd4579b", - "reference": "d63cee4890a8afaf86a22e51ad4d97c91dd4579b", + "url" : "https://api.github.com/repos/PHPCSStandards/PHP_CodeSniffer/zipball/267a4405fff1d9c847134db3a3c92f1ab7f77909", + "reference" : "267a4405fff1d9c847134db3a3c92f1ab7f77909", "shasum": "" }, "require": { @@ -7438,7 +7490,7 @@ "type": "open_collective" } ], - "time": "2024-02-16T15:06:51+00:00" + "time" : "2024-03-31T21:03:09+00:00" }, { "name": "symfony/config", @@ -8537,8 +8589,7 @@ "prefer-stable": true, "prefer-lowest": false, "platform": { - "php": "^8.1", - "ext-mbstring": "*" + "php" : "^8.1" }, "platform-dev": [], "plugin-api-version": "2.6.0"