Skip to content

Commit d1a6564

Browse files
Merge pull request #23 from ARCANEDEV/update-github_actions
Using GitHub Actions for testing
2 parents 4277a33 + febcc49 commit d1a6564

30 files changed

+236
-196
lines changed

.editorconfig

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,15 @@
1-
# This file is for unifying the coding style for different editors and IDEs
2-
# editorconfig.org
3-
41
root = true
52

63
[*]
7-
end_of_line = lf
84
charset = utf-8
5+
end_of_line = lf
6+
insert_final_newline = true
97
indent_style = space
108
indent_size = 4
119
trim_trailing_whitespace = true
12-
insert_final_newline = true
1310

1411
[*.md]
12+
trim_trailing_whitespace = false
13+
14+
[*.{yml,yaml}]
1515
indent_size = 2

.gitattributes

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,5 @@
77
.gitattributes export-ignore
88
.gitignore export-ignore
99
.scrutinizer.yml export-ignore
10-
.travis.yml export-ignore
1110
phpunit.xml.dist export-ignore
1211
CONTRIBUTING.md export-ignore

.github/workflows/run-tests.yml

Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
name: run-tests
2+
3+
on: [push]
4+
5+
jobs:
6+
tests:
7+
runs-on: ubuntu-latest
8+
9+
strategy:
10+
fail-fast: true
11+
matrix:
12+
php: [7.2, 7.3, 7.4]
13+
laravel: [6.*]
14+
dependency-version: [prefer-lowest, prefer-stable]
15+
16+
name: PHP ${{ matrix.php }} - ${{ matrix.dependency-version }}
17+
18+
steps:
19+
- name: Checkout code
20+
uses: actions/checkout@v1
21+
22+
- name: Cache dependencies
23+
uses: actions/cache@v1
24+
with:
25+
path: ~/.composer/cache/files
26+
key: dependencies-laravel-${{ matrix.laravel }}-php-${{ matrix.php }}-composer-${{ hashFiles('composer.json') }}
27+
28+
- name: Setup PHP
29+
uses: shivammathur/setup-php@v1
30+
with:
31+
php-version: ${{ matrix.php }}
32+
extensions: curl, mbstring, zip, pcntl, pdo, sqlite, pdo_sqlite, iconv
33+
coverage: xdebug
34+
35+
- name: Install dependencies
36+
run: composer update --${{ matrix.dependency-version }} --prefer-dist --no-interaction --no-suggest
37+
38+
- name: Execute tests
39+
run: |
40+
mkdir -p build/logs
41+
vendor/bin/phpunit --coverage-text --coverage-clover=coverage.clover
42+
43+
- name: Scrutinizer CI
44+
run: |
45+
wget https://scrutinizer-ci.com/ocular.phar
46+
php ocular.phar code-coverage:upload --format=php-clover coverage.clover

.scrutinizer.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ checks:
2323
tools:
2424
external_code_coverage:
2525
timeout: 600
26-
runs: 2
26+
runs: 6
2727
php_code_sniffer:
2828
enabled: true
2929
config:

.travis.yml

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

README.md

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# Laravel Messenger [![Packagist License][badge_license]](LICENSE.md) [![For Laravel][badge_laravel]][link-github-repo]
22

3-
[![Travis Status][badge_build]][link-travis]
3+
[![Github Workflow Status][badge_build]][link-github-status]
44
[![Coverage Status][badge_coverage]][link-scrutinizer]
55
[![Scrutinizer Code Quality][badge_quality]][link-scrutinizer]
66
[![SensioLabs Insight][badge_insight]][link-insight]
@@ -47,7 +47,7 @@ If you discover any security related issues, please email arcanedev.maroc@gmail.
4747

4848
[badge_laravel]: https://img.shields.io/badge/Laravel-5.1%20to%206.x-orange.svg?style=flat-square
4949
[badge_license]: https://img.shields.io/packagist/l/arcanedev/laravel-messenger.svg?style=flat-square
50-
[badge_build]: https://img.shields.io/travis/ARCANEDEV/LaravelMessenger.svg?style=flat-square
50+
[badge_build]: https://img.shields.io/github/workflow/status/ARCANEDEV/LaravelMessenger/run-tests?style=flat-square
5151
[badge_coverage]: https://img.shields.io/scrutinizer/coverage/g/ARCANEDEV/LaravelMessenger.svg?style=flat-square
5252
[badge_quality]: https://img.shields.io/scrutinizer/g/ARCANEDEV/LaravelMessenger.svg?style=flat-square
5353
[badge_insight]: https://img.shields.io/sensiolabs/i/0fe62754-1219-409a-9d05-b6ae7e3e342f.svg?style=flat-square
@@ -58,6 +58,7 @@ If you discover any security related issues, please email arcanedev.maroc@gmail.
5858

5959
[link-author]: https://github.com/arcanedev-maroc
6060
[link-github-repo]: https://github.com/ARCANEDEV/LaravelMessenger
61+
[link-github-status]: https://github.com/ARCANEDEV/LaravelMessenger/actions
6162
[link-github-issues]: https://github.com/ARCANEDEV/LaravelMessenger/issues
6263
[link-contributors]: https://github.com/ARCANEDEV/LaravelMessenger/graphs/contributors
6364
[link-packagist]: https://packagist.org/packages/arcanedev/laravel-messenger

composer.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,10 +17,10 @@
1717
"license": "MIT",
1818
"require": {
1919
"php": ">=7.2.0",
20-
"arcanedev/support": "^5.0"
20+
"arcanedev/support": "^5.1"
2121
},
2222
"require-dev": {
23-
"orchestra/testbench": "^4.0",
23+
"orchestra/testbench": "^4.6",
2424
"mockery/mockery": "^1.2",
2525
"phpunit/phpunit": "^8.0",
2626
"phpunit/phpcov": "^6.0"

database/migrations/2016_08_01_000001_create_discussions_table.php

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
<?php
22

3+
declare(strict_types=1);
4+
35
use Arcanedev\LaravelMessenger\Bases\Migration;
46
use Illuminate\Database\Schema\Blueprint;
57

@@ -25,7 +27,7 @@ public function __construct()
2527
parent::__construct();
2628

2729
$this->setTable(
28-
config('messenger.discussions.table', 'discussions')
30+
(string) config('messenger.discussions.table', 'discussions')
2931
);
3032
}
3133

@@ -37,9 +39,9 @@ public function __construct()
3739
/**
3840
* Run the migrations.
3941
*/
40-
public function up()
42+
public function up(): void
4143
{
42-
$this->createSchema(function (Blueprint $table) {
44+
$this->createSchema(function (Blueprint $table): void {
4345
$table->increments('id');
4446
$table->string('subject')->nullable();
4547
$table->timestamps();

database/migrations/2016_08_01_000002_create_messages_table.php

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
<?php
22

3+
declare(strict_types=1);
4+
35
use Arcanedev\LaravelMessenger\Bases\Migration;
46
use Illuminate\Database\Schema\Blueprint;
57

@@ -25,7 +27,7 @@ public function __construct()
2527
parent::__construct();
2628

2729
$this->setTable(
28-
config('messenger.messages.table', 'messages')
30+
(string) config('messenger.messages.table', 'messages')
2931
);
3032
}
3133

@@ -37,9 +39,9 @@ public function __construct()
3739
/**
3840
* Run the migrations.
3941
*/
40-
public function up()
42+
public function up(): void
4143
{
42-
$this->createSchema(function (Blueprint $table) {
44+
$this->createSchema(function (Blueprint $table): void {
4345
$table->increments('id');
4446
$table->unsignedInteger('discussion_id');
4547
$table->morphs(config('messenger.users.morph', 'participable'));

database/migrations/2016_08_01_000003_create_participations_table.php

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
<?php
22

3+
declare(strict_types=1);
4+
35
use Arcanedev\LaravelMessenger\Bases\Migration;
46
use Illuminate\Database\Schema\Blueprint;
57

@@ -37,9 +39,9 @@ public function __construct()
3739
/**
3840
* Run the migrations.
3941
*/
40-
public function up()
42+
public function up(): void
4143
{
42-
$this->createSchema(function (Blueprint $table) {
44+
$this->createSchema(function (Blueprint $table): void {
4345
$table->increments('id');
4446
$table->unsignedInteger('discussion_id');
4547
$table->morphs(config('messenger.users.morph', 'participable'));

0 commit comments

Comments
 (0)