-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
v1.x: chore(ci): Use GitHub Actions instead of Travis (#9)
* v1.x: chore(ci): Use GitHub Actions instead of Travis * v1.x: fix(ci): Remove leading dot for phpunit XML files This will make it possible for PHPUnit to autodiscover those files and mirrors the repo state on the main branch. * v1.x: fix(ci): Reference matrix.php-versions correctly * v1.x: fix(ci): Add test bootstrap for PHPUnit 4.8 on PHP 8 support * v1.x: fix: Add missing PHP 8 support PHP 8 uses an image class instead of resources for GD images. See #3. We can simply adapt the behavior to be conditional, to hopefully gain support for all PHP versions from 5.3.3 to 8. * v1.x: fix(tests): Skip resource freeing test on PHP 8
- Loading branch information
Showing
11 changed files
with
128 additions
and
40 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
name: CI | ||
|
||
on: | ||
push: | ||
branches: | ||
- main | ||
- v*.x | ||
pull_request: | ||
|
||
jobs: | ||
test: | ||
runs-on: ubuntu-latest | ||
strategy: | ||
matrix: | ||
php-versions: ['5.3', '5.4', '5.5', '5.6', '7.2', '7.3', '7.4', '8'] | ||
steps: | ||
- uses: actions/checkout@v2 | ||
|
||
- name: Setup PHP ${{ matrix.php-versions }} | ||
uses: shivammathur/setup-php@v2 | ||
with: | ||
php-version: ${{ matrix.php-versions }} | ||
extensions: gd | ||
coverage: none | ||
ini-values: auto_prepend_file="${{github.workspace}}/tests/bootstrap.php" | ||
|
||
- name: Cache Composer packages | ||
id: composer-cache | ||
uses: actions/cache@v2 | ||
with: | ||
path: vendor | ||
key: ${{ runner.os }}-php-${{ hashFiles('**/composer.lock') }} | ||
restore-keys: | | ||
${{ runner.os }}-php- | ||
- name: Install dependencies | ||
run: composer install --prefer-dist --no-progress | ||
|
||
- name: Run test suite (PHP 5.3) | ||
if: ${{ matrix.php-versions == '5.3' }} | ||
run: vendor/bin/phpunit --configuration phpunit53.xml | ||
|
||
- name: Run test suite | ||
if: ${{ matrix.php-versions != '5.3' }} | ||
run: vendor/bin/phpunit |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,5 @@ | ||
.DS_Store | ||
vendor/ | ||
.idea | ||
.phpunit.result.cache | ||
composer.lock |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
<?php | ||
<?php | ||
|
||
use PHPUnit\Framework\TestCase; | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
<?php | ||
|
||
/* | ||
* This file provides functions from older PHP versions that are no longer present in newer versions. | ||
* This is needed because we are on PHPUnit 4.8 which was built long before some things were deprecated. | ||
* | ||
* Load this file before anything else is run, preferably through php.ini auto_prepend_file. | ||
*/ | ||
|
||
if (!function_exists('each')) { | ||
function each(&$array) | ||
{ | ||
if (!is_array($array) && !is_object($array)) { | ||
return null; | ||
} | ||
$key = key($array); | ||
if ($key === null) { | ||
return false; | ||
} | ||
$value = $array[$key]; | ||
next($array); | ||
return array( | ||
0 => $key, | ||
'key' => $key, | ||
1 => $value, | ||
'value' => $value, | ||
); | ||
} | ||
} |