Skip to content

chore: remove travis, add github actions #331

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 10 commits into from
May 17, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 18 additions & 0 deletions .github/actions/entrypoint.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
#!/bin/sh -l

apt-get update && \
apt-get install -y --no-install-recommends \
git \
zip \
curl \
unzip \
wget

curl --silent --show-error https://getcomposer.org/installer | php
php composer.phar self-update

echo "---Installing dependencies ---"
php composer.phar update

echo "---Running unit tests ---"
vendor/bin/phpunit
66 changes: 66 additions & 0 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
name: Test Suite
on:
push:
branches:
- master
pull_request:

jobs:
test:
runs-on: ubuntu-latest
strategy:
matrix:
php: [ "5.6", "7.0", "7.1", "7.2", "7.3", "7.4", "8.0" ]
name: PHP ${{matrix.php }} Unit Test
steps:
- uses: actions/checkout@v2
- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php }}
- name: Install Dependencies
uses: nick-invision/retry@v1
with:
timeout_minutes: 10
max_attempts: 3
command: composer install
- name: Run Script
run: vendor/bin/phpunit

# use dockerfiles for old versions of php (setup-php times out for those).
test_php55:
name: "PHP 5.5 Unit Test"
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Run Unit Tests
uses: docker://php:5.5-cli
with:
entrypoint: ./.github/actions/entrypoint.sh

test_php54:
name: "PHP 5.4 Unit Test"
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Run Unit Tests
uses: docker://php:5.4-cli
with:
entrypoint: ./.github/actions/entrypoint.sh

style:
runs-on: ubuntu-latest
name: PHP Style Check
steps:
- uses: actions/checkout@v2
- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: "7.0"
- name: Run Script
run: |
composer require friendsofphp/php-cs-fixer
vendor/bin/php-cs-fixer fix --diff --dry-run .
vendor/bin/php-cs-fixer fix --rules=native_function_invocation --allow-risky=yes --diff src
36 changes: 0 additions & 36 deletions .travis.yml

This file was deleted.

1 change: 0 additions & 1 deletion phpunit.xml.dist
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@
convertWarningsToExceptions="true"
processIsolation="false"
stopOnFailure="false"
syntaxCheck="false"
bootstrap="tests/bootstrap.php"
>
<testsuites>
Expand Down
1 change: 1 addition & 0 deletions src/BeforeValidException.php
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
<?php

namespace Firebase\JWT;

class BeforeValidException extends \UnexpectedValueException
Expand Down
1 change: 1 addition & 0 deletions src/ExpiredException.php
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
<?php

namespace Firebase\JWT;

class ExpiredException extends \UnexpectedValueException
Expand Down
1 change: 1 addition & 0 deletions src/SignatureInvalidException.php
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
<?php

namespace Firebase\JWT;

class SignatureInvalidException extends \UnexpectedValueException
Expand Down
1 change: 1 addition & 0 deletions tests/JWKTest.php
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
<?php

namespace Firebase\JWT;

use PHPUnit\Framework\TestCase;
Expand Down
1 change: 1 addition & 0 deletions tests/JWTTest.php
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
<?php

namespace Firebase\JWT;

use ArrayObject;
Expand Down