Skip to content

Commit 904f383

Browse files
Move CI to GitHub actions (#49)
* CI: Move to GitHub actions * lib: fix issues found by PHPStan * CI: Install redis for phpunit * CI: remove unused code coverage providers * Add PHPCS config for PSR12-with-tabs Co-authored-by: Dan Hunsaker <[email protected]>
1 parent 95e337d commit 904f383

File tree

8 files changed

+78
-29
lines changed

8 files changed

+78
-29
lines changed

.github/dependabot.yml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
version: 2
2+
updates:
3+
- package-ecosystem: "composer"
4+
directory: "/"
5+
schedule:
6+
interval: "daily"

.github/workflows/php-test.yml

Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
name: PHP Tests
2+
on: [push, pull_request]
3+
4+
jobs:
5+
php:
6+
runs-on: ubuntu-latest
7+
continue-on-error: ${{ matrix.experimental }}
8+
name: "PHP-${{ matrix.php-versions }}: CS/PHPStan/PHPUnit"
9+
strategy:
10+
matrix:
11+
php-versions: ['7.3', '7.4']
12+
experimental: [false]
13+
include:
14+
- php-versions: '8.0'
15+
experimental: true
16+
steps:
17+
- name: Checkout
18+
uses: actions/checkout@v2
19+
20+
- name: Setup PHP
21+
uses: shivammathur/setup-php@v2
22+
with:
23+
php-version: ${{ matrix.php-versions }}
24+
tools: cs2pr, phpcs, phpstan, phpunit
25+
extensions: redis
26+
27+
- name: Setup problem matchers for PHP
28+
run: echo "::add-matcher::${{ runner.tool_cache }}/php.json"
29+
30+
- name: Run PHPCS
31+
continue-on-error: true
32+
run: phpcs -q --report=checkstyle lib | cs2pr
33+
34+
- name: Install dependencies
35+
run: composer install
36+
37+
- name: Run PHPStan
38+
run: phpstan analyse lib -l1
39+
40+
- name: Install redis
41+
run: sudo apt-get install -y redis-server
42+
43+
- name: Setup problem matchers for PHPUnit
44+
run: echo "::add-matcher::${{ runner.tool_cache }}/phpunit.json"
45+
46+
- name: Run PHPunit
47+
run: phpunit --configuration phpunit.xml.dist

.travis.yml

Lines changed: 0 additions & 23 deletions
This file was deleted.

README.md

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,15 +11,13 @@ jobs on one or more queues, and processing them later.
1111
[![Latest Unstable Version](https://img.shields.io/packagist/vpre/resque/php-resque.svg?style=flat-square)](https://packagist.org/packages/resque/php-resque)
1212
[![Downloads](https://img.shields.io/packagist/dt/resque/php-resque.svg?style=flat-square)](https://packagist.org/packages/resque/php-resque)
1313

14-
[![Build Status](https://img.shields.io/travis/resque/php-resque.svg?style=flat-square&logo=travis)](http://travis-ci.org/resque/php-resque)
15-
[![Code Quality](https://img.shields.io/scrutinizer/g/resque/php-resque.svg?style=flat-square&logo=scrutinizer)](https://scrutinizer-ci.com/g/resque/php-resque/)
16-
[![Code Coverage](https://img.shields.io/scrutinizer/coverage/g/resque/php-resque.svg?style=flat-square&logo=scrutinizer)](https://scrutinizer-ci.com/g/resque/php-resque/)
14+
[![Build Status](https://img.shields.io/github/checks-status/resque/php-resque/master)]()
1715
[![Dependency Status](https://img.shields.io/librariesio/github/resque/php-resque.svg?style=flat-square)](https://libraries.io/github/resque/php-resque)
1816

1917
[![Latest Release](https://img.shields.io/github/release/resque/php-resque.svg?style=flat-square&logo=github&logoColor=white)](https://github.com/resque/php-resque)
2018
[![Latest Release Date](https://img.shields.io/github/release-date/resque/php-resque.svg?style=flat-square&logo=github&logoColor=white)](https://github.com/resque/php-resque)
2119
[![Commits Since Latest Release](https://img.shields.io/github/commits-since/resque/php-resque/latest.svg?style=flat-square&logo=github&logoColor=white)](https://github.com/resque/php-resque)
22-
[![Maintenance Status](https://img.shields.io/maintenance/yes/2020.svg?style=flat-square&logo=github&logoColor=white)](https://github.com/resque/php-resque)
20+
[![Maintenance Status](https://img.shields.io/maintenance/yes/2021.svg?style=flat-square&logo=github&logoColor=white)](https://github.com/resque/php-resque)
2321

2422
[![Contributors](https://img.shields.io/github/contributors/resque/php-resque.svg?style=flat-square&logo=github&logoColor=white)](https://github.com/resque/php-resque)
2523
[![Chat on Slack](https://img.shields.io/badge/chat-Slack-blue.svg?style=flat-square&logo=slack&logoColor=white)](https://join.slack.com/t/php-resque/shared_invite/enQtNTIwODk0OTc1Njg3LWYyODczMTZjMzI2N2JkYWUzM2FlNDk5ZjY2ZGM4Njc4YjFiMzU2ZWFjOGQxMDIyNmE5MTBlNWEzODBiMmVmOTI)

lib/Resque/Redis.php

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,12 @@ class Resque_Redis
2929
*/
3030
const DEFAULT_DATABASE = 0;
3131

32+
/**
33+
* Connection driver
34+
* @var mixed
35+
*/
36+
private $driver;
37+
3238
/**
3339
* @var array List of all commands in Redis that supply a key as their
3440
* first argument. Used to prefix keys with the Resque namespace.

lib/Resque/Worker.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ class Resque_Worker
1717
private static $processPrefix = 'resque';
1818

1919
/**
20-
* @var LoggerInterface Logging object that impliments the PSR-3 LoggerInterface
20+
* @var Psr\Log\LoggerInterface Logging object that impliments the PSR-3 LoggerInterface
2121
*/
2222
public $logger;
2323

lib/ResqueScheduler.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,7 @@ public static function getDelayedQueueScheduleSize()
8787
*/
8888
public static function getDelayedTimestampSize($timestamp)
8989
{
90-
$timestamp = self::toTimestamp($timestamp);
90+
$timestamp = self::getTimestamp($timestamp);
9191
return Resque::redis()->llen('delayed:' . $timestamp, $timestamp);
9292
}
9393

phpcs.xml.dist

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
<?xml version="1.0"?>
2+
<ruleset name="MyStandard">
3+
<description>PSR2 with tabs instead of spaces.</description>
4+
<arg name="tab-width" value="4"/>
5+
<rule ref="PSR12">
6+
<exclude name="Generic.WhiteSpace.DisallowTabIndent"/>
7+
</rule>
8+
<rule ref="Generic.WhiteSpace.DisallowSpaceIndent"/>
9+
<rule ref="Generic.WhiteSpace.ScopeIndent">
10+
<properties>
11+
<property name="indent" value="4"/>
12+
<property name="tabIndent" value="true"/>
13+
</properties>
14+
</rule>
15+
</ruleset>

0 commit comments

Comments
 (0)