Skip to content

Commit

Permalink
Allow PHP 8.0 (#38)
Browse files Browse the repository at this point in the history
* Allow PHP 8.0

* Updated PHPUnit config

* Check PHP 8.0

* Remove PHP 7.1 from testing matrix
  • Loading branch information
yann-eugone authored May 10, 2021
1 parent 17e669f commit 89143e5
Show file tree
Hide file tree
Showing 5 changed files with 108 additions and 62 deletions.
51 changes: 0 additions & 51 deletions .github/workflows/ci.yml

This file was deleted.

98 changes: 98 additions & 0 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,98 @@
name: "Tests"

on:
pull_request: null
push:
branches:
- "3.x"

jobs:
phpunit:
name: "PHPUnit"
runs-on: ubuntu-latest

strategy:
matrix:
include:
- php-version: 7.4
symfony-version: 4.4.*
- php-version: 8.0
symfony-version: 4.4.*
- php-version: 7.4
symfony-version: 5.2.*
- php-version: 8.0
symfony-version: 5.2.*

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

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

- name: "Install dependencies with composer"
run: |
composer require --no-update --dev symfony/symfony:${{ matrix.symfony-version }}
composer update --no-interaction --no-progress --no-suggest
- name: "Run tests with phpunit/phpunit"
run: vendor/bin/phpunit

codecov:
name: "Code coverage"
runs-on: ubuntu-latest

strategy:
matrix:
include:
- php-version: 8.0

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

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

- name: "Install dependencies with composer"
run: composer update --no-interaction --no-progress --no-suggest

- name: "Run tests with phpunit/phpunit"
env:
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
run: |
vendor/bin/phpunit --coverage-clover coverage.xml
- name: "Upload coverage to Codecov"
uses: codecov/codecov-action@v1

checkstyke:
name: "Checkstyle"
runs-on: ubuntu-latest

strategy:
matrix:
include:
- php-version: 8.0

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

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

- name: "Install dependencies with composer"
run: composer update --no-interaction --no-progress --no-suggest

- name: "Run checkstyle with squizlabs/php_codesniffer"
run: vendor/bin/phpcs
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
/.idea/
/vendor/
/.phpcs-cache
/.phpunit.result.cache
/composer.lock
/docker-compose.yml
/phpunit.xml
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
}
],
"require": {
"php": "^7.1.3",
"php": "^7.1.3|^8.0",
"symfony/framework-bundle": "^4.4|^5.0"
},
"require-dev": {
Expand Down
18 changes: 8 additions & 10 deletions phpunit.xml.dist
Original file line number Diff line number Diff line change
@@ -1,25 +1,23 @@
<?xml version="1.0" encoding="UTF-8"?>

<phpunit backupGlobals="false"
<phpunit xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="https://schema.phpunit.de/9.3/phpunit.xsd"
backupGlobals="false"
backupStaticAttributes="false"
convertErrorsToExceptions="true"
convertNoticesToExceptions="true"
convertWarningsToExceptions="true"
processIsolation="false"
stopOnFailure="false"
colors="true"
bootstrap="vendor/autoload.php"
>

bootstrap="vendor/autoload.php">
<testsuites>
<testsuite name="YokaiEnumBundle Test Suite">
<directory>./tests</directory>
</testsuite>
</testsuites>

<filter>
<whitelist>
<coverage>
<include>
<directory>./src</directory>
</whitelist>
</filter>
</include>
</coverage>
</phpunit>

0 comments on commit 89143e5

Please sign in to comment.