From 55e965bd7ee98862c72c7f9736a68ef474353ddb Mon Sep 17 00:00:00 2001 From: Bishop Bettini Date: Thu, 10 Dec 2020 22:43:20 -0500 Subject: [PATCH 1/5] Convert Travis to GitHub actions Based on the implementation in rollbar-php, this attempts to mimic the existing Travis CI configuration. --- .github/workflows/ci.yml | 69 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 69 insertions(+) create mode 100644 .github/workflows/ci.yml diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml new file mode 100644 index 0000000..b7db1b2 --- /dev/null +++ b/.github/workflows/ci.yml @@ -0,0 +1,69 @@ +# Primary CI checks for Rollbar-PHP-Laravel. +# +# Test with act: +# brew install act +# act -P ubuntu-latest=shivammathur/node:latest +# +# @see https://github.com/nektos/act/issues/329 +name: Rollbar-PHP-Laravel CI + +# Fire this action on pushes to main branch (master) as well as pull requests +# (push: without any configuration assumes this). Also, run every day at 02:42 +# GMT -- this catches failures from dependencies that update indepdently. +on: + push: + schedule: + - cron: '42 2 * * *' + +jobs: + # Check that this runs on PHP on all versions we claim to support, on both + # UNIX-like and Windows environments, and that use both the lowest possible + # compatible version as well as the most-recent stable version. This will + # fail-fast by default, so we include our edgiest versions (currently 7.4) + # first as they're most likely to fail. + # @seealso https://freek.dev/1546 + # @seealso https://www.dereuromark.de/2019/01/04/test-composer-dependencies-with-prefer-lowest/ + php-tests: + strategy: + matrix: + php: [7.3, 7.2] + dependency: [stable] + os: [ubuntu] + + name: PHP ${{ matrix.php }} on ${{ matrix.os }}, ${{ matrix.dependency }} dependencies preferred + runs-on: ${{ matrix.os }}-latest + steps: + - name: Checkout the code + uses: actions/checkout@v2 + + - name: Install PHP and composer environment + uses: shivammathur/setup-php@v2 + with: + php-version: ${{ matrix.php }} + extensions: curl + ini-values: ${{ matrix.ini }} + coverage: xdebug + + - 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: ${{ matrix.os }}-composer-${{ hashFiles('**/composer.json') }}-${{ matrix.dependency }}- + restore-keys: ${{ matrix.os }}-composer-${{ matrix.dependency }}- + + - name: Install dependencies + run: composer update --prefer-${{ matrix.dependency }} --prefer-dist --no-interaction + + - name: Make logs directory + run: mkdir -p build/logs + + - name: Execute tests + run: composer test + + - name: Report results + if: success() + run: ./vendor/bin/coveralls -v From 8ab8c662d7db36dd3e051d666fef0021a5235838 Mon Sep 17 00:00:00 2001 From: Bishop Bettini Date: Thu, 10 Dec 2020 23:00:12 -0500 Subject: [PATCH 2/5] Fix incorrect command name --- .github/workflows/ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index b7db1b2..10c39df 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -66,4 +66,4 @@ jobs: - name: Report results if: success() - run: ./vendor/bin/coveralls -v + run: ./vendor/bin/php-coveralls -v From ce831bbcb45ae05f7f432ba5a49ccdb981b9c34a Mon Sep 17 00:00:00 2001 From: Bishop Bettini Date: Thu, 10 Dec 2020 23:04:08 -0500 Subject: [PATCH 3/5] Allow the coveralls job to fail In the last green Travis build[1], coveralls failed with "command not found". We fixed that particular error in this build but there are still missing environment variables. Since the scope of this change is to replace the existing Travis behavior, we'll stop here and let the coveralls fail but ignore that fact. [1]:https://travis-ci.org/github/rollbar/rollbar-php-laravel/jobs/743942091 --- .github/workflows/ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 10c39df..c261320 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -66,4 +66,4 @@ jobs: - name: Report results if: success() - run: ./vendor/bin/php-coveralls -v + run: ./vendor/bin/php-coveralls -v || true From 9969323c1e6dec7d8647521c5c483601f5ae4171 Mon Sep 17 00:00:00 2001 From: Bishop Bettini Date: Thu, 10 Dec 2020 23:07:56 -0500 Subject: [PATCH 4/5] Remove Travis --- .travis.yml | 26 -------------------------- 1 file changed, 26 deletions(-) delete mode 100644 .travis.yml diff --git a/.travis.yml b/.travis.yml deleted file mode 100644 index 543d711..0000000 --- a/.travis.yml +++ /dev/null @@ -1,26 +0,0 @@ -language: php -dist: trusty - -php: - - 7.3 - - 7.2 - - nightly - -matrix: - allow_failures: - - php: nightly - -sudo: false - -install: composer install --no-interaction - -before_script: - - travis_retry composer self-update - - travis_retry composer install --dev --no-interaction - -script: - - mkdir -p build/logs - - composer test - -after_success: - - sh -c 'if [ "$TRAVIS_PHP_VERSION" != "hhvm" ]; then php vendor/bin/coveralls -v; fi;' From 044f08c843bbd41db589b0931fcdca7d9bd4fb6b Mon Sep 17 00:00:00 2001 From: Bishop Bettini Date: Thu, 10 Dec 2020 23:13:28 -0500 Subject: [PATCH 5/5] Add latest badges to README --- README.md | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 44cf1af..1bde29b 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,8 @@ -# Rollbar for Laravel [![Build Status](https://travis-ci.org/rollbar/rollbar-php-laravel.svg?branch=master)](https://travis-ci.org/rollbar/rollbar-php-laravel) +# Rollbar for Laravel + +[![Latest Version on Packagist](https://img.shields.io/packagist/v/rollbar/rollbar-laravel.svg?style=flat-square)](https://packagist.org/packages/rollbar/rollbar-laravel) +![Build Status](https://github.com/rollbar/rollbar-php-laravel/workflows/Rollbar-PHP-Laravel%20CI/badge.svg) +[![Total Downloads](https://img.shields.io/packagist/dt/rollbar/rollbar-laravel.svg?style=flat-square)](https://packagist.org/packages/rollbar/rollbar-laravel) Rollbar error monitoring integration for Laravel projects. This library adds a listener to Laravel's logging component. Laravel's session information will be sent in to Rollbar, as well as some other helpful information such as 'environment', 'server', and 'session'.