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 5b6fd42
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 14 deletions.
19 changes: 7 additions & 12 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,22 +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.2' ]]; 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
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 --skip-initial-tests --coverage=logs


2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
}
},
"require-dev": {
"pestphp/pest": "v1.23.1",
"pestphp/pest": "^v1.23.1",
"friendsofphp/php-cs-fixer": "^3.16",
"phpstan/phpstan": "^1.10",
"phpstan/phpstan-deprecation-rules": "^1.1",
Expand Down
2 changes: 1 addition & 1 deletion composer.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

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 5b6fd42

Please sign in to comment.