Skip to content

Commit

Permalink
Pipeline now fails when infection score is too low, phpstan issues re…
Browse files Browse the repository at this point in the history
…solved
  • Loading branch information
Sjustein committed Apr 26, 2024
1 parent ffce166 commit 9279669
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 8 deletions.
16 changes: 8 additions & 8 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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 @@ -64,7 +63,7 @@ jobs:
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php-version }}
coverage: xdebug
coverage: pcov
extensions: dom

- name: Install dependencies
Expand All @@ -73,13 +72,14 @@ jobs:
- name: Run test suite
run: |
if [[ ${{ matrix.php-version }} == '8.2' ]]; then
composer coverage --min=100 --coverage-clover=coverage.xml
php ./vendor/bin/pest --coverage --min=100 --coverage-clover=coverage.xml
else
composer pest
php ./vendor/bin/pest
fi
- name: Run infection mutation testing
if: success() || failure()
run:
composer infection --min-msi=90 --min-covered-msi=95 --threads=4
php ./vendor/bin/infection --min-msi=90 --min-covered-msi=95 --threads=max --no-interaction --logger-github=true


3 changes: 3 additions & 0 deletions phpstan.neon
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,9 @@ parameters:
-
message: '#Undefined variable: \$this#'
path: */tests/*
-
message: '#Call to an undefined method Pest\\Expectation\|Pest\\Support\\Extendable\:\:#'
path: */tests/*

includes:
- vendor/phpstan/phpstan-deprecation-rules/rules.neon

0 comments on commit 9279669

Please sign in to comment.