Skip to content

Commit

Permalink
Merge pull request #198 from GrahamCampbell/patch-1
Browse files Browse the repository at this point in the history
PHP 8.0 support
  • Loading branch information
dbu committed Jul 13, 2020
2 parents 75470e5 + 2895bd8 commit 1faee5b
Show file tree
Hide file tree
Showing 4 changed files with 124 additions and 50 deletions.
1 change: 0 additions & 1 deletion .gitattributes
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
/.php_cs export-ignore
/.scrutinizer.yml export-ignore
/.styleci.yml export-ignore
/.travis.yml export-ignore
/behat.yml.dist export-ignore
/features/ export-ignore
/phpspec.ci.yml export-ignore
Expand Down
121 changes: 121 additions & 0 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,121 @@
name: tests

on:
push:
pull_request:

jobs:
latest:
name: PHP ${{ matrix.php }} Latest
runs-on: ubuntu-latest
strategy:
matrix:
php: ['7.1', '7.2', '7.3', '7.4', '8.0']

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

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

- name: Install PHP 7 dependencies
run: composer update --prefer-dist --no-interaction --no-progress
if: "matrix.php != '8.0'"

- name: Install PHP 8 dependencies
run: |
composer require "phpunit/phpunit:^9.3@dev" "phpunit/php-code-coverage:^9.0@dev" "sebastian/global-state:^5.0@dev" "phpdocumentor/reflection-docblock:^5.2@dev" --no-interaction --no-update
composer update --prefer-dist --no-interaction --no-progress --ignore-platform-req=php
if: "matrix.php == '8.0'"

- name: Execute tests
run: composer test

lowest:
name: PHP ${{ matrix.php }} Lowest
runs-on: ubuntu-latest
strategy:
matrix:
php: ['7.1', '7.2', '7.3', '7.4']

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

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

- name: Install dependencies
run: |
composer require "sebastian/comparator:^3.0.2" --no-interaction --no-update
composer update --prefer-dist --prefer-stable --prefer-lowest --no-interaction --no-progress
- name: Execute tests
run: composer test

symfony:
name: Symfony ${{ matrix.symfony }} LTS
runs-on: ubuntu-latest
strategy:
matrix:
symfony: ['2', '3', '4']

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

- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: 7.1
tools: composer:v2
coverage: none

- name: Pin old packages
run: composer require "phpspec/phpspec:^2.5.8" --no-interaction --no-update
if: "matrix.symfony == '2'"

- name: Install dependencies
run: |
composer require dunglas/symfony-lock:v${{ matrix.symfony }} --no-interaction --no-update
composer update --prefer-dist --no-interaction --prefer-stable --prefer-lowest --no-progress
- name: Execute tests
run: composer test

coverage:
name: Code Coverage
runs-on: ubuntu-latest

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

- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: 7.4
tools: composer:v2
coverage: xdebug

- name: Install dependencies
run: |
composer require "friends-of-phpspec/phpspec-code-coverage:^4.3.2" --no-interaction --no-update
composer update --prefer-dist --no-interaction --no-progress
- name: Execute tests
run: composer test-ci

- name: Upload coverage
run: |
wget https://scrutinizer-ci.com/ocular.phar
php ocular.phar code-coverage:upload --format=php-clover build/coverage.xml
45 changes: 0 additions & 45 deletions .travis.yml

This file was deleted.

7 changes: 3 additions & 4 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
}
],
"require": {
"php": "^7.1",
"php": "^7.1 || ^8.0",
"php-http/httplug": "^2.0",
"php-http/message-factory": "^1.0",
"php-http/message": "^1.6",
Expand All @@ -26,9 +26,8 @@
"guzzlehttp/psr7": "^1.4",
"nyholm/psr7": "^1.2",
"phpspec/phpspec": "^5.1 || ^6.0",
"phpspec/prophecy": "^1.8",
"phpunit/phpunit": "^7.5",
"sebastian/comparator": "^3.0"
"phpspec/prophecy": "^1.10.2",
"phpunit/phpunit": "^7.5.15 || ^8.5 || ^9.3"
},
"suggest": {
"ext-json": "To detect JSON responses with the ContentTypePlugin",
Expand Down

0 comments on commit 1faee5b

Please sign in to comment.