diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml new file mode 100644 index 0000000..e2160cc --- /dev/null +++ b/.github/workflows/tests.yml @@ -0,0 +1,60 @@ +name: Tests + +on: + push: + pull_request: + schedule: + - cron: '0 0 * * 1' + +jobs: + test: + runs-on: ubuntu-latest + + strategy: + fail-fast: false + matrix: + php: [ 7.4, 8.0, 8.1, 8.2, 8.3 ] + laravel: [ 8, 9, 10, 11 ] + stability: [ prefer-lowest, prefer-stable ] + exclude: + - php: 8.1 + laravel: 11 + - php: 8.0 + laravel: 11 + - php: 7.4 + laravel: 11 + - php: 8.0 + laravel: 10 + - php: 7.4 + laravel: 10 + - php: 7.4 + laravel: 9 + + + name: PHP ${{ matrix.php }} - Laravel ${{ matrix.laravel }} (${{ matrix.stability }}) + + steps: + - name: Checkout code + uses: actions/checkout@v4 + + - name: Setup PHP + uses: shivammathur/setup-php@v2 + with: + php-version: ${{ matrix.php }} + extensions: dom, curl, json, libxml, mbstring, zip + tools: composer:v2 + coverage: none + + # https://github.com/briannesbitt/Carbon/releases/tag/2.62.1 + - name: Patch Carbon version + if: matrix.php == 8.2 || matrix.php == 8.3 + run: | + composer require "nesbot/carbon=^2.63" --dev --no-interaction --no-update + + - name: Install dependencies + run: | + composer require "illuminate/support=^${{ matrix.laravel }}" --no-interaction --no-update + composer update --${{ matrix.stability }} --prefer-dist --no-interaction --no-progress + + - name: Execute tests + run: composer test diff --git a/.styleci.yml b/.styleci.yml deleted file mode 100644 index 0285f17..0000000 --- a/.styleci.yml +++ /dev/null @@ -1 +0,0 @@ -preset: laravel diff --git a/README.md b/README.md index 67bc440..978d0d1 100644 --- a/README.md +++ b/README.md @@ -1,10 +1,11 @@ # OneSignal Notifications Channel for Laravel -[![Latest Version on Packagist](https://img.shields.io/packagist/v/macellan/onesignal.svg?style=flat-square)](https://packagist.org/packages/macellan/onesignal) -[![Total Downloads](https://img.shields.io/packagist/dt/macellan/onesignal.svg?style=flat-square)](https://packagist.org/packages/macellan/onesignal) +![Tests](https://github.com/macellan/onesignal/workflows/Tests/badge.svg?branch=main) +[![Latest Stable Version](https://poser.pugx.org/macellan/onesignal/v/stable)](https://packagist.org/packages/macellan/onesignal) +[![Total Downloads](https://poser.pugx.org/macellan/onesignal/downloads)](https://packagist.org/packages/macellan/onesignal) -This package makes it easy to send push notifications using [OneSignal](https://onesignal.com/) with Laravel 8.0+ and 9.0+ +This package makes it easy to send push notifications using [OneSignal](https://onesignal.com/) with Laravel 8.0 and 9.0, 10.0, 11.0 This plugin sends notifications only with OneSignal Player ID. diff --git a/composer.json b/composer.json index dcea675..20cbf05 100644 --- a/composer.json +++ b/composer.json @@ -13,16 +13,16 @@ ], "require": { "php": ">=7.4", + "ext-json": "*", "guzzlehttp/guzzle": "^7.2|^7.0.1", - "illuminate/notifications": "^8.0|^9.0|~10.0", - "illuminate/support": "^8.0|^9.0|~10.0", - "illuminate/http": "^8.0|^9.0|~10.0", - "ext-json": "*" + "illuminate/notifications": "^8.0|^9.0|^10.0|^11.0", + "illuminate/support": "^8.0|^9.0|^10.0|^11.0", + "illuminate/http": "^8.0|^9.0|^10.0|^11.0" }, "require-dev": { - "orchestra/testbench": "v6.24|^7.1|^8.0", + "orchestra/testbench": "v6.24|^7.1|^8.0|^9.0", "mockery/mockery": "^1.4.4", - "phpunit/phpunit": "^9.5.10", + "phpunit/phpunit": "^9.5.10|^10.0", "squizlabs/php_codesniffer": "^3.6" }, "autoload": { diff --git a/phpunit.xml b/phpunit.xml index 6f936c3..8cc8ebc 100644 --- a/phpunit.xml +++ b/phpunit.xml @@ -1,22 +1,17 @@ - - ./tests/ + + tests - - - - - \ No newline at end of file +