-
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.
Merge pull request #12 from wmde/update-for-php-8
Update for PHP 8
- Loading branch information
Showing
16 changed files
with
404 additions
and
217 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,91 @@ | ||
name: CI | ||
|
||
on: | ||
pull_request: | ||
push: | ||
|
||
jobs: | ||
test: | ||
name: "PHPUnit PHP ${{ matrix.php }}" | ||
|
||
strategy: | ||
matrix: | ||
php: [ 8.0, 8.1, rc ] | ||
include: | ||
- php: '8.0' | ||
coverage: true | ||
|
||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- name: Setup PHP | ||
if: matrix.coverage | ||
uses: shivammathur/setup-php@v2 | ||
with: | ||
php-version: ${{ matrix.php }} | ||
extensions: mbstring | ||
tools: composer, cs2pr | ||
coverage: pcov | ||
|
||
- uses: actions/checkout@v2 | ||
|
||
- name: Cache Composer cache | ||
uses: actions/cache@v2 | ||
with: | ||
path: ~/.composer/cache | ||
key: composer-cache-php${{ matrix.php }} | ||
|
||
- name: Composer install | ||
run: composer install --no-progress --no-suggest --no-interaction --prefer-dist --optimize-autoloader | ||
|
||
- name: Enable code coverage | ||
if: matrix.coverage | ||
run: echo "COVERAGE=1" >> $GITHUB_ENV | ||
|
||
- name: PHPUnit | ||
run: | | ||
mkdir -p build/logs/phpunit | ||
if [ "$COVERAGE" = '1' ]; then | ||
vendor/bin/phpunit --coverage-clover build/logs/phpunit/clover.xml --log-junit build/logs/phpunit/junit.xml --colors=always | ||
else | ||
vendor/bin/phpunit --log-junit build/logs/phpunit/junit.xml --colors=always | ||
fi | ||
- name: Upload coverage results to Codecov | ||
if: matrix.coverage | ||
uses: codecov/codecov-action@v1 | ||
with: | ||
name: phpunit-php${{ matrix.php }} | ||
flags: phpunit | ||
fail_ci_if_error: true | ||
continue-on-error: true | ||
|
||
static-analysis: | ||
name: "Static Analysis" | ||
|
||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- name: Setup PHP | ||
uses: shivammathur/setup-php@v2 | ||
with: | ||
php-version: 8.0 | ||
extensions: mbstring | ||
tools: composer, cs2pr | ||
|
||
- uses: actions/checkout@v2 | ||
|
||
- name: Cache Composer cache | ||
uses: actions/cache@v2 | ||
with: | ||
path: ~/.composer/cache | ||
key: composer-cache-php8.0 | ||
|
||
- name: Composer install | ||
run: composer install --no-progress --no-suggest --no-interaction --prefer-dist --optimize-autoloader | ||
|
||
- name: Psalm | ||
run: php vendor/bin/psalm --threads=2 --output-format=github --shepherd --stats | ||
|
||
- name: PHPStan | ||
run: php vendor/bin/phpstan analyse --error-format=checkstyle --no-progress src/ tests/ | cs2pr |
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 |
---|---|---|
|
@@ -2,6 +2,8 @@ | |
!.* | ||
|
||
composer.phar | ||
composer.lock | ||
.phpunit.result.cache | ||
|
||
vendor/ | ||
|
||
|
This file was deleted.
Oops, something went wrong.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
.PHONY: ci cs test phpunit psalm phpstan stan | ||
|
||
ci: phpstan phpunit psalm | ||
cs: phpstan psalm | ||
test: phpunit | ||
|
||
phpunit: | ||
php ./vendor/bin/phpunit -c phpunit.xml.dist | ||
|
||
coverage-html: | ||
php ./vendor/bin/phpunit -c phpunit.xml.dist --coverage-html=./build/coverage/html | ||
|
||
psalm: | ||
./vendor/bin/psalm | ||
|
||
phpstan: | ||
./vendor/bin/phpstan analyse -c phpstan.neon --no-progress | ||
|
||
stan: phpstan | ||
|
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 |
---|---|---|
|
@@ -3,6 +3,13 @@ | |
"description": "Test Doubles for the PSR-3 Logger Interface", | ||
"homepage": "https://github.com/wmde/PsrLogTestDoubles", | ||
"license": "GPL-2.0-or-later", | ||
"authors": [ | ||
{ | ||
"name": "Jeroen De Dauw", | ||
"email": "[email protected]", | ||
"homepage": "https://www.EntropyWins.wtf" | ||
} | ||
], | ||
"keywords": [ | ||
"log", | ||
"psr", | ||
|
@@ -20,40 +27,22 @@ | |
"test" | ||
], | ||
"require": { | ||
"php": ">=7.1", | ||
"psr/log": "~1.0" | ||
"php": ">=8.0", | ||
"psr/log": "~3.0|~2.0" | ||
}, | ||
"require-dev": { | ||
"phpunit/phpunit": "~6.1", | ||
"squizlabs/php_codesniffer": "~2.5", | ||
"mediawiki/mediawiki-codesniffer": "~0.6.0", | ||
"ockcyp/covers-validator": "~0.4" | ||
"phpunit/phpunit": "~9.5", | ||
"vimeo/psalm": "^4.18.1", | ||
"phpstan/phpstan": "^1.4.2" | ||
}, | ||
"autoload": { | ||
"psr-4": { | ||
"WMDE\\PsrLogTestDoubles\\": "src/" | ||
} | ||
}, | ||
"extra": { | ||
"branch-alias": { | ||
"dev-master": "2.1.x-dev" | ||
"autoload-dev": { | ||
"psr-4": { | ||
"WMDE\\PsrLogTestDoubles\\Tests\\": "tests/" | ||
} | ||
}, | ||
"scripts": { | ||
"ci": [ | ||
"@test", | ||
"@cs" | ||
], | ||
"test": [ | ||
"composer validate --no-interaction", | ||
"vendor/bin/covers-validator", | ||
"vendor/bin/phpunit" | ||
], | ||
"cs": [ | ||
"@phpcs" | ||
], | ||
"phpcs": [ | ||
"vendor/bin/phpcs src/ tests/ --standard=phpcs.xml --extensions=php -sp" | ||
] | ||
} | ||
} |
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,5 @@ | ||
parameters: | ||
level: 1 | ||
paths: | ||
- src | ||
- 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
<?xml version="1.0"?> | ||
<psalm | ||
errorLevel="1" | ||
resolveFromConfigFile="true" | ||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" | ||
xmlns="https://getpsalm.org/schema/config" | ||
xsi:schemaLocation="https://getpsalm.org/schema/config vendor/vimeo/psalm/config.xsd" | ||
> | ||
<projectFiles> | ||
<directory name="src" /> | ||
|
||
<ignoreFiles> | ||
</ignoreFiles> | ||
</projectFiles> | ||
</psalm> |
Oops, something went wrong.