-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #9 from ttskch/ci/gh-actions
Execute some tests on GitHub Actions
- Loading branch information
Showing
11 changed files
with
194 additions
and
85 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,89 @@ | ||
name: CI | ||
|
||
on: push | ||
|
||
jobs: | ||
coding-standards: | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- uses: shivammathur/setup-php@v2 | ||
with: | ||
php-version: 8.2 | ||
|
||
- uses: actions/checkout@v3 | ||
|
||
- name: Install Dependencies | ||
run: | | ||
composer install -q --no-ansi --no-interaction --no-scripts --no-progress --prefer-dist | ||
composer bin all install -q --no-ansi --no-interaction --no-scripts --no-progress --prefer-dist | ||
- name: Execute checks | ||
run: composer cs | ||
|
||
static-analysis: | ||
runs-on: ubuntu-latest | ||
|
||
strategy: | ||
fail-fast: true | ||
matrix: | ||
php-version: | ||
- 7.2 | ||
- 7.3 | ||
- 7.4 | ||
- 8.0 | ||
- 8.1 | ||
- 8.2 | ||
|
||
steps: | ||
- uses: shivammathur/setup-php@v2 | ||
with: | ||
php-version: ${{ matrix.php-version }} | ||
|
||
- uses: actions/checkout@v3 | ||
|
||
- name: Install Dependencies | ||
run: | | ||
composer install -q --no-ansi --no-interaction --no-scripts --no-progress --prefer-dist | ||
composer bin all install -q --no-ansi --no-interaction --no-scripts --no-progress --prefer-dist | ||
- name: Execute checks | ||
run: composer sa | ||
|
||
test: | ||
runs-on: ubuntu-latest | ||
|
||
strategy: | ||
fail-fast: true | ||
matrix: | ||
php-version: | ||
- 7.2 | ||
- 7.3 | ||
- 7.4 | ||
- 8.0 | ||
- 8.1 | ||
- 8.2 | ||
dependencies: | ||
- lowest | ||
- highest | ||
|
||
steps: | ||
- uses: shivammathur/setup-php@v2 | ||
with: | ||
php-version: ${{ matrix.php-version }} | ||
|
||
- uses: actions/checkout@v3 | ||
|
||
- name: Install lowest dependencies | ||
if: ${{ matrix.dependencies == 'lowest' }} | ||
run: | | ||
composer update -q --no-ansi --no-interaction --no-scripts --no-progress --prefer-dist --prefer-lowest | ||
# phpunit too old cannot be run on PHP 8.1+ | ||
composer update -q --no-ansi --no-interaction --no-scripts --no-progress --prefer-dist phpunit/phpunit | ||
- name: Install highest dependencies | ||
if: ${{ matrix.dependencies == 'highest' }} | ||
run: composer install -q --no-ansi --no-interaction --no-scripts --no-progress --prefer-dist | ||
|
||
- name: Execute tests | ||
run: composer test |
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,2 +1,12 @@ | ||
/composer.lock | ||
/vendor | ||
/vendor-bin/*/composer.lock | ||
/vendor-bin/*/vendor | ||
|
||
# friendsofphp/php-cs-fixer | ||
/.php-cs-fixer.php | ||
/.php-cs-fixer.cache | ||
|
||
# phpunit/phpunit | ||
/phpunit.xml | ||
/.phpunit.result.cache |
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,16 @@ | ||
<?php | ||
|
||
$finder = new PhpCsFixer\Finder(); | ||
|
||
return (new PhpCsFixer\Config()) | ||
->setRules([ | ||
'@Symfony' => true, | ||
'yoda_style' => [ | ||
'equal' => false, | ||
'identical' => false, | ||
'less_and_greater' => false, | ||
], | ||
'no_null_property_initialization' => false, | ||
]) | ||
->setFinder($finder) | ||
; |
This file was deleted.
Oops, something went wrong.
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 |
---|---|---|
@@ -0,0 +1,17 @@ | ||
includes: | ||
- vendor-bin/tools/vendor/phpstan/phpstan-strict-rules/rules.neon | ||
|
||
parameters: | ||
level: max | ||
paths: | ||
- src | ||
- tests | ||
|
||
ignoreErrors: | ||
# Allow some "Dynamic call to static method" in tests | ||
# @see https://github.com/phpstan/phpstan-strict-rules/issues/36 | ||
- messages: | ||
- '#Dynamic call to static method PHPUnit\\Framework\\TestCase::once\(\)\.#' | ||
- '#Dynamic call to static method PHPUnit\\Framework\\Assert::equalTo\(\)\.#' | ||
paths: | ||
- tests |
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
Oops, something went wrong.