Skip to content

Commit 8ddb395

Browse files
authored
chore: remove travis, add github actions (#331)
1 parent 474047d commit 8ddb395

File tree

9 files changed

+89
-37
lines changed

9 files changed

+89
-37
lines changed

.github/actions/entrypoint.sh

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
#!/bin/sh -l
2+
3+
apt-get update && \
4+
apt-get install -y --no-install-recommends \
5+
git \
6+
zip \
7+
curl \
8+
unzip \
9+
wget
10+
11+
curl --silent --show-error https://getcomposer.org/installer | php
12+
php composer.phar self-update
13+
14+
echo "---Installing dependencies ---"
15+
php composer.phar update
16+
17+
echo "---Running unit tests ---"
18+
vendor/bin/phpunit

.github/workflows/tests.yml

Lines changed: 66 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,66 @@
1+
name: Test Suite
2+
on:
3+
push:
4+
branches:
5+
- master
6+
pull_request:
7+
8+
jobs:
9+
test:
10+
runs-on: ubuntu-latest
11+
strategy:
12+
matrix:
13+
php: [ "5.6", "7.0", "7.1", "7.2", "7.3", "7.4", "8.0" ]
14+
name: PHP ${{matrix.php }} Unit Test
15+
steps:
16+
- uses: actions/checkout@v2
17+
- name: Setup PHP
18+
uses: shivammathur/setup-php@v2
19+
with:
20+
php-version: ${{ matrix.php }}
21+
- name: Install Dependencies
22+
uses: nick-invision/retry@v1
23+
with:
24+
timeout_minutes: 10
25+
max_attempts: 3
26+
command: composer install
27+
- name: Run Script
28+
run: vendor/bin/phpunit
29+
30+
# use dockerfiles for old versions of php (setup-php times out for those).
31+
test_php55:
32+
name: "PHP 5.5 Unit Test"
33+
runs-on: ubuntu-latest
34+
steps:
35+
- name: Checkout
36+
uses: actions/checkout@v2
37+
- name: Run Unit Tests
38+
uses: docker://php:5.5-cli
39+
with:
40+
entrypoint: ./.github/actions/entrypoint.sh
41+
42+
test_php54:
43+
name: "PHP 5.4 Unit Test"
44+
runs-on: ubuntu-latest
45+
steps:
46+
- name: Checkout
47+
uses: actions/checkout@v2
48+
- name: Run Unit Tests
49+
uses: docker://php:5.4-cli
50+
with:
51+
entrypoint: ./.github/actions/entrypoint.sh
52+
53+
style:
54+
runs-on: ubuntu-latest
55+
name: PHP Style Check
56+
steps:
57+
- uses: actions/checkout@v2
58+
- name: Setup PHP
59+
uses: shivammathur/setup-php@v2
60+
with:
61+
php-version: "7.0"
62+
- name: Run Script
63+
run: |
64+
composer require friendsofphp/php-cs-fixer
65+
vendor/bin/php-cs-fixer fix --diff --dry-run .
66+
vendor/bin/php-cs-fixer fix --rules=native_function_invocation --allow-risky=yes --diff src

.travis.yml

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

phpunit.xml.dist

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@
88
convertWarningsToExceptions="true"
99
processIsolation="false"
1010
stopOnFailure="false"
11-
syntaxCheck="false"
1211
bootstrap="tests/bootstrap.php"
1312
>
1413
<testsuites>

src/BeforeValidException.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
<?php
2+
23
namespace Firebase\JWT;
34

45
class BeforeValidException extends \UnexpectedValueException

src/ExpiredException.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
<?php
2+
23
namespace Firebase\JWT;
34

45
class ExpiredException extends \UnexpectedValueException

src/SignatureInvalidException.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
<?php
2+
23
namespace Firebase\JWT;
34

45
class SignatureInvalidException extends \UnexpectedValueException

tests/JWKTest.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
<?php
2+
23
namespace Firebase\JWT;
34

45
use PHPUnit\Framework\TestCase;

tests/JWTTest.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
<?php
2+
23
namespace Firebase\JWT;
34

45
use ArrayObject;

0 commit comments

Comments
 (0)