-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Initial commit of the project scafolding
- Loading branch information
Showing
5 changed files
with
3,497 additions
and
0 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,54 @@ | ||
name: Test | ||
|
||
on: | ||
push: | ||
branches: [ "master" ] | ||
pull_request: | ||
|
||
permissions: | ||
contents: read | ||
|
||
jobs: | ||
build: | ||
|
||
runs-on: ubuntu-latest | ||
|
||
strategy: | ||
matrix: | ||
# https://github.com/shivammathur/setup-php#tada-php-support | ||
php-versions: | ||
- '8.1' | ||
- '8.2' | ||
- '8.3' # nightly | ||
|
||
steps: | ||
- uses: actions/checkout@v3 | ||
|
||
- name: Install PHP | ||
uses: shivammathur/setup-php@v2 | ||
with: | ||
php-version: ${{ matrix.php-versions }} | ||
coverage: xdebug | ||
|
||
- name: Validate composer.json and composer.lock | ||
run: composer validate --strict | ||
|
||
- name: Cache Composer packages | ||
id: composer-cache | ||
uses: actions/cache@v3 | ||
with: | ||
path: vendor | ||
key: ${{ runner.os }}-php-${{ matrix.php-versions }}-${{ hashFiles('**/composer.lock') }} | ||
restore-keys: | | ||
${{ runner.os }}-php-${{ matrix.php-versions }} | ||
- name: Install dependencies | ||
run: composer install --prefer-dist --no-progress | ||
|
||
- name: Run test suite | ||
run: composer run-script test | ||
|
||
- name: Lint the code | ||
env: | ||
PHP_CS_FIXER_IGNORE_ENV: '1' # make cs-fixer stop complaining when using PHP 8.3 | ||
run: composer run-script lint |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
.idea/ | ||
/vendor/ |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
<?php | ||
|
||
$finder = PhpCsFixer\Finder::create() | ||
->in(__DIR__ . '/src/') | ||
->in(__DIR__ . '/tests/') | ||
; | ||
|
||
$config = new PhpCsFixer\Config(); | ||
|
||
// https://github.com/FriendsOfPHP/PHP-CS-Fixer/blob/master/doc/rules/index.rst | ||
// https://github.com/FriendsOfPHP/PHP-CS-Fixer/blob/master/doc/ruleSets/index.rst | ||
return $config | ||
->setRules([ | ||
'@PSR2' => true, | ||
]) | ||
->setFinder($finder) | ||
; |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
{ | ||
"name": "elecena/jsonl-parser", | ||
"description": "Add, read and remove entries from JSON Lines formatted files", | ||
"type": "library", | ||
"license": "MIT", | ||
"autoload": { | ||
"psr-4": { | ||
"Elecena\\JsonlParser\\": "src/" | ||
}, | ||
"classmap": [ | ||
"tests/" | ||
] | ||
}, | ||
"authors": [ | ||
{ | ||
"name": "Maciej Brencz", | ||
"email": "[email protected]" | ||
} | ||
], | ||
"require": { | ||
"php": "^8.1" | ||
}, | ||
"require-dev": { | ||
"phpunit/phpunit": "^10.3", | ||
"friendsofphp/php-cs-fixer": "^3.22" | ||
}, | ||
"scripts": { | ||
"test": "phpunit --testdox", | ||
"lint": [ | ||
"php-cs-fixer fix --config=.php-cs-fixer.php --dry-run --verbose" | ||
], | ||
"format": [ | ||
"php-cs-fixer fix --config=.php-cs-fixer.php" | ||
] | ||
} | ||
} |
Oops, something went wrong.