Skip to content

Commit

Permalink
Add GitHub workflows, test on PHP 8 (#31)
Browse files Browse the repository at this point in the history
* Add GitHub workflows, test on PHP 8

* Reflect that package is not installable under PHP <5.6 due to deps
  • Loading branch information
sanmai committed Jan 1, 2021
1 parent c98a430 commit f6e1821
Show file tree
Hide file tree
Showing 4 changed files with 65 additions and 4 deletions.
60 changes: 60 additions & 0 deletions .github/workflows/ci.yaml
@@ -0,0 +1,60 @@
# yamllint disable rule:line-length
# yamllint disable rule:braces

name: Continuous Integration

on:
pull_request:
push:
branches:
- main
- master

jobs:
tests:
runs-on: ${{ matrix.operating-system }}

strategy:
matrix:
operating-system: ['ubuntu-latest']
php-version: ['5.6', '7.0', '7.1', '7.2', '7.3', '7.4', '8.0']

name: CI on ${{ matrix.operating-system }} with PHP ${{ matrix.php-version }}

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

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

- name: Get composer cache directory
id: composer-cache
run: echo "::set-output name=dir::$(composer config cache-files-dir)"

- name: Cache dependencies
uses: actions/cache@v2
with:
path: ${{ steps.composer-cache.outputs.dir }}
key: composer-${{ runner.os }}-${{ matrix.php-version }}-${{ hashFiles('composer.*') }}-${{ matrix.composer-flags }}
restore-keys: |
composer-${{ runner.os }}-${{ matrix.php-version }}-${{ hashFiles('composer.*') }}-
composer-${{ runner.os }}-${{ matrix.php-version }}-
composer-${{ runner.os }}-
composer-
- name: Install dependencies
run: |
composer update --no-interaction --prefer-dist --no-progress ${{ matrix.composer-flags }}
- name: Run tests
run: |
vendor/bin/phpunit
- name: Lint code
run: |
find Spreadsheet/ -type f -name \*.php | xargs -n1 php -l
5 changes: 3 additions & 2 deletions composer.json
Expand Up @@ -31,14 +31,15 @@
}
],
"require": {
"php": ">=5.3.3 <7.5",
"php": ">=5.6",
"pear/ole": ">=1.0.0RC4",
"pear/pear-core-minimal": "^1.10"
},
"require-dev": {
"friendsofphp/php-cs-fixer": "^2",
"php-coveralls/php-coveralls": "^2.2",
"phpunit/phpunit": "<6.0"
"phpunit/phpunit": ">=5 <10",
"sanmai/phpunit-legacy-adapter": "^6 || ^8"
},
"autoload": {
"psr-0": {
Expand Down
2 changes: 1 addition & 1 deletion test/Test/Spreadsheet/Excel/Writer/WorkbookTest.php
Expand Up @@ -6,7 +6,7 @@
*/
class Test_Spreadsheet_Excel_Writer_WorkbookTest extends Test_Spreadsheet_Excel_WriterTestCase
{
public static function setUpBeforeClass()
public static function doSetUpBeforeClass()
{
// Preload constants from OLE
@class_exists(OLE::class);
Expand Down
2 changes: 1 addition & 1 deletion test/Test/Spreadsheet/Excel/WriterTestCase.php
Expand Up @@ -4,7 +4,7 @@
* @author stev leibelt <artodeto@bazzline.net>
* @since 2016-01-17
*/
class Test_Spreadsheet_Excel_WriterTestCase extends PHPUnit_Framework_TestCase
class Test_Spreadsheet_Excel_WriterTestCase extends \LegacyPHPUnit\TestCase
{
const FIXTURES_PATH = 'test/fixture/';

Expand Down

0 comments on commit f6e1821

Please sign in to comment.