Skip to content

Commit

Permalink
Use GitHub actions for continuous integration (CI)
Browse files Browse the repository at this point in the history
  • Loading branch information
SimonFrings committed Jun 20, 2024
1 parent 271b800 commit d6a658c
Show file tree
Hide file tree
Showing 20 changed files with 84 additions and 27 deletions.
24 changes: 24 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
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
ini-file: development
- run: composer install
- run: vendor/bin/phpunit --coverage-text
8 changes: 0 additions & 8 deletions .travis.yml

This file was deleted.

2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
# 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)

A streaming redis protocol parser and serializer written in PHP

This parser and serializer implementation allows you to parse redis protocol
Expand Down
12 changes: 11 additions & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,17 @@
"require": {
"php": ">=5.3"
},
"require-dev": {
"phpunit/phpunit": "^4.8.36"
},
"autoload": {
"psr-0": { "Clue\\Redis\\Protocol": "src" }
"psr-4": {
"Clue\\Redis\\Protocol\\": "src/Clue/Redis/Protocol/"
}
},
"autoload-dev": {
"psr-4": {
"Clue\\Tests\\Redis\\Protocol\\": "tests/"
}
}
}
16 changes: 9 additions & 7 deletions phpunit.xml.dist
Original file line number Diff line number Diff line change
@@ -1,11 +1,10 @@
<?xml version="1.0" encoding="UTF-8"?>

<phpunit bootstrap="tests/bootstrap.php"
colors="true"
convertErrorsToExceptions="true"
convertNoticesToExceptions="true"
convertWarningsToExceptions="true"
>
<!-- PHPUnit configuration file with old format for legacy PHPUnit -->
<phpunit xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="https://schema.phpunit.de/4.8/phpunit.xsd"
bootstrap="vendor/autoload.php"
colors="true">
<testsuites>
<testsuite name="Redis Protocol Test Suite">
<directory>./tests/</directory>
Expand All @@ -16,4 +15,7 @@
<directory>./src/</directory>
</whitelist>
</filter>
</phpunit>
<php>
<ini name="error_reporting" value="-1" />
</php>
</phpunit>
2 changes: 2 additions & 0 deletions tests/FactoryTest.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
<?php

namespace Clue\Tests\Redis\Protocol;

use Clue\Redis\Protocol\Factory;

class FactoryTest extends TestCase
Expand Down
3 changes: 3 additions & 0 deletions tests/Model/AbstractModelTest.php
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
<?php

namespace Clue\Tests\Redis\Protocol\Model;

use Clue\Redis\Protocol\Serializer\RecursiveSerializer;
use Clue\Tests\Redis\Protocol\TestCase;

abstract class AbstractModelTest extends TestCase
{
Expand Down
2 changes: 2 additions & 0 deletions tests/Model/BulkReplyTest.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
<?php

namespace Clue\Tests\Redis\Protocol\Model;

use Clue\Redis\Protocol\Model\BulkReply;

class BulkReplyTest extends AbstractModelTest
Expand Down
2 changes: 2 additions & 0 deletions tests/Model/ErrorReplyTest.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
<?php

namespace Clue\Tests\Redis\Protocol\Model;

use Clue\Redis\Protocol\Model\ErrorReply;

class ErrorReplyTest extends AbstractModelTest
Expand Down
2 changes: 2 additions & 0 deletions tests/Model/IntegerReplyTest.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
<?php

namespace Clue\Tests\Redis\Protocol\Model;

use Clue\Redis\Protocol\Model\IntegerReply;

class IntegerReplyTest extends AbstractModelTest
Expand Down
2 changes: 2 additions & 0 deletions tests/Model/MultiBulkReplyTest.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
<?php

namespace Clue\Tests\Redis\Protocol\Model;

use Clue\Redis\Protocol\Model\MultiBulkReply;
use Clue\Redis\Protocol\Model\BulkReply;
use Clue\Redis\Protocol\Model\IntegerReply;
Expand Down
2 changes: 2 additions & 0 deletions tests/Model/RequestTest.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
<?php

namespace Clue\Tests\Redis\Protocol\Model;

use Clue\Redis\Protocol\Model\Request;

class RequestTest extends AbstractModelTest
Expand Down
2 changes: 2 additions & 0 deletions tests/Model/StatusReplyTest.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
<?php

namespace Clue\Tests\Redis\Protocol\Model;

use Clue\Redis\Protocol\Model\StatusReply;

class StatusReplyTest extends AbstractModelTest
Expand Down
3 changes: 3 additions & 0 deletions tests/Parser/AbstractParserTest.php
Original file line number Diff line number Diff line change
@@ -1,7 +1,10 @@
<?php

namespace Clue\Tests\Redis\Protocol\Parser;

use Clue\Redis\Protocol\Parser\ParserInterface;
use Clue\Redis\Protocol\Parser\MessageBuffer;
use Clue\Tests\Redis\Protocol\TestCase;

abstract class AbstractParserTest extends TestCase
{
Expand Down
2 changes: 2 additions & 0 deletions tests/Parser/RequestParserTest.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
<?php

namespace Clue\Tests\Redis\Protocol\Parser;

use Clue\Redis\Protocol\Parser\RequestParser;

class RequestParserTest extends AbstractParserTest
Expand Down
2 changes: 2 additions & 0 deletions tests/Parser/ResponseParserTest.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
<?php

namespace Clue\Tests\Redis\Protocol\Parser;

use Clue\Redis\Protocol\Parser\ResponseParser;

class RecursiveParserTest extends AbstractParserTest
Expand Down
9 changes: 5 additions & 4 deletions tests/Serializer/AbstractSerializerTest.php
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
<?php

namespace Clue\Tests\Redis\Protocol\Serializer;

use Clue\Redis\Protocol\Serializer\SerializerInterface;
use Clue\Redis\Protocol\Model\Status;
use Clue\Redis\Protocol\Model\ErrorReplyException;
use Clue\Tests\Redis\Protocol\TestCase;
//use Exception;

abstract class AbstractSerializerTest extends TestCase
Expand Down Expand Up @@ -85,10 +86,10 @@ public function testArrayMultiBulkReply()

public function testErrorReply()
{
$model = $this->serializer->createReplyModel(new Exception('ERR failure'));
$model = $this->serializer->createReplyModel(new \Exception('ERR failure'));
$this->assertInstanceOf('Clue\Redis\Protocol\Model\ErrorReply', $model);
$this->assertEquals('ERR failure', $model->getValueNative());
$this->assertEquals($model->getMessageSerialized($this->serializer), $this->serializer->getReplyMessage(new Exception('ERR failure')));
$this->assertEquals($model->getMessageSerialized($this->serializer), $this->serializer->getReplyMessage(new \Exception('ERR failure')));
}

/**
Expand Down
2 changes: 2 additions & 0 deletions tests/Serializer/RecursiveSerializerTest.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
<?php

namespace Clue\Tests\Redis\Protocol\Serializer;

use Clue\Redis\Protocol\Serializer\RecursiveSerializer;

class RecursiveSerializerTest extends AbstractSerializerTest
Expand Down
7 changes: 7 additions & 0 deletions tests/TestCase.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
<?php

namespace Clue\Tests\Redis\Protocol;

class TestCase extends \PHPUnit_Framework_TestCase
{
}
7 changes: 0 additions & 7 deletions tests/bootstrap.php

This file was deleted.

0 comments on commit d6a658c

Please sign in to comment.