Skip to content

Commit 89feee5

Browse files
Using GitHub Actions for testing (#30)
* Using GitHub Actions for testing * Updating the package * Updating the package
1 parent 1fea843 commit 89feee5

25 files changed

+218
-118
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 & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# Laravel Notes [![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]
@@ -44,7 +44,7 @@ If you discover any security related issues, please email arcanedev.maroc@gmail.
4444

4545
[badge_laravel]: https://img.shields.io/badge/For%20Laravel-5.1%20to%206.x-orange.svg?style=flat-square
4646
[badge_license]: https://img.shields.io/packagist/l/arcanedev/laravel-notes.svg?style=flat-square
47-
[badge_build]: https://img.shields.io/travis/ARCANEDEV/LaravelNotes.svg?style=flat-square
47+
[badge_build]: https://img.shields.io/github/workflow/status/ARCANEDEV/LaravelNotes/run-tests?style=flat-square
4848
[badge_coverage]: https://img.shields.io/scrutinizer/coverage/g/ARCANEDEV/LaravelNotes.svg?style=flat-square
4949
[badge_quality]: https://img.shields.io/scrutinizer/g/ARCANEDEV/LaravelNotes.svg?style=flat-square
5050
[badge_insight]: https://img.shields.io/sensiolabs/i/5ff01c70-3ad7-42b5-8c7f-6825b3887118.svg?style=flat-square
@@ -55,9 +55,9 @@ If you discover any security related issues, please email arcanedev.maroc@gmail.
5555

5656
[link-author]: https://github.com/arcanedev-maroc
5757
[link-github-repo]: https://github.com/ARCANEDEV/LaravelNotes
58+
[link-github-status]: https://github.com/ARCANEDEV/LaravelNotes/actions
5859
[link-github-issues]: https://github.com/ARCANEDEV/LaravelNotes/issues
5960
[link-contributors]: https://github.com/ARCANEDEV/LaravelNotes/graphs/contributors
6061
[link-packagist]: https://packagist.org/packages/arcanedev/laravel-notes
61-
[link-travis]: https://travis-ci.org/ARCANEDEV/LaravelNotes
6262
[link-scrutinizer]: https://scrutinizer-ci.com/g/ARCANEDEV/LaravelNotes/?branch=master
6363
[link-insight]: https://insight.sensiolabs.com/projects/5ff01c70-3ad7-42b5-8c7f-6825b3887118

composer.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,10 +15,10 @@
1515
"license": "MIT",
1616
"require": {
1717
"php": ">=7.2.0",
18-
"arcanedev/support": "^5.0"
18+
"arcanedev/support": "^5.1"
1919
},
2020
"require-dev": {
21-
"orchestra/testbench": "^4.0",
21+
"orchestra/testbench": "^4.6",
2222
"mockery/mockery": "^1.0",
2323
"phpunit/phpunit": "^8.0",
2424
"phpunit/phpcov": "^6.0"

database/migrations/2016_10_00_000001_create_notes_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\LaravelNotes\Bases\Migration;
46
use Illuminate\Database\Schema\Blueprint;
57

@@ -35,7 +37,7 @@ public function __construct()
3537
/**
3638
* Run the migrations.
3739
*/
38-
public function up()
40+
public function up(): void
3941
{
4042
$this->createSchema(function (Blueprint $table) {
4143
$table->increments('id');
@@ -46,7 +48,7 @@ public function up()
4648

4749
$table->foreign('author_id')
4850
->references('id')
49-
->on(config('notes.authors.table', 'users'))
51+
->on((string) config('notes.authors.table', 'users'))
5052
->onDelete('cascade');
5153
});
5254
}

src/Bases/Migration.php

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,8 @@
1-
<?php namespace Arcanedev\LaravelNotes\Bases;
1+
<?php
2+
3+
declare(strict_types=1);
4+
5+
namespace Arcanedev\LaravelNotes\Bases;
26

37
use Arcanedev\Support\Database\Migration as BaseMigration;
48

src/LaravelNotes.php

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,8 @@
1-
<?php namespace Arcanedev\LaravelNotes;
1+
<?php
2+
3+
declare(strict_types=1);
4+
5+
namespace Arcanedev\LaravelNotes;
26

37
/**
48
* Class LaravelNotes

0 commit comments

Comments
 (0)