Skip to content

Commit

Permalink
Support PHP 8.1 (#140)
Browse files Browse the repository at this point in the history
  • Loading branch information
GrahamCampbell authored Oct 2, 2021
1 parent c1dd809 commit e32022e
Show file tree
Hide file tree
Showing 4 changed files with 53 additions and 10 deletions.
41 changes: 36 additions & 5 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,11 @@ jobs:
strategy:
max-parallel: 10
matrix:
php: [ '5.5', '5.6', '7.0', '7.1', '7.2', '7.3', '7.4', '8.0']
php: ['5.5', '5.6', '7.0', '7.1', '7.2', '7.3', '7.4']

steps:
- name: Set up PHP
uses: shivammathur/setup-php@2.5.0
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php }}
coverage: none
Expand All @@ -22,17 +22,48 @@ jobs:
uses: actions/checkout@v2

- name: Download dependencies
run: composer update --no-interaction --prefer-dist --optimize-autoloader --prefer-stable
run: composer update --no-interaction --optimize-autoloader --prefer-stable

- name: Run tests
run: ./vendor/bin/simple-phpunit

build8:
name: Build PHP 8
runs-on: ubuntu-latest
strategy:
max-parallel: 10
matrix:
php: ['8.0', '8.1']

steps:
- name: Set up PHP
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php }}
coverage: none
tools: flex

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

- name: Mimic PHP 8.0
run: composer config platform.php 8.0.999
if: matrix.php > 8

- name: Download dependencies
run: composer update --no-interaction --optimize-autoloader --prefer-stable

- name: Run tests
run: ./vendor/bin/simple-phpunit
env:
SYMFONY_PHPUNIT_VERSION: 9.5

lowest:
name: Lowest deps
runs-on: ubuntu-latest
steps:
- name: Set up PHP
uses: shivammathur/setup-php@2.5.0
uses: shivammathur/setup-php@v2
with:
php-version: 7.3
coverage: pcov
Expand All @@ -41,7 +72,7 @@ jobs:
uses: actions/checkout@v2

- name: Download dependencies
run: composer update --no-interaction --prefer-dist --optimize-autoloader --prefer-stable --prefer-lowest
run: composer update --no-interaction --optimize-autoloader --prefer-stable --prefer-lowest

- name: Run tests
env:
Expand Down
19 changes: 15 additions & 4 deletions .github/workflows/static.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ jobs:

- name: Download dependencies
run: |
composer update --no-interaction --prefer-dist --optimize-autoloader
composer update --no-interaction --optimize-autoloader
- name: PHPStan
uses: docker://oskarstark/phpstan-ga:0.12.25
Expand All @@ -28,10 +28,21 @@ jobs:
- name: Checkout code
uses: actions/checkout@v2

- name: PHP-CS-Fixer
uses: OskarStark/[email protected]
- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
args: --dry-run --diff-format udiff
php-version: '7.4'
coverage: none
extensions: mbstring

- name: Download dependencies
run: composer update --no-interaction --no-progress

- name: Download PHP CS Fixer
run: composer require "friendsofphp/php-cs-fixer:2.18.4"

- name: Execute PHP CS Fixer
run: vendor/bin/php-cs-fixer fix --diff-format udiff --dry-run

psalm:
name: Psalm
Expand Down
2 changes: 1 addition & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ before_install:
- if [[ "$TRAVIS_PHP_VERSION" != "hhvm-3.24" ]]; then echo "xdebug.overload_var_dump = 1" >> ~/.phpenv/versions/$(phpenv version-name)/etc/php.ini; fi

install:
- travis_retry composer update --prefer-dist
- travis_retry composer update
- travis_retry ./vendor/bin/simple-phpunit install

script:
Expand Down
1 change: 1 addition & 0 deletions tests/Thing2.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@

class Thing2 implements \JsonSerializable
{
#[\ReturnTypeWillChange]
public function jsonSerialize()
{
return '{}';
Expand Down

0 comments on commit e32022e

Please sign in to comment.