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

Run Infection on PHP 8.1. #1535

Merged
merged 16 commits into from Oct 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.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
3 changes: 1 addition & 2 deletions .github/workflows/autoreview.yaml
Expand Up @@ -38,9 +38,8 @@ jobs:
uses: actions/cache@v2
with:
path: ${{ steps.composer-cache.outputs.dir }}
key: composer-${{ runner.os }}-${{ matrix.php-version }}-${{ hashFiles('composer.*') }}-${{ matrix.dependencies }}
key: composer-${{ runner.os }}-${{ matrix.php-version }}-${{ hashFiles('composer.*') }}
restore-keys: |
composer-${{ runner.os }}-${{ matrix.php-version }}-${{ hashFiles('composer.*') }}-
composer-${{ runner.os }}-${{ matrix.php-version }}-
composer-${{ runner.os }}-
composer-
Expand Down
29 changes: 19 additions & 10 deletions .github/workflows/ci.yaml
Expand Up @@ -18,16 +18,15 @@ jobs:
matrix:
operating-system: [ubuntu-latest]
php-version: ['7.4']
dependencies: ['']
Copy link
Member Author

Choose a reason for hiding this comment

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

no longer required as we got rid of --ignore-platform-req=php

coverage-driver: [pcov, xdebug]
e2e-runner: ['bin/infection']
include:
- { operating-system: 'windows-latest', php-version: '7.4', dependencies: '', coverage-driver: 'xdebug' }
- { operating-system: 'ubuntu-latest', php-version: '7.4', dependencies: '', coverage-driver: 'pcov' }
- { operating-system: 'ubuntu-latest', php-version: '8.0', dependencies: '--ignore-platform-req=php', coverage-driver: 'pcov', e2e-runner: 'build/infection.phar' }
- { operating-system: 'windows-latest', php-version: '7.4', coverage-driver: 'xdebug' }
- { operating-system: 'ubuntu-latest', php-version: '7.4', coverage-driver: 'pcov' }
- { operating-system: 'ubuntu-latest', php-version: '8.0', coverage-driver: 'pcov', e2e-runner: 'build/infection.phar' }
- { operating-system: 'ubuntu-latest', php-version: '8.1', coverage-driver: 'pcov' }

continue-on-error: ${{ matrix.php-version == '8.0' }}
name: CI on ${{ matrix.operating-system }} with PHP ${{ matrix.php-version }}, using ${{ matrix.coverage-driver }} ${{ matrix.dependencies }} with ${{ matrix.e2e-runner }}
name: CI on ${{ matrix.operating-system }} with PHP ${{ matrix.php-version }}, using ${{ matrix.coverage-driver }} with ${{ matrix.e2e-runner }}

steps:
- name: Checkout code
Expand All @@ -49,7 +48,7 @@ jobs:
uses: actions/cache@v2
with:
path: ${{ steps.composer-cache.outputs.dir }}
key: composer-${{ runner.os }}-${{ matrix.php-version }}-${{ hashFiles('composer.*') }}-${{ matrix.dependencies }}
key: composer-${{ runner.os }}-${{ matrix.php-version }}-${{ hashFiles('composer.*') }}
restore-keys: |
composer-${{ runner.os }}-${{ matrix.php-version }}-${{ hashFiles('composer.*') }}-
composer-${{ runner.os }}-${{ matrix.php-version }}-
Expand All @@ -58,24 +57,34 @@ jobs:

- name: Install dependencies
run: |
composer install --no-interaction --prefer-dist --no-progress ${{ matrix.dependencies }}
composer install --no-interaction --prefer-dist --no-progress

- name: Run tests
shell: bash
run: |
# Required as long as "PHPUnit\Runner\DefaultTestResultCache implements the Serializable interface, which is deprecated.
# Implement __serialize() and __unserialize() instead (or in addition, if support for old PHP versions is necessary)" is not fixed
if [[ "${{ matrix.php-version }}" == '8.1' ]]; then
export SYMFONY_DEPRECATIONS_HELPER=max[direct]=1
fi

make test-unit

- name: Run integration tests
shell: bash
run: |
if [[ "${{ matrix.php-version }}" == '8.1' ]]; then
export SYMFONY_DEPRECATIONS_HELPER=max[direct]=1
fi

make test-unit PHPUNIT_GROUP=integration

- name: Cache E2E tests dependencies
if: runner.os == 'Windows'
uses: actions/cache@v2
with:
path: tests/e2e/*/vendor
key: e2e-vendor-${{ runner.os }}-${{ matrix.php-version }}-${{ hashFiles('tests/e2e/*/composer.json') }}-${{ matrix.dependencies }}
key: e2e-vendor-${{ runner.os }}-${{ matrix.php-version }}-${{ hashFiles('tests/e2e/*/composer.json') }}
restore-keys: |
e2e-vendor-${{ runner.os }}-${{ matrix.php-version }}-${{ hashFiles('tests/e2e/*/composer.json') }}-
e2e-vendor-${{ runner.os }}-${{ matrix.php-version }}-
Expand All @@ -86,7 +95,7 @@ jobs:
shell: bash
run: |
ls tests/e2e/*/composer.json | xargs dirname |
xargs -I{} composer --working-dir={} install --no-interaction --prefer-dist --no-progress ${{ matrix.dependencies }}
xargs -I{} composer --working-dir={} install --no-interaction --prefer-dist --no-progress

- name: Run a subset of E2E tests
if: runner.os == 'Windows'
Expand Down
3 changes: 1 addition & 2 deletions .github/workflows/mt-annotations.yaml
Expand Up @@ -35,9 +35,8 @@ jobs:
uses: actions/cache@v2
with:
path: ${{ steps.composer-cache.outputs.dir }}
key: composer-${{ runner.os }}-${{ matrix.php-version }}-${{ hashFiles('composer.*') }}-${{ matrix.dependencies }}
key: composer-${{ runner.os }}-${{ matrix.php-version }}-${{ hashFiles('composer.*') }}
restore-keys: |
composer-${{ runner.os }}-${{ matrix.php-version }}-${{ hashFiles('composer.*') }}-
composer-${{ runner.os }}-${{ matrix.php-version }}-
composer-${{ runner.os }}-
composer-
Expand Down
6 changes: 2 additions & 4 deletions .github/workflows/mt.yaml
Expand Up @@ -22,7 +22,6 @@ jobs:
matrix:
operating-system: [ubuntu-latest, windows-latest]
php-version: ['7.4']
dependencies: ['']
coverage-driver: [pcov]

name: Mutation testing on ${{ matrix.operating-system }} with PHP ${{ matrix.php-version }}, using ${{ matrix.coverage-driver }}
Expand All @@ -46,16 +45,15 @@ jobs:
uses: actions/cache@v2
with:
path: ${{ steps.composer-cache.outputs.dir }}
key: composer-${{ runner.os }}-${{ matrix.php-version }}-${{ hashFiles('composer.*') }}-${{ matrix.dependencies }}
key: composer-${{ runner.os }}-${{ matrix.php-version }}-${{ hashFiles('composer.*') }}
restore-keys: |
composer-${{ runner.os }}-${{ matrix.php-version }}-${{ hashFiles('composer.*') }}-
composer-${{ runner.os }}-${{ matrix.php-version }}-
composer-${{ runner.os }}-
composer-

- name: Install dependencies
run: |
composer update --no-interaction --prefer-dist --no-progress ${{ matrix.dependencies }}
composer update --no-interaction --prefer-dist --no-progress

- name: Collect coverage report
run: |
Expand Down
5 changes: 2 additions & 3 deletions composer.json
Expand Up @@ -52,7 +52,7 @@
"infection/extension-installer": "^0.1.0",
"infection/include-interceptor": "^0.2.5",
"justinrainbow/json-schema": "^5.2.10",
"nikic/php-parser": "^4.10.3",
"nikic/php-parser": "^4.13",
"ondram/ci-detector": "^3.3.0",
"sanmai/later": "^0.1.1",
"sanmai/pipeline": "^5.1",
Expand All @@ -67,8 +67,7 @@
"webmozart/path-util": "^2.3"
},
"conflict": {
"phpunit/php-code-coverage": ">9 <9.1.4",
"symfony/console": "=4.1.5"
Copy link
Member

Choose a reason for hiding this comment

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

could you please clarify why was it removed?

Copy link
Member Author

Choose a reason for hiding this comment

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

"phpunit/php-code-coverage": ">9 <9.1.4"
},
"require-dev": {
"ext-simplexml": "*",
Expand Down