-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
11 changed files
with
378 additions
and
710 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,42 @@ | ||
name: CI | ||
on: [pull_request] | ||
jobs: | ||
tests: | ||
name: Math CI PHP ${{ matrix.php-versions }} | ||
runs-on: ubuntu-latest | ||
strategy: | ||
matrix: | ||
php-versions: [ '8.2', '8.1', '8.0' ] | ||
|
||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v3 | ||
|
||
- name: Setup PHP | ||
uses: shivammathur/setup-php@v2 | ||
with: | ||
php-version: ${{ matrix.php-versions }} | ||
extensions: mbstring, dom, fileinfo, gmp, bcmath | ||
|
||
- name: Get composer cache directory | ||
id: composer-cache | ||
run: echo "::set-output name=dir::$(composer config cache-files-dir)" | ||
|
||
- name: Cache composer dependencies | ||
uses: actions/cache@v3 | ||
with: | ||
path: ${{ steps.composer-cache.outputs.dir }} | ||
key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.json') }} | ||
restore-keys: ${{ runner.os }}-composer- | ||
|
||
- name: Remove composer.lock | ||
run: rm -f composer.lock | ||
|
||
- name: Remove Pint | ||
run: composer remove "laravel/pint" --dev --no-update | ||
|
||
- name: Install Composer dependencies | ||
run: composer install --no-progress --prefer-dist --optimize-autoloader | ||
|
||
- name: Test with phpunit | ||
run: vendor/bin/phpunit |
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,52 @@ | ||
name: QA | ||
on: | ||
push: | ||
branches: | ||
- master | ||
pull_request: | ||
types: [ opened, synchronize ] | ||
jobs: | ||
tests: | ||
name: Math QA | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v3 | ||
|
||
- name: Setup PHP | ||
uses: shivammathur/setup-php@v2 | ||
with: | ||
php-version: 8.2 | ||
extensions: mbstring, dom, fileinfo, gmp, bcmath | ||
coverage: xdebug | ||
|
||
- name: Get composer cache directory | ||
id: composer-cache | ||
run: echo "::set-output name=dir::$(composer config cache-files-dir)" | ||
|
||
- name: Cache composer dependencies | ||
uses: actions/cache@v3 | ||
with: | ||
path: ${{ steps.composer-cache.outputs.dir }} | ||
key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.json') }} | ||
restore-keys: ${{ runner.os }}-composer- | ||
|
||
- name: Remove composer.lock | ||
run: rm -f composer.lock | ||
|
||
- name: Install Composer dependencies | ||
run: composer install --no-progress --prefer-dist --optimize-autoloader | ||
|
||
- name: Check code style | ||
run: vendor/bin/pint --config pint.json --test | ||
|
||
- name: Compute Coverage | ||
run: vendor/bin/phpunit --coverage-clover ./coverage.xml | ||
|
||
- name: Upload coverage to Codecov | ||
uses: codecov/codecov-action@v3 | ||
with: | ||
files: ./coverage.xml | ||
flags: unittests | ||
name: codecov-math |
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
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
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 |
---|---|---|
@@ -1,25 +1,16 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<phpunit backupGlobals="false" | ||
backupStaticAttributes="false" | ||
bootstrap="vendor/autoload.php" | ||
colors="true" | ||
convertErrorsToExceptions="true" | ||
convertNoticesToExceptions="true" | ||
convertWarningsToExceptions="true" | ||
processIsolation="false" | ||
stopOnFailure="false" | ||
verbose="true"> | ||
<testsuites> | ||
<testsuite name="Application Test Suite"> | ||
<directory>./tests/</directory> | ||
</testsuite> | ||
</testsuites> | ||
<php> | ||
<env name="APP_ENV" value="testing"/> | ||
<env name="CACHE_DRIVER" value="array"/> | ||
<env name="SESSION_DRIVER" value="array"/> | ||
<env name="QUEUE_DRIVER" value="sync"/> | ||
<ini name="display_errors" value="On"/> | ||
<ini name="display_startup_errors" value="On"/> | ||
</php> | ||
<phpunit xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" backupGlobals="false" bootstrap="vendor/autoload.php" colors="true" processIsolation="false" stopOnFailure="false" xsi:noNamespaceSchemaLocation="https://schema.phpunit.de/10.3/phpunit.xsd" cacheDirectory=".phpunit.cache" backupStaticProperties="false"> | ||
<testsuites> | ||
<testsuite name="Application Test Suite"> | ||
<directory>./tests/</directory> | ||
</testsuite> | ||
</testsuites> | ||
<php> | ||
<env name="APP_ENV" value="testing"/> | ||
<env name="CACHE_DRIVER" value="array"/> | ||
<env name="SESSION_DRIVER" value="array"/> | ||
<env name="QUEUE_DRIVER" value="sync"/> | ||
<ini name="display_errors" value="On"/> | ||
<ini name="display_startup_errors" value="On"/> | ||
</php> | ||
</phpunit> |
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,77 @@ | ||
{ | ||
"preset": "laravel", | ||
"rules": { | ||
"header_comment": { | ||
"header": "This file is part of fab2s/Math.\n(c) Fabrice de Stefanis / https://github.com/fab2s/Math\nThis source file is licensed under the MIT license which you will\nfind in the LICENSE file or at https://opensource.org/licenses/MIT" | ||
}, | ||
"assign_null_coalescing_to_coalesce_equal": true, | ||
"binary_operator_spaces": { | ||
"default": "align_single_space_minimal" | ||
}, | ||
"class_definition": true, | ||
"blank_lines_before_namespace": true, | ||
"align_multiline_comment": true, | ||
"class_attributes_separation": { | ||
"elements": { | ||
"method": "one", | ||
"const": "only_if_meta", | ||
"property": "only_if_meta", | ||
"trait_import": "only_if_meta" | ||
} | ||
}, | ||
"concat_space": { | ||
"spacing": "one" | ||
}, | ||
"global_namespace_import": { | ||
"import_classes": true, | ||
"import_functions": false, | ||
"import_constants": false | ||
}, | ||
"no_superfluous_phpdoc_tags": true, | ||
"method_argument_space": { | ||
"on_multiline": "ensure_fully_multiline" | ||
}, | ||
"method_chaining_indentation": true, | ||
"multiline_whitespace_before_semicolons": { | ||
"strategy": "new_line_for_chained_calls" | ||
}, | ||
"operator_linebreak": { | ||
"position": "beginning" | ||
}, | ||
"ordered_class_elements": { | ||
"order": [ | ||
"use_trait", | ||
"constant", | ||
"case", | ||
"property", | ||
"method" | ||
] | ||
}, | ||
"phpdoc_align": true, | ||
"phpdoc_separation": { | ||
"groups": [ | ||
[ | ||
"param" | ||
], | ||
[ | ||
"return" | ||
] | ||
] | ||
}, | ||
"php_unit_method_casing": { | ||
"case": "snake_case" | ||
}, | ||
"return_type_declaration": true, | ||
"simplified_null_return": true, | ||
"single_trait_insert_per_statement": true, | ||
"trailing_comma_in_multiline": { | ||
"elements": [ | ||
"parameters", | ||
"arguments" | ||
] | ||
} | ||
}, | ||
"exclude": [ | ||
"vendor" | ||
] | ||
} |
Oops, something went wrong.