Skip to content

Commit

Permalink
Migrate to Github Actions for CI (#3)
Browse files Browse the repository at this point in the history
  • Loading branch information
Firehed authored Mar 22, 2020
1 parent d4d95c2 commit d9507b2
Show file tree
Hide file tree
Showing 3 changed files with 61 additions and 34 deletions.
57 changes: 57 additions & 0 deletions .github/workflows/php.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
name: CI

on:
push:
branches:
- master
pull_request:

env:
DEFAULT_COMPOSER_FLAGS: --no-interaction --no-ansi --no-progress --no-suggest

jobs:

test:

name: Test

runs-on: ubuntu-latest

strategy:
matrix:
php-version:
- 7.1
- 7.2
- 7.3
- 7.4
dependencies:
- low
- high
steps:
- uses: actions/checkout@v2

- name: Set up PHP
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php-version }}

- name: Show PHP info
run: php -v

- name: Validate Composer
run: composer validate

- name: Install dependencies
run: |
if [[ ${{ matrix.dependencies }} = 'high' ]]; then composer update $DEFAULT_COMPOSER_FLAGS; fi
if [[ ${{ matrix.dependencies }} = 'low' ]]; then composer update $DEFAULT_COMPOSER_FLAGS --prefer-lowest; fi
- name: PHPUnit
run: composer phpunit

- name: PHPStan
run: composer phpstan

- name: PHPCS
run: composer phpcs
32 changes: 0 additions & 32 deletions .travis.yml

This file was deleted.

6 changes: 4 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
# JWT - JSON Web Tokens

![CI](https://github.com/Firehed/jwt/workflows/CI/badge.svg)

## Installation
`composer require firehed/jwt`

Expand Down Expand Up @@ -87,7 +89,7 @@ Note: key ID can take any scalar format. The example above uses a datestamp, but

When calling `getClaims()`, an exception may be thrown if the signature cannot be verified or the time validity specified in standard `nbf` or `exp` claims is out of line.

Be prepared to catch `InvalidSignatureException`, `TokenExpiredException`, and `TokenNotYetValidException` when calling those methods.
Be prepared to catch `InvalidSignatureException`, `TokenExpiredException`, and `TokenNotYetValidException` when calling those methods.

If an invalid token is passed to `JWT::fromEncoded()`, an `InvalidFormatException` will be thrown.

Expand Down Expand Up @@ -174,4 +176,4 @@ try {
}
```

`SessionHandler` will always use the default value from the `KeyContainer`. That means the most recently key will be used unless one was specified with `->setDefaultKey()`.
`SessionHandler` will always use the default value from the `KeyContainer`. That means the most recently key will be used unless one was specified with `->setDefaultKey()`.

0 comments on commit d9507b2

Please sign in to comment.