Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Downgraded pest to work with infection and added infection to the pip… #7

Merged
merged 9 commits into from
Nov 23, 2024
25 changes: 13 additions & 12 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ jobs:
strategy:
fail-fast: false
matrix:
php-version: ['8.1', '8.2', '8.3']
php-version: ['8.2', '8.3']

steps:
- uses: actions/checkout@v4
Expand All @@ -28,7 +28,6 @@ jobs:
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php-version }}
coverage: xdebug
extensions: dom

- name: Validate composer.json and composer.lock
Expand All @@ -38,15 +37,15 @@ jobs:
run: composer install --prefer-dist --no-progress

- name: Run the linter
run: composer lint
run: php ./vendor/bin/php-cs-fixer fix src --dry-run --allow-risky=yes

- name: Run PHPStan
if: success() || failure()
run: composer phpstan -- --error-format=github > phpstan.json
run: php -d memory_limit=1G ./vendor/bin/phpstan analyse -c phpstan.neon --error-format=github > phpstan.json

- name: Run psalm
if: success() || failure()
run: composer psalm --output-format=github
run: php ./vendor/bin/psalm --output-format=github

integration-tests:
name: Test suite and coverage
Expand All @@ -55,7 +54,7 @@ jobs:
strategy:
fail-fast: false
matrix:
php-version: ['8.1', '8.2', '8.3']
php-version: ['8.2', '8.3']

steps:
- uses: actions/checkout@v4
Expand All @@ -64,16 +63,18 @@ jobs:
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php-version }}
coverage: xdebug
coverage: pcov
extensions: dom

- name: Install dependencies
run: composer install --prefer-dist --no-progress

- name: Run test suite
run: |
if [[ ${{ matrix.php-version }} == '8.1' ]]; then
composer coverage --min=100 --coverage-clover=coverage.xml
else
composer pest
fi
php ./vendor/bin/pest --coverage --min=100 --coverage-clover=coverage.xml --coverage-xml=logs/coverage --log-junit=logs/coverage.junit.xml

- name: Run infection mutation testing
run:
php ./vendor/bin/infection --min-msi=90 --min-covered-msi=95 --threads=max --no-interaction --logger-github=true --skip-initial-tests --coverage=logs


6 changes: 5 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -22,4 +22,8 @@ nbbuild/
dist/
nbdist/
nbactions.xml
nb-configuration.xml
nb-configuration.xml

/infection-log.json
logs/
/coverage.xml
21 changes: 15 additions & 6 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,18 +4,22 @@
"type": "library",
"license": "MIT",
"authors": [
{
"name": "Justin Ruiter",
"email": "globy@justinruiter.nl"
},
{
"name": "sjustein",
"email": "hashsensitive@justinruiter.nl"
},
{
"name": "Justin Ruiter",
"email": "globy@justinruiter.nl"
"name": "leocavalcante",
"email": "lc@leocavalcante.com"
}
],
"minimum-stability": "stable",
"require": {
"php": ">=8.1",
"php": ">=8.2",
"monolog/monolog": "^3.0"
},
"autoload": {
Expand All @@ -24,11 +28,12 @@
}
},
"require-dev": {
"pestphp/pest": "^2.4",
"pestphp/pest": "v2.31.0",
"friendsofphp/php-cs-fixer": "^3.16",
"phpstan/phpstan": "^1.10",
"phpstan/phpstan-deprecation-rules": "^1.1",
"vimeo/psalm": "^5.23"
"vimeo/psalm": "^5.23",
"infection/infection": "^0.27.11"
},
"autoload-dev": {
"psr-4": {
Expand Down Expand Up @@ -56,11 +61,15 @@
],
"coverage": [
"php ./vendor/bin/pest --coverage"
],
"infection": [
"php ./vendor/bin/infection"
]
},
"config": {
"allow-plugins": {
"pestphp/pest-plugin": true
"pestphp/pest-plugin": true,
"infection/extension-installer": true
}
}
}
Loading