Skip to content

Commit

Permalink
Add PHP 8.0 to build matrix
Browse files Browse the repository at this point in the history
  • Loading branch information
xemlock committed Jan 2, 2021
1 parent fff1a4a commit b82ea17
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 4 deletions.
23 changes: 20 additions & 3 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ jobs:
fail-fast: false
matrix:
operating-system: ['ubuntu-16.04']
php-versions: ['7.4', '7.3', '7.2', '7.1', '7.0', '5.6', '5.5', '5.4', '5.3']
php-versions: ['8.0', '7.4', '7.3', '7.2', '7.1', '7.0', '5.6', '5.5', '5.4', '5.3']

steps:
- name: Checkout
Expand All @@ -24,8 +24,23 @@ jobs:
ini-values: max_execution_time=0
coverage: xdebug

- name: Setup PHP_VERSION env variable
run: |
echo PHP_VERSION=$(echo "<?php echo join('.', array_slice(explode('.', PHP_VERSION), 0, 2)); " | php) >> $GITHUB_ENV
- name: Install dependencies
run: composer install
run: |
echo PHP_VERSION: ${{ env.PHP_VERSION }}
if [[ "${{ env.PHP_VERSION }}" = 8.* ]]; then
composer require --no-update phpunit/phpunit:^8.0.0
fi
composer install
if [[ "${{ env.PHP_VERSION }}" = 8.* ]]; then
# Remove return type annotation from setUp() and tearDown(), to allow test cases
# to be executed in phpunit 8.* versions
sed -i -- 's/protected function \(setUp\)(): void/protected function \1()/g' vendor/phpunit/phpunit/src/Framework/TestCase.php
sed -i -- 's/protected function \(tearDown\)(): void/protected function \1()/g' vendor/phpunit/phpunit/src/Framework/TestCase.php
fi
- name: Run tests
run: |
Expand All @@ -36,4 +51,6 @@ jobs:
env:
COVERALLS_REPO_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
if [ -f "vendor/bin/php-coveralls" ]; then php vendor/bin/php-coveralls -v; fi
if [ -f "build/logs/clover.xml" ] && [ -f "vendor/bin/php-coveralls" ]; then
php vendor/bin/php-coveralls -v;
fi
2 changes: 1 addition & 1 deletion phpunit.xml.dist
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
</testsuite>
</testsuites>
<filter>
<whitelist>
<whitelist processUncoveredFilesFromWhitelist="true">
<directory suffix=".php">./library</directory>
</whitelist>
</filter>
Expand Down

0 comments on commit b82ea17

Please sign in to comment.