Skip to content

Commit 458434e

Browse files
committed
Added GitHub workflow in lieu of Travis build.
1 parent 3dfc1b3 commit 458434e

File tree

5 files changed

+61
-38
lines changed

5 files changed

+61
-38
lines changed

.github/workflows/Tests.yaml

Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
name: Tests
2+
3+
on:
4+
push:
5+
workflow_dispatch:
6+
7+
jobs:
8+
Test:
9+
runs-on: ubuntu-latest
10+
11+
strategy:
12+
fail-fast: false
13+
matrix:
14+
php:
15+
- 8.1
16+
- 8.2
17+
dependencies:
18+
- hi
19+
- lo
20+
21+
steps:
22+
- uses: actions/checkout@v2
23+
24+
- name: Setup PHP ${{ matrix.php }}
25+
uses: shivammathur/setup-php@v2
26+
with:
27+
php-version: ${{ matrix.php }}
28+
coverage: xdebug
29+
30+
- name: Validate composer.json
31+
run: composer validate
32+
33+
- name: Cache dependencies
34+
id: composer-cache
35+
uses: actions/cache@v2
36+
with:
37+
path: vendor
38+
key: php-${{ matrix.php }}-${{ matrix.dependencies }}-${{ hashFiles('composer.json') }}
39+
restore-keys: php-${{ matrix.php }}-${{ matrix.dependencies }}-
40+
41+
- name: Install dependencies ${{ matrix.dependencies == 'lo' && '(lowest)' || '' }}
42+
run: composer update --no-interaction --no-progress
43+
${{ matrix.dependencies == 'lo' && '--prefer-lowest' || '' }}
44+
45+
- name: Run test suite with coverage
46+
run: composer test -- --coverage-clover=build/logs/clover.xml
47+
48+
- name: Upload test coverage
49+
run: composer global require php-coveralls/php-coveralls && php-coveralls -v
50+
env:
51+
COVERALLS_REPO_TOKEN: ${{ secrets.GITHUB_TOKEN }}

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
11
/vendor/
22
/.*/
3+
!/.github/
34
/composer.lock
5+
.phpunit.result.cache

.travis.yml

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

README.md

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,14 +7,15 @@ Retry
77
[![Test coverage][Coverage image]][Coverage]
88
[![Code style][Style image]][Style]
99

10-
Retry provides a function to retry failing operations. An operation is deemed to have failed if it throws an exception.
10+
Retry provides a function to retry failing operations with optional [Fiber][Fibers] support.
11+
An operation is deemed to have failed if it throws an exception.
1112
This library is a rewrite of [Igor Wiedler's retry](https://github.com/igorw/retry) but aims to remain faithful to the
1213
spirit of the original.
1314

1415
Requirements
1516
------------
1617

17-
- [PHP 5.5](http://php.net/)
18+
- [PHP 8.1](http://php.net/)
1819
- [Composer](https://getcomposer.org/)
1920

2021
Usage
@@ -49,12 +50,14 @@ $response = retry(5, function () use ($url) {
4950
```
5051

5152

53+
[Fibers]: https://www.php.net/manual/en/language.fibers.php
54+
5255
[Releases]: https://github.com/ScriptFUSION/Retry/releases
5356
[Version image]: https://poser.pugx.org/scriptfusion/retry/v/stable "Latest version"
5457
[Downloads]: https://packagist.org/packages/scriptfusion/retry
5558
[Downloads image]: https://poser.pugx.org/scriptfusion/retry/downloads "Total downloads"
56-
[Build]: http://travis-ci.org/ScriptFUSION/Retry
57-
[Build image]: https://travis-ci.org/ScriptFUSION/Retry.svg "Build status"
59+
[Build]: https://github.com/ScriptFUSION/Retry/actions/workflows/Tests.yaml
60+
[Build image]: https://github.com/ScriptFUSION/Retry/actions/workflows/Tests.yaml/badge.svg "Build status"
5861
[Coverage]: https://coveralls.io/github/ScriptFUSION/Retry
5962
[Coverage image]: https://coveralls.io/repos/ScriptFUSION/Retry/badge.svg "Test coverage"
6063
[Style]: https://styleci.io/repos/62990558

composer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
},
1818
"require-dev": {
1919
"amphp/amp": "^3-beta.9",
20-
"phpunit/phpunit": "^8.5|^9",
20+
"phpunit/phpunit": "^9.5",
2121
"revolt/event-loop": "^0.2"
2222
},
2323
"autoload": {

0 commit comments

Comments
 (0)