From 4bb63444b678f84e03c9c3eb7fa94debb9b6ddda Mon Sep 17 00:00:00 2001 From: Simon Frings Date: Thu, 20 Jun 2024 15:13:33 +0200 Subject: [PATCH] Use GitHub actions for continuous integration (CI) --- .github/workflows/ci.yml | 23 +++++++++++++++++++++ .travis.yml | 8 ------- README.md | 3 +++ composer.json | 12 ++++++++++- phpunit.xml.dist | 16 +++++++------- tests/Parser/ResponseParserTest.php | 2 +- tests/Serializer/AbstractSerializerTest.php | 2 -- tests/TestCase.php | 5 +++++ tests/bootstrap.php | 7 ------- 9 files changed, 52 insertions(+), 26 deletions(-) create mode 100644 .github/workflows/ci.yml delete mode 100644 .travis.yml create mode 100644 tests/TestCase.php delete mode 100644 tests/bootstrap.php diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml new file mode 100644 index 0000000..57967cf --- /dev/null +++ b/.github/workflows/ci.yml @@ -0,0 +1,23 @@ +name: CI + +on: + push: + pull_request: + +jobs: + PHPUnit: + name: PHPUnit (PHP ${{ matrix.php }}) + runs-on: ubuntu-22.04 + strategy: + matrix: + php: + - 5.4 + - 5.3 + steps: + - uses: actions/checkout@v4 + - uses: shivammathur/setup-php@v2 + with: + php-version: ${{ matrix.php }} + coverage: xdebug + - run: composer install + - run: vendor/bin/phpunit --coverage-text diff --git a/.travis.yml b/.travis.yml deleted file mode 100644 index 2af5cf5..0000000 --- a/.travis.yml +++ /dev/null @@ -1,8 +0,0 @@ -language: php -php: - - 5.4 - - 5.3 -before_script: - - composer install --dev --prefer-source --no-interaction -script: - - phpunit --coverage-text diff --git a/README.md b/README.md index ea36a67..1b68cfa 100644 --- a/README.md +++ b/README.md @@ -1,5 +1,8 @@ # clue/redis-protocol [![Build Status](https://travis-ci.org/clue/php-redis-protocol.png?branch=master)](https://travis-ci.org/clue/php-redis-protocol) +[![CI status](https://github.com/clue/php-redis-protocol/actions/workflows/ci.yml/badge.svg)](https://github.com/clue/php-redis-protocol/actions) +[![installs on Packagist](https://img.shields.io/packagist/dt/clue/redis-protocol?color=blue&label=installs%20on%20Packagist)](https://packagist.org/packages/clue/redis-protocol) + A streaming redis protocol parser and serializer written in PHP This parser and serializer implementation allows you to parse redis protocol diff --git a/composer.json b/composer.json index d99e2ee..7c7b5e3 100644 --- a/composer.json +++ b/composer.json @@ -13,7 +13,17 @@ "require": { "php": ">=5.3" }, + "require-dev": { + "phpunit/phpunit": "^4.8.36" + }, "autoload": { - "psr-0": { "Clue\\Redis\\Protocol": "src" } + "psr-0": { + "Clue\\Redis\\Protocol": "src/" + } + } , + "autoload-dev": { + "psr-0": { + "": "tests/" + } } } diff --git a/phpunit.xml.dist b/phpunit.xml.dist index 4f3de2a..f66a042 100644 --- a/phpunit.xml.dist +++ b/phpunit.xml.dist @@ -1,11 +1,10 @@ - + + ./tests/ @@ -16,4 +15,7 @@ ./src/ - \ No newline at end of file + + + + diff --git a/tests/Parser/ResponseParserTest.php b/tests/Parser/ResponseParserTest.php index 762c8bd..d102621 100644 --- a/tests/Parser/ResponseParserTest.php +++ b/tests/Parser/ResponseParserTest.php @@ -2,7 +2,7 @@ use Clue\Redis\Protocol\Parser\ResponseParser; -class RecursiveParserTest extends AbstractParserTest +class ResponseParserTest extends AbstractParserTest { protected function createParser() { diff --git a/tests/Serializer/AbstractSerializerTest.php b/tests/Serializer/AbstractSerializerTest.php index ba2200a..a6d1c40 100644 --- a/tests/Serializer/AbstractSerializerTest.php +++ b/tests/Serializer/AbstractSerializerTest.php @@ -1,8 +1,6 @@