From 8784abccbede8980f1aa30abddabb606dff8c932 Mon Sep 17 00:00:00 2001 From: Stephen Finney Date: Fri, 24 Apr 2020 11:48:29 -0400 Subject: [PATCH 1/2] Replace Travis with Github Actions --- .github/workflows/ci.yml | 43 +++++++++++++++++++++++++++++++++++++ .travis.yml | 46 ---------------------------------------- 2 files changed, 43 insertions(+), 46 deletions(-) create mode 100644 .github/workflows/ci.yml delete mode 100644 .travis.yml diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml new file mode 100644 index 0000000..cf6a3c7 --- /dev/null +++ b/.github/workflows/ci.yml @@ -0,0 +1,43 @@ +name: CI + +on: + push: + pull_request: + +jobs: + tests: + + runs-on: ubuntu-latest + + strategy: + fail-fast: true + matrix: + php: [7.2, 7.3, 7.4] + stability: [prefer-lowest, prefer-stable] + + name: PHP ${{ matrix.php }} - ${{ matrix.stability }} + + steps: + - name: Checkout code + uses: actions/checkout@v2 + + - name: Cache dependencies + uses: actions/cache@v1 + with: + path: ~/.composer/cache + key: dependencies-php-${{ matrix.php }}-composer-${{ hashFiles('composer.json') }} + + - name: Setup PHP + uses: shivammathur/setup-php@v2 + with: + php-version: ${{ matrix.php }} + coverage: pcov + + - name: Install dependencies + run: composer update --${{ matrix.stability }} --prefer-dist --no-interaction --no-suggest + + - name: Execute tests + run: vendor/bin/phpunit --coverage-clover=coverage.clover --verbose + + - name: Upload Code Coverage + run: wget https://scrutinizer-ci.com/ocular.phar && php ocular.phar code-coverage:upload --format=php-clover coverage.clover \ No newline at end of file diff --git a/.travis.yml b/.travis.yml deleted file mode 100644 index 6b01038..0000000 --- a/.travis.yml +++ /dev/null @@ -1,46 +0,0 @@ -language: php - -env: - global: - - SETUP=stable - -matrix: - fast_finish: true - include: - - php: 7.2 - - php: 7.2 - env: SETUP=lowest - - php: 7.3 - - php: 7.3 - env: SETUP=lowest - - php: 7.4 - - php: 7.4 - env: SETUP=lowest - -sudo: false - -cache: - directories: - - $HOME/.composer/cache - -services: - - memcached - - redis-server - - mysql - -before_install: - - phpenv config-rm xdebug.ini || true - - echo "extension = memcached.so" >> ~/.phpenv/versions/$(phpenv version-name)/etc/php.ini - - printf "\n" | pecl install -f redis - - travis_retry composer self-update - - mysql -e 'CREATE DATABASE forge;' - -install: - - if [[ $SETUP = 'stable' ]]; then travis_retry composer update --prefer-dist --no-interaction --prefer-stable --no-suggest; fi - - if [[ $SETUP = 'lowest' ]]; then travis_retry composer update --prefer-dist --no-interaction --prefer-lowest --prefer-stable --no-suggest; fi - -script: phpdbg -qrr vendor/bin/phpunit --coverage-clover=coverage.clover - -after_script: - - wget https://scrutinizer-ci.com/ocular.phar - - php ocular.phar code-coverage:upload --format=php-clover coverage.clover From 501a45aee8224de492e2494750b3969fc297db53 Mon Sep 17 00:00:00 2001 From: Stephen Finney Date: Fri, 19 Jun 2020 17:12:32 -0400 Subject: [PATCH 2/2] Fix badge URLs --- readme.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/readme.md b/readme.md index 7e221da..e7e48fe 100644 --- a/readme.md +++ b/readme.md @@ -11,8 +11,8 @@ | Branch | Status | Coverage | Code Quality | | ------ | :----: | :------: | :----------: | -| Develop | [![Build Status](https://travis-ci.org/spinen/laravel-discourse-sso.svg?branch=develop)](https://travis-ci.org/spinen/laravel-discourse-sso) | [![Code Coverage](https://scrutinizer-ci.com/g/spinen/laravel-discourse-sso/badges/coverage.png?b=develop)](https://scrutinizer-ci.com/g/spinen/laravel-discourse-sso/?branch=develop) | [![Scrutinizer Code Quality](https://scrutinizer-ci.com/g/spinen/laravel-discourse-sso/badges/quality-score.png?b=develop)](https://scrutinizer-ci.com/g/spinen/laravel-discourse-sso/?branch=develop) | -| Master | [![Build Status](https://travis-ci.org/spinen/laravel-discourse-sso.svg?branch=master)](https://travis-ci.org/spinen/laravel-discourse-sso) | [![Code Coverage](https://scrutinizer-ci.com/g/spinen/laravel-discourse-sso/badges/coverage.png?b=master)](https://scrutinizer-ci.com/g/spinen/laravel-discourse-sso/?branch=master) | [![Scrutinizer Code Quality](https://scrutinizer-ci.com/g/spinen/laravel-discourse-sso/badges/quality-score.png?b=master)](https://scrutinizer-ci.com/g/spinen/laravel-discourse-sso/?branch=master) | +| Develop | [![Build Status](https://github.com/spinen/laravel-discourse-sso/workflows/CI/badge.svg?branch=develop)](https://github.com/spinen/laravel-discourse-sso/workflows/CI/badge.svg?branch=develop) | [![Code Coverage](https://scrutinizer-ci.com/g/spinen/laravel-discourse-sso/badges/coverage.png?b=develop)](https://scrutinizer-ci.com/g/spinen/laravel-discourse-sso/?branch=develop) | [![Scrutinizer Code Quality](https://scrutinizer-ci.com/g/spinen/laravel-discourse-sso/badges/quality-score.png?b=develop)](https://scrutinizer-ci.com/g/spinen/laravel-discourse-sso/?branch=develop) | +| Master | [![Build Status](https://github.com/spinen/laravel-discourse-sso/workflows/CI/badge.svg?branch=master)](https://github.com/spinen/laravel-discourse-sso/workflows/CI/badge.svg?branch=master) | [![Code Coverage](https://scrutinizer-ci.com/g/spinen/laravel-discourse-sso/badges/coverage.png?b=master)](https://scrutinizer-ci.com/g/spinen/laravel-discourse-sso/?branch=master) | [![Scrutinizer Code Quality](https://scrutinizer-ci.com/g/spinen/laravel-discourse-sso/badges/quality-score.png?b=master)](https://scrutinizer-ci.com/g/spinen/laravel-discourse-sso/?branch=master) | ## Prerequisite