diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml new file mode 100644 index 0000000..220dc0f --- /dev/null +++ b/.github/workflows/main.yml @@ -0,0 +1,72 @@ +name: CI + +on: + push: + branches: [ master ] + pull_request: + branches: [ master ] + + workflow_dispatch: + +jobs: + build: + runs-on: ubuntu-latest + strategy: + fail-fast: false + matrix: + include: + - php-versions: '5.6' + phpunit-versions: '5.7.27' + - php-versions: '7.0' + phpunit-versions: '6.5.14' + - php-versions: '7.1' + phpunit-versions: '7.5.20' + - php-versions: '7.2' + phpunit-versions: '7.5.20' + - php-versions: '7.3' + phpunit-versions: '7.5.20' + - php-versions: '7.4' + phpunit-versions: '7.5.20' +# - php-versions: '8.0' +# phpunit-versions: '9.5.1' + + name: PHP ${{ matrix.php-versions }}, PHPUnit ${{ matrix.phpunit-versions }} + steps: + - name: Checkout + uses: actions/checkout@v2 + + - name: Setup PHP + uses: shivammathur/setup-php@v2 + with: + php-version: ${{ matrix.php-versions }} + coverage: xdebug + tools: phpunit:${{ matrix.phpunit-versions }} + + - 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.lock') }} + restore-keys: ${{ runner.os }}-composer- + + - name: Install Dependencies + run: composer update --prefer-dist --no-interaction + + - name: Run Tests + run: | + mkdir -p build/logs + phpunit --coverage-clover build/logs/clover.xml + + - name: Downloading Scrutinizer CI binary + run: wget https://scrutinizer-ci.com/ocular.phar + + - name: Upload coverage to Codecov + uses: codecov/codecov-action@v1 + + - name: Uploading code coverage to Scrutinizer CI + run: php ocular.phar code-coverage:upload --format=php-clover build/logs/clover.xml + diff --git a/.travis.yml b/.travis.yml deleted file mode 100644 index bdbdcf2..0000000 --- a/.travis.yml +++ /dev/null @@ -1,30 +0,0 @@ -sudo: false -language: php - -cache: - directories: - - $HOME/.composer/cache/files - -php: - - 5.6 - - 7.0 - - 7.1 - -before_install: - - composer config -g github-oauth.github.com 8a184177873281ce443912bd9f8fc4a959f7e7bb - -install: - - composer update --prefer-dist --no-interaction - -before_script: - - mkdir -p build/logs - -script: - - phpunit --coverage-clover build/logs/clover.xml - -after_success: - - bash <(curl -s https://codecov.io/bash) - -after_script: - - wget https://scrutinizer-ci.com/ocular.phar -t 3 - - php ocular.phar code-coverage:upload --format=php-clover build/logs/clover.xml diff --git a/README.md b/README.md index a67843d..39d2f29 100755 --- a/README.md +++ b/README.md @@ -1,6 +1,6 @@ # Code-Insight -[![Build Status](https://travis-ci.org/console-helpers/code-insight.svg?branch=master)](https://travis-ci.org/console-helpers/code-insight) +[![CI](https://github.com/console-helpers/code-insight/workflows/CI/badge.svg)](https://github.com/console-helpers/code-insight/actions?query=workflow%3ACI) [![codecov](https://codecov.io/gh/console-helpers/code-insight/branch/master/graph/badge.svg)](https://codecov.io/gh/console-helpers/code-insight) [![Scrutinizer Code Quality](https://scrutinizer-ci.com/g/console-helpers/code-insight/badges/quality-score.png?b=master)](https://scrutinizer-ci.com/g/console-helpers/code-insight/?branch=master)