Skip to content

Commit

Permalink
Merge pull request #2 from Jeroen-G/infection
Browse files Browse the repository at this point in the history
install infectionphp
  • Loading branch information
Jeroen-G authored Dec 18, 2020
2 parents bc2bebe + 45aa4d1 commit 3ad99b0
Show file tree
Hide file tree
Showing 7 changed files with 2,054 additions and 853 deletions.
5 changes: 3 additions & 2 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ jobs:

strategy:
matrix:
php: [7.4]
php: [7.4, 8.0]

name: PHP${{ matrix.php }}

Expand All @@ -18,10 +18,11 @@ jobs:
uses: actions/checkout@v1

- name: Setup PHP
uses: shivammathur/setup-php@v1
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php }}
extensions: json
coverage: xdebug

- name: Install dependencies
run: composer update --prefer-dist --no-suggest --no-interaction --no-scripts
Expand Down
33 changes: 33 additions & 0 deletions .github/workflows/review.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@

name: Autoreview

on:
pull_request:

jobs:
fight-mutants:
runs-on: ubuntu-latest

strategy:
matrix:
php: [ 7.4, 8.0 ]

name: Mutation Testing Code Review Annotations ${{ matrix.php }}

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

- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php }}
coverage: xdebug

- name: Install dependencies
run: composer update --prefer-dist --no-suggest --no-interaction --ignore-platform-reqs --no-scripts

- name: Run Infection for added and modified files only
run: |
git fetch --depth=1 origin $GITHUB_BASE_REF
php vendor/bin/infection -j2 --git-diff-filter=AM --logger-github
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -6,3 +6,4 @@
.phpunit.result.cache
npm-debug.log
yarn-error.log
infection.log
6 changes: 6 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ update: intro do-composer-update
# Tests
tests: intro do-test-unit do-test-report
test-unit: intro do-test-unit
mutations: intro do-test-infection

# Development
pre-commit: intro do-lint-staged-files do-commit-intro
Expand All @@ -36,6 +37,7 @@ help:
@echo "\nTests"
@echo " make tests Run tests."
@echo " make test-unit Run unit tests."
@echo " make mutations Run the infection mutation tests."
@echo "\nDevelopment"
@echo " make codestyle Check if the codestyle is OK."
@echo " make codestyle-fix Check and fix your messy codestyle."
Expand Down Expand Up @@ -76,6 +78,10 @@ do-test-unit:
@echo "\n=== Running unit tests ===\n"
vendor/bin/phpunit

do-test-infection:
@echo "\n=== Running unit tests ===\n"
vendor/bin/infection --threads=4 --min-covered-msi=100

do-test-report:
@echo "\n=== Click the link below to see the test coverage report ===\n"
@echo "report/index.html"
5 changes: 3 additions & 2 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,12 @@
}
],
"require": {
"php": "^7.4"
"php": "^7.4|^8.0"
},
"require-dev": {
"phpunit/phpunit": "^9.2",
"symplify/easy-coding-standard": "^8.0"
"symplify/easy-coding-standard": "^8.3",
"infection/infection": "0.20"
},
"autoload": {
"psr-4": {
Expand Down
Loading

0 comments on commit 3ad99b0

Please sign in to comment.