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

Add mutation tests to pipeline #334

Merged
merged 9 commits into from
Dec 13, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
69 changes: 69 additions & 0 deletions .github/workflows/infection.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,69 @@
# https://help.github.com/en/categories/automating-your-workflow-with-github-actions

name: "Mutation tests"

on:
pull_request:
push:
branches:
- "master"

jobs:
mutation-tests:
name: "Mutation tests"

runs-on: ${{ matrix.operating-system }}

strategy:
matrix:
dependencies:
- "locked"
php-version:
- "7.4"
- "8.0"
- "8.1"
operating-system:
- "ubuntu-latest"

steps:
- name: "Checkout"
uses: "actions/checkout@v2"

- name: "Install PHP"
uses: "shivammathur/setup-php@v2"
with:
coverage: "pcov"
php-version: "${{ matrix.php-version }}"
ini-values: memory_limit=-1, zend.assertions=1

- name: Get Composer cache directory
id: composer-cache
run: echo "::set-output name=dir::$(composer config cache-dir)"

- name: Cache dependencies
uses: actions/cache@v2
with:
path: ${{ steps.composer-cache.outputs.dir }}
key: composer-${{ runner.os }}-${{ matrix.php-version }}-${{ hashFiles('composer.*') }}-${{ matrix.dependencies }}
restore-keys: |
composer-${{ runner.os }}-${{ matrix.php-version }}-${{ hashFiles('composer.*') }}-
composer-${{ runner.os }}-${{ matrix.php-version }}-
composer-${{ runner.os }}-
composer-

- name: "Install lowest dependencies"
if: ${{ matrix.dependencies == 'lowest' }}
run: "composer update --prefer-lowest --no-interaction --no-progress --no-suggest"

- name: "Install highest dependencies"
if: ${{ matrix.dependencies == 'highest' }}
run: "composer update --no-interaction --no-progress --no-suggest"

- name: "Install locked dependencies"
if: ${{ matrix.dependencies == 'locked' }}
run: "composer install --no-interaction --no-progress --no-suggest"

- name: "Infection"
run: "vendor/bin/roave-infection-static-analysis-plugin --threads=$(nproc)"
env:
INFECTION_BADGE_API_KEY: ${{ secrets.INFECTION_BADGE_API_KEY }}
13 changes: 0 additions & 13 deletions baseline.xml
Original file line number Diff line number Diff line change
Expand Up @@ -3,17 +3,4 @@
<file src="src/ComposerRequireChecker/Cli/CheckCommand.php">
<MixedArgumentTypeCoercion occurrences="2"/>
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh, last one left? Can we completely get rid of the baseline, perhaps?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Currently I don’t know how to process all the ongoing generator stuff ^^

</file>
<file src="src/ComposerRequireChecker/FileLocator/LocateComposerPackageSourceFiles.php">
<MixedArgument occurrences="4">
<code>$composerData['autoload']['classmap'] ?? []</code>
<code>$composerData['autoload']['files'] ?? []</code>
<code>$composerData['autoload']['psr-0'] ?? []</code>
<code>$composerData['autoload']['psr-4'] ?? []</code>
</MixedArgument>
</file>
<file src="src/ComposerRequireChecker/NodeVisitor/DefinedSymbolCollector.php">
<NoInterfaceProperties occurrences="1">
<code>$node-&gt;namespacedName</code>
</NoInterfaceProperties>
</file>
</files>
1 change: 1 addition & 0 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@
"phing/phing": "^2.17.0",
"phpstan/phpstan": "^1.2.0",
"phpunit/phpunit": "^9.5.10",
"roave/infection-static-analysis-plugin": "^1.12",
"vimeo/psalm": "^4.14.0"
},
"config": {
Expand Down
Loading