Skip to content

Commit

Permalink
Merge pull request #334 from dkreuer/feature/mutation-tests-pipeline
Browse files Browse the repository at this point in the history
Add mutation tests to pipeline
  • Loading branch information
Ocramius authored Dec 13, 2021
2 parents 537138b + 2c6fe9c commit 7d73b3e
Show file tree
Hide file tree
Showing 24 changed files with 1,351 additions and 91 deletions.
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"/>
</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

0 comments on commit 7d73b3e

Please sign in to comment.