Skip to content

Commit

Permalink
Merge pull request #52 from ARCANEDEV/update-github_actions
Browse files Browse the repository at this point in the history
Using GitHub Actions for testing
  • Loading branch information
arcanedev-maroc authored Feb 2, 2020
2 parents 3f1ee79 + 0788e2b commit 4cc1bda
Show file tree
Hide file tree
Showing 61 changed files with 792 additions and 544 deletions.
1 change: 0 additions & 1 deletion .gitattributes
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,5 @@
.gitattributes export-ignore
.gitignore export-ignore
.scrutinizer.yml export-ignore
.travis.yml export-ignore
phpunit.xml.dist export-ignore
CONTRIBUTING.md export-ignore
46 changes: 46 additions & 0 deletions .github/workflows/run-tests.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
name: run-tests

on: [push]

jobs:
tests:
runs-on: ubuntu-latest

strategy:
fail-fast: true
matrix:
php: [7.2, 7.3, 7.4]
laravel: [6.*]
dependency-version: [prefer-lowest, prefer-stable]

name: PHP ${{ matrix.php }} - ${{ matrix.dependency-version }}

steps:
- name: Checkout code
uses: actions/checkout@v1

- name: Cache dependencies
uses: actions/cache@v1
with:
path: ~/.composer/cache/files
key: dependencies-laravel-${{ matrix.laravel }}-php-${{ matrix.php }}-composer-${{ hashFiles('composer.json') }}

- name: Setup PHP
uses: shivammathur/setup-php@v1
with:
php-version: ${{ matrix.php }}
extensions: curl, mbstring, zip, pcntl, pdo, sqlite, pdo_sqlite, iconv
coverage: xdebug

- name: Install dependencies
run: composer update --${{ matrix.dependency-version }} --prefer-dist --no-interaction --no-suggest

- name: Execute tests
run: |
mkdir -p build/logs
vendor/bin/phpunit --coverage-text --coverage-clover=coverage.clover
- name: Scrutinizer CI
run: |
wget https://scrutinizer-ci.com/ocular.phar
php ocular.phar code-coverage:upload --format=php-clover coverage.clover
23 changes: 0 additions & 23 deletions .travis.yml

This file was deleted.

5 changes: 3 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# SEO Helper [![Packagist License][badge_license]](LICENSE.md) [![For PHP][badge_php]][link-github-repo]

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

[badge_php]: https://img.shields.io/badge/PHP-Framework%20agnostic-4F5B93.svg?style=flat-square
[badge_license]: https://img.shields.io/packagist/l/arcanedev/seo-helper.svg?style=flat-square
[badge_build]: https://img.shields.io/travis/ARCANEDEV/SEO-Helper.svg?style=flat-square
[badge_build]: https://img.shields.io/github/workflow/status/ARCANEDEV/SEO-Helper/run-tests?style=flat-square
[badge_coverage]: https://img.shields.io/scrutinizer/coverage/g/ARCANEDEV/SEO-Helper.svg?style=flat-square
[badge_quality]: https://img.shields.io/scrutinizer/g/ARCANEDEV/SEO-Helper.svg?style=flat-square
[badge_insight]: https://img.shields.io/sensiolabs/i/73e1a779-7ca7-4a75-b6d3-452d7852187e.svg?style=flat-square
Expand All @@ -62,6 +62,7 @@ If you discover any security related issues, please email arcanedev.maroc@gmail.

[link-author]: https://github.com/arcanedev-maroc
[link-github-repo]: https://github.com/ARCANEDEV/SEO-Helper
[link-github-status]: https://github.com/ARCANEDEV/SEO-Helper/actions
[link-github-issues]: https://github.com/ARCANEDEV/SEO-Helper/issues
[link-contributors]: https://github.com/ARCANEDEV/SEO-Helper/graphs/contributors
[link-packagist]: https://packagist.org/packages/arcanedev/seo-helper
Expand Down
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
"require": {
"php": ">=7.2.0",
"arcanedev/php-html": "^3.0",
"arcanedev/support": "^5.0"
"arcanedev/support": "^5.1"
},
"require-dev": {
"ext-dom": "*",
Expand Down
24 changes: 14 additions & 10 deletions src/Bases/MetaCollection.php
Original file line number Diff line number Diff line change
@@ -1,4 +1,8 @@
<?php namespace Arcanedev\SeoHelper\Bases;
<?php

declare(strict_types=1);

namespace Arcanedev\SeoHelper\Bases;

use Arcanedev\SeoHelper\Contracts\Entities\MetaCollection as MetaCollectionContract;
use Arcanedev\SeoHelper\Contracts\Helpers\Meta as MetaContract;
Expand Down Expand Up @@ -57,7 +61,7 @@ abstract class MetaCollection extends Collection implements MetaCollectionContra
*
* @param string $prefix
*
* @return \Arcanedev\SeoHelper\Bases\MetaCollection
* @return $this
*/
public function setPrefix($prefix)
{
Expand All @@ -67,7 +71,7 @@ public function setPrefix($prefix)
}

/* -----------------------------------------------------------------
| Main Functions
| Main Methods
| -----------------------------------------------------------------
*/

Expand All @@ -76,7 +80,7 @@ public function setPrefix($prefix)
*
* @param array $metas
*
* @return \Arcanedev\SeoHelper\Bases\MetaCollection
* @return $this
*/
public function addMany(array $metas)
{
Expand All @@ -93,7 +97,7 @@ public function addMany(array $metas)
* @param string $name
* @param string|array $content
*
* @return \Arcanedev\SeoHelper\Bases\MetaCollection
* @return $this
*/
public function addOne($name, $content)
{
Expand All @@ -109,7 +113,7 @@ public function addOne($name, $content)
* @param string $name
* @param string|array $content
*
* @return \Arcanedev\SeoHelper\Bases\MetaCollection
* @return $this
*/
protected function addMeta($name, $content)
{
Expand All @@ -123,7 +127,7 @@ protected function addMeta($name, $content)
*
* @param array|string $names
*
* @return \Arcanedev\SeoHelper\Bases\MetaCollection
* @return $this
*/
public function remove($names)
{
Expand All @@ -149,7 +153,7 @@ public function render()
/**
* Reset the collection.
*
* @return \Arcanedev\SeoHelper\Bases\MetaCollection
* @return $this
*/
public function reset()
{
Expand Down Expand Up @@ -195,7 +199,7 @@ protected function isIgnored($name)
*
* @param string|array $keys
*
* @return \Arcanedev\SeoHelper\Bases\MetaCollection
* @return $this
*/
public function forget($keys)
{
Expand All @@ -209,7 +213,7 @@ public function forget($keys)
/**
* Refresh meta collection items.
*
* @return \Arcanedev\SeoHelper\Bases\MetaCollection
* @return $this
*/
private function refresh()
{
Expand Down
7 changes: 6 additions & 1 deletion src/Contracts/Entities/Analytics.php
Original file line number Diff line number Diff line change
@@ -1,4 +1,8 @@
<?php namespace Arcanedev\SeoHelper\Contracts\Entities;
<?php

declare(strict_types=1);

namespace Arcanedev\SeoHelper\Contracts\Entities;

use Arcanedev\SeoHelper\Contracts\Renderable;

Expand All @@ -14,6 +18,7 @@ interface Analytics extends Renderable
| Getters & Setters
| -----------------------------------------------------------------
*/

/**
* Set Google Analytics code.
*
Expand Down
14 changes: 10 additions & 4 deletions src/Contracts/Entities/Description.php
Original file line number Diff line number Diff line change
@@ -1,4 +1,8 @@
<?php namespace Arcanedev\SeoHelper\Contracts\Entities;
<?php

declare(strict_types=1);

namespace Arcanedev\SeoHelper\Contracts\Entities;

use Arcanedev\SeoHelper\Contracts\Renderable;

Expand All @@ -14,6 +18,7 @@ interface Description extends Renderable
| Getters & Setters
| -----------------------------------------------------------------
*/

/**
* Get raw description content.
*
Expand All @@ -33,7 +38,7 @@ public function get();
*
* @param string $content
*
* @return self
* @return $this
*/
public function set($content);

Expand All @@ -49,21 +54,22 @@ public function getMax();
*
* @param int $max
*
* @return self
* @return $this
*/
public function setMax($max);

/* -----------------------------------------------------------------
| Main Methods
| -----------------------------------------------------------------
*/

/**
* Make a description instance.
*
* @param string $content
* @param int $max
*
* @return self
* @return $this
*/
public static function make($content, $max = 155);
}
18 changes: 12 additions & 6 deletions src/Contracts/Entities/Keywords.php
Original file line number Diff line number Diff line change
@@ -1,4 +1,8 @@
<?php namespace Arcanedev\SeoHelper\Contracts\Entities;
<?php

declare(strict_types=1);

namespace Arcanedev\SeoHelper\Contracts\Entities;

use Arcanedev\SeoHelper\Contracts\Renderable;

Expand All @@ -14,6 +18,7 @@ interface Keywords extends Renderable
| Getters & Setters
| -----------------------------------------------------------------
*/

/**
* Get content.
*
Expand All @@ -26,20 +31,21 @@ public function getContent();
*
* @param array|string $content
*
* @return self
* @return $this
*/
public function set($content);

/* -----------------------------------------------------------------
| Main Functions
| Main Methods
| -----------------------------------------------------------------
*/

/**
* Make Keywords instance.
*
* @param array|string $keywords
*
* @return self
* @return $this
*/
public static function make($keywords);

Expand All @@ -48,7 +54,7 @@ public static function make($keywords);
*
* @param string $keyword
*
* @return self
* @return $this
*/
public function add($keyword);

Expand All @@ -57,7 +63,7 @@ public function add($keyword);
*
* @param array $keywords
*
* @return self
* @return $this
*/
public function addMany(array $keywords);
}
15 changes: 10 additions & 5 deletions src/Contracts/Entities/MetaCollection.php
Original file line number Diff line number Diff line change
@@ -1,4 +1,8 @@
<?php namespace Arcanedev\SeoHelper\Contracts\Entities;
<?php

declare(strict_types=1);

namespace Arcanedev\SeoHelper\Contracts\Entities;

use Arcanedev\SeoHelper\Contracts\Renderable;

Expand All @@ -11,16 +15,17 @@
interface MetaCollection extends Renderable
{
/* -----------------------------------------------------------------
| Main Functions
| Main Methods
| -----------------------------------------------------------------
*/

/**
* Add a meta to collection.
*
* @param string $name
* @param string|array $content
*
* @return self
* @return $this
*/
public function addOne($name, $content);

Expand All @@ -29,7 +34,7 @@ public function addOne($name, $content);
*
* @param array $metas
*
* @return self
* @return $this
*/
public function addMany(array $metas);

Expand All @@ -38,7 +43,7 @@ public function addMany(array $metas);
*
* @param array|string $names
*
* @return self
* @return $this
*/
public function remove($names);
}
Loading

0 comments on commit 4cc1bda

Please sign in to comment.