Skip to content

Commit

Permalink
Updated with instructions for installing older versions (1.x.x suppor…
Browse files Browse the repository at this point in the history
…ts PHP 7.1+) and updates the PHPUnit version to support testing against PHP 8.0 too.
  • Loading branch information
allebb committed Dec 23, 2020
1 parent d67104f commit aa1bb7a
Show file tree
Hide file tree
Showing 6 changed files with 1,098 additions and 418 deletions.
21 changes: 2 additions & 19 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,7 @@ jobs:
strategy:
fail-fast: false
matrix:
#php-versions: [ '7.3', '7.4', '8.0' ]
php-versions: [ '7.1', '7.2', '7.3', '7.4' ]
php-versions: [ '7.3', '7.4', '8.0' ]

steps:
- name: Checkout
Expand All @@ -28,26 +27,9 @@ jobs:
id: composer-cache
run: echo "::set-output name=dir::$(composer config cache-files-dir)"

#- name: Cache composer dependencies
# uses: actions/cache@v2
# with:
# path: ${{ steps.composer-cache.outputs.dir }}
# # Use composer.json for key, if composer.lock is not committed.
# # key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.json') }}
# key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.lock') }}
# restore-keys: ${{ runner.os }}-composer-

- name: Install Composer dependencies
run: composer install --no-suggest --no-progress --prefer-dist --optimize-autoloader

#- name: PHPUnit Tests
# uses: php-actions/phpunit@v1
# with:
# bootstrap: vendor/autoload.php
# configuration: phpunit.xml
# args: --coverage-text
# memory_limit: 256M

- name: PHPUnit Tests
run: vendor/bin/phpunit --coverage-clover=coverage.xml

Expand All @@ -67,4 +49,5 @@ jobs:

# Uploading reports for analysis
- name: Uploading code coverage to scrutinize
continue-on-error: true
run: php ocular.phar code-coverage:upload --format=php-clover coverage.xml
18 changes: 13 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,11 @@ A RaspberryPi GPIO library written in PHP, This library makes it a breeze to wor

## Requirements

* PHP >= 7.1.0
* PHP >= 7.3.0

This library is unit tested against PHP 7.1, 7.2, 7.3 and 7.4!
This library is unit tested against PHP 7.3, 7.4 and 8.0!

If you need to use an older version of PHP, you should instead install the 2.x version of this library (see below for details).

License
-------
Expand All @@ -24,12 +26,18 @@ This library is released under the [GPLv3](https://raw.githubusercontent.com/all
Installation
------------

The recommended way of installing this library is via. [Composer](http://getcomposer.org); To install using Composer type the following command at the console:
The recommended way of installing the latest version of this library is via. [Composer](http://getcomposer.org); To install using Composer type the following command at the console:

```shell
composer require ballen/gpio
```

**If you need to use an older version of PHP, version 1.x.x supports PHP 7.1 and 7.2, you can install this version using Composer with this command instead:**

```shell
composer require ballen/gpio ^1.0
```

Example usage
-------------

Expand Down Expand Up @@ -62,7 +70,7 @@ Tests and coverage

This library is fully unit tested using [PHPUnit](https://phpunit.de/).

I use [TravisCI](https://travis-ci.org/) for continuous integration, which triggers tests for PHP 7.1, 7.2, 7.3 and 7.4 every time a commit is pushed.
I use [GitHub Actions](https://github.com/) for continuous integration, which triggers tests for PHP 7.3, 7.4 and 8.0 every time a commit is pushed.

If you wish to run the tests yourself you should run the following:

Expand All @@ -74,7 +82,7 @@ composer install
./vendor/bin/phpunit
```

Code coverage can also be ran and a report generated (this does require XDebug to be installed)...
Code coverage can also be run and a report generated (this does require XDebug to be installed)...

```shell
./vendor/bin/phpunit --coverage-html ./report
Expand Down
4 changes: 2 additions & 2 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,10 @@
}
],
"require": {
"php": ">=7.1.0"
"php": ">=7.3.0"
},
"require-dev": {
"phpunit/phpunit": "5.7.*"
"phpunit/phpunit": "^9.0"
},
"autoload": {
"psr-4": {
Expand Down
Loading

0 comments on commit aa1bb7a

Please sign in to comment.