Skip to content

Commit

Permalink
Improve GitHub workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
oanhnn committed Sep 7, 2020
1 parent 8ebb2e3 commit 4fee689
Show file tree
Hide file tree
Showing 2 changed files with 32 additions and 8 deletions.
37 changes: 30 additions & 7 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -49,9 +49,7 @@ jobs:
with:
php-version: ${{ matrix.php }}
extensions: curl, json, mbstring
coverage: pcov
ini-values: pcov.directory=src
tools: composer, phpunit, phpcs
tools: composer, phpunit
- name: Get Composer Cache Directory
id: composer-cache
run: echo "::set-output name=dir::$(composer config cache-files-dir)"
Expand All @@ -62,15 +60,40 @@ jobs:
key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.json') }}
restore-keys: ${{ runner.os }}-composer-
- name: Install dependencies
run: composer install
run: composer update --no-interaction --no-suggest --prefer-dist ${{ matrix.COMPOSER_ARGS }}
- name: Run PHPUnit
if: matrix.php != '7.4' || !contains(matrix.COMPOSER_ARGS, 'stable')
run: php vendor/bin/phpunit

update-coverage:
name: '[PHP] Update test coverage'
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Setting up PHP
uses: shivammathur/setup-php@v2
with:
php-version: 7.4
extensions: curl, json, mbstring
coverage: pcov
ini-values: pcov.directory=src
tools: composer, phpunit
- name: Get Composer Cache Directory
id: composer-cache
run: echo "::set-output name=dir::$(composer config cache-files-dir)"
- name: Cache dependencies
uses: actions/cache@v2
with:
path: ${{ steps.composer-cache.outputs.dir }}
key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.json') }}
restore-keys: ${{ runner.os }}-composer-
- name: Install dependencies
run: |
composer require --no-interaction --no-update "guzzlehttp/guzzle:^6.3"
composer update --no-interaction --no-suggest --prefer-dist ${{ matrix.COMPOSER_ARGS }}
- name: Run PHPUnit and generate coverage
if: matrix.php == '7.4' && contains(matrix.COMPOSER_ARGS, 'stable')
run: php -d pcov.enabled=1 vendor/bin/phpunit --coverage-clover=build/logs/clover.xml
- name: Update test coverage
if: matrix.php == '7.4' && contains(matrix.COMPOSER_ARGS, 'stable')
env:
COVERALLS_RUN_LOCALLY: 1
COVERALLS_REPO_TOKEN: ${{ secrets.COVERALLS_REPO_TOKEN }}
Expand Down
3 changes: 2 additions & 1 deletion src/Log/Formatter.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
namespace Laravel\Logzio\Log;

use DateTimeInterface;
use Monolog\Formatter\FormatterInterface;
use Monolog\Formatter\JsonFormatter;

/**
Expand All @@ -12,7 +13,7 @@
* @author Oanh Nguyen <oanhnn.bk@gmail.com>
* @license The MIT license
*/
class Formatter extends JsonFormatter
class Formatter extends JsonFormatter implements FormatterInterface
{
/**
* Datetime format for Logz.io
Expand Down

0 comments on commit 4fee689

Please sign in to comment.