Skip to content
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
35 changes: 35 additions & 0 deletions .github/branch-protection.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
# Branch Protection Rules

## Master Branch Protection

To ensure all tests pass before merging PRs, configure the following branch protection rules for the `master` branch in GitHub:

### Required Settings

1. Go to **Settings** → **Branches** in your GitHub repository
2. Add a branch protection rule for `master`
3. Enable the following settings:

#### Required status checks
- ✅ **Require status checks to pass before merging**
- ✅ **Require branches to be up to date before merging**

#### Required status checks to pass:
Select all of these jobs from the "Tests" workflow:
- `test (7.4)`
- `test (8.0)`
- `test (8.1)`
- `test (8.2)`
- `test (8.3)`
- `test (8.4)`

#### Additional recommended settings:
- ✅ **Require pull request reviews before merging** (optional but recommended)
- ✅ **Dismiss stale pull request approvals when new commits are pushed**
- ✅ **Require review from CODEOWNERS** (if you have a CODEOWNERS file)
- ✅ **Include administrators** (enforce rules for admins too)

### Notes
- All PHP version tests must pass before a PR can be merged
- The GitHub Action will automatically run on all pull requests targeting `master`
- Coverage reports are only uploaded once (from PHP 8.2) to avoid duplication
55 changes: 55 additions & 0 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
name: Tests

on:
push:
branches: [ master ]
pull_request:
branches: [ master ]

jobs:
test:
runs-on: ubuntu-latest

strategy:
fail-fast: false
matrix:
php: ['7.4', '8.0', '8.1', '8.2', '8.3', '8.4']

name: PHP ${{ matrix.php }}

steps:
- uses: actions/checkout@v4

- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php }}
extensions: mbstring, dom, fileinfo, json
coverage: xdebug

- name: Get composer cache directory
id: composer-cache
run: echo "dir=$(composer config cache-files-dir)" >> $GITHUB_OUTPUT

- name: Cache composer dependencies
uses: actions/cache@v4
with:
path: ${{ steps.composer-cache.outputs.dir }}
key: ${{ runner.os }}-php-${{ matrix.php }}-composer-${{ hashFiles('**/composer.lock') }}
restore-keys: |
${{ runner.os }}-php-${{ matrix.php }}-composer-

- name: Install dependencies
run: |
composer self-update
composer install --no-interaction --no-progress --prefer-dist

- name: Run PHPUnit tests
run: vendor/bin/phpunit --coverage-clover build/logs/clover.xml

- name: Upload coverage to Coveralls
if: matrix.php == '8.2'
env:
COVERALLS_REPO_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
vendor/bin/php-coveralls --coverage_clover=build/logs/clover.xml -v
25 changes: 0 additions & 25 deletions .travis.yml

This file was deleted.

2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# JWT Package for Laravel
[![Build Status](https://travis-ci.org/spie/laravel-jwt.svg?branch=master)](https://travis-ci.org/spie/laravel-jwt)
[![Tests](https://github.com/SPie/laravel-jwt/actions/workflows/tests.yml/badge.svg)](https://github.com/SPie/laravel-jwt/actions/workflows/tests.yml)
[![Coverage Status](https://coveralls.io/repos/github/SPie/laravel-jwt/badge.svg?branch=master)](https://coveralls.io/github/SPie/laravel-jwt?branch=master)
[![StyleCI](https://github.styleci.io/repos/158879350/shield?branch=master)](https://github.styleci.io/repos/158879350)

Expand Down
1 change: 0 additions & 1 deletion tests/ReflectionMethodHelper.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@

trait ReflectionMethodHelper
{

/**
* @return mixed
*/
Expand Down