Skip to content

Commit

Permalink
Merge 8b960ee into ca07291
Browse files Browse the repository at this point in the history
  • Loading branch information
SmetDenis committed Apr 1, 2024
2 parents ca07291 + 8b960ee commit ff28d86
Show file tree
Hide file tree
Showing 8 changed files with 95 additions and 21 deletions.
10 changes: 8 additions & 2 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand Down
9 changes: 6 additions & 3 deletions .phan.php
Original file line number Diff line number Diff line change
Expand Up @@ -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',
],
]);
4 changes: 2 additions & 2 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -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!
Expand Down
13 changes: 9 additions & 4 deletions composer.json
Original file line number Diff line number Diff line change
@@ -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" : [
Expand Down Expand Up @@ -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",
Expand All @@ -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" : {
Expand All @@ -53,6 +54,10 @@
"fakerphp/faker" : "^1.23.1"
},

"suggest" : {
"ext-parallel" : "Parallel processing of CSV files for better performance"
},

"bin" : ["csv-blueprint"],

"autoload" : {
Expand Down
67 changes: 59 additions & 8 deletions composer.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 5 additions & 0 deletions csv-blueprint.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,11 @@
\define('PATH_ROOT', __DIR__);
require_once __DIR__ . '/vendor/autoload.php';

if (\extension_loaded('parallel')) {
// set the path to composer's autoloader
\parallel\bootstrap(__DIR__ . '/vendor/autoload.php');
}

// Fix for GitHub actions. See action.yml
$_SERVER['argv'] = Utils::fixArgv($_SERVER['argv'] ?? []);
$_SERVER['argc'] = \count($_SERVER['argv']);
Expand Down
4 changes: 2 additions & 2 deletions tests/ReadmeTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,8 @@ final class ReadmeTest extends TestCase
'* Check that each row matches the number of columns.',
'* With `strict_column_order` rule, you can check that the columns are in the correct order.',
'* With `allow_extra_columns` rule, you can check that there are no extra columns in the CSV file.',
' * If `csv.header: true`. Schema contains an unknown column `name` that is not found in the CSV file.',
' * If `csv.header: false`. Compare the number of columns in the schema and the CSV file.',
' * If `csv.header: true`. Schema contains an unknown column `name` that is not found in the CSV file.',
' * If `csv.header: false`. Compare the number of columns in the schema and the CSV file.',
];

public function testCreateCsvHelp(): void
Expand Down
4 changes: 4 additions & 0 deletions tests/autoload.php
Original file line number Diff line number Diff line change
Expand Up @@ -23,3 +23,7 @@
echo 'Please execute "composer update" !' . \PHP_EOL;
exit(1);
}

if (\extension_loaded('parallel')) {
\parallel\bootstrap(__DIR__ . '/vendor/autoload.php');
}

0 comments on commit ff28d86

Please sign in to comment.