diff --git a/.gitattributes b/.gitattributes index 2472968..efb9da6 100644 --- a/.gitattributes +++ b/.gitattributes @@ -1,9 +1,9 @@ * text=auto +/.github export-ignore /build export-ignore /tests export-ignore .gitattributes export-ignore .gitignore export-ignore -.travis.yml export-ignore nitpick.json export-ignore phpunit.xml.dist export-ignore 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 diff --git a/readme.md b/readme.md index c5f4626..3ec95cd 100644 --- a/readme.md +++ b/readme.md @@ -11,8 +11,8 @@ The soft deletes are great in Laravel to make sure that some deleted data can be | Branch | Status | Coverage | Code Quality | | ------ | :----: | :------: | :----------: | -| Develop | [![Build Status](https://travis-ci.org/spinen/laravel-garbage-man.svg?branch=develop)](https://travis-ci.org/spinen/laravel-garbage-man) | [![Code Coverage](https://scrutinizer-ci.com/g/spinen/laravel-garbage-man/badges/coverage.png?b=develop)](https://scrutinizer-ci.com/g/spinen/laravel-garbage-man/?branch=develop) | [![Scrutinizer Code Quality](https://scrutinizer-ci.com/g/spinen/laravel-garbage-man/badges/quality-score.png?b=develop)](https://scrutinizer-ci.com/g/spinen/laravel-garbage-man/?branch=develop) | -| Master | [![Build Status](https://travis-ci.org/spinen/laravel-garbage-man.svg?branch=master)](https://travis-ci.org/spinen/laravel-garbage-man) | [![Code Coverage](https://scrutinizer-ci.com/g/spinen/laravel-garbage-man/badges/coverage.png?b=develop)](https://scrutinizer-ci.com/g/spinen/laravel-garbage-man/?branch=develop) | [![Scrutinizer Code Quality](https://scrutinizer-ci.com/g/spinen/laravel-garbage-man/badges/quality-score.png?b=master)](https://scrutinizer-ci.com/g/spinen/laravel-garbage-man/?branch=master) | +| Develop | [![Build Status](https://github.com/spinen/laravel-garbage-man/workflows/CI/badge.svg?branch=develop)](https://github.com/spinen/laravel-garbage-man/workflows/CI/badge.svg?branch=develop) | [![Code Coverage](https://scrutinizer-ci.com/g/spinen/laravel-garbage-man/badges/coverage.png?b=develop)](https://scrutinizer-ci.com/g/spinen/laravel-garbage-man/?branch=develop) | [![Scrutinizer Code Quality](https://scrutinizer-ci.com/g/spinen/laravel-garbage-man/badges/quality-score.png?b=develop)](https://scrutinizer-ci.com/g/spinen/laravel-garbage-man/?branch=develop) | +| Master | [![Build Status](https://github.com/spinen/laravel-garbage-man/workflows/CI/badge.svg?branch=master)](https://github.com/spinen/laravel-garbage-man/workflows/CI/badge.svg?branch=master) | [![Code Coverage](https://scrutinizer-ci.com/g/spinen/laravel-garbage-man/badges/coverage.png?b=master)](https://scrutinizer-ci.com/g/spinen/laravel-garbage-man/?branch=master) | [![Scrutinizer Code Quality](https://scrutinizer-ci.com/g/spinen/laravel-garbage-man/badges/quality-score.png?b=master)](https://scrutinizer-ci.com/g/spinen/laravel-garbage-man/?branch=master) | ## Prerequisite