From e993c379b08d8f8c7ee34ede87dbff00bbfb2569 Mon Sep 17 00:00:00 2001 From: Hari K T Date: Sat, 5 Feb 2022 15:31:01 +0530 Subject: [PATCH] Add ci for 5.3 onwards --- .github/workflows/continuous-integration.yml | 61 ++++++++++++++++++++ .scrutinizer.yml | 14 ++--- .travis.yml | 45 --------------- LICENSE | 2 +- README.md | 6 +- composer.json | 3 +- tests/ContainerTest.php | 60 +++++++++---------- 7 files changed, 102 insertions(+), 89 deletions(-) create mode 100644 .github/workflows/continuous-integration.yml delete mode 100644 .travis.yml diff --git a/.github/workflows/continuous-integration.yml b/.github/workflows/continuous-integration.yml new file mode 100644 index 0000000..a7bf8fe --- /dev/null +++ b/.github/workflows/continuous-integration.yml @@ -0,0 +1,61 @@ +name: Continuous Integration + +on: + push: + pull_request: + workflow_dispatch: + +jobs: + build: + + runs-on: ubuntu-latest + + strategy: + matrix: + operating-system: + - ubuntu-latest + php-version: + - '5.3' + - '5.4' + - '5.5' + - '5.6' + - '7.0' + - '7.1' + - '7.2' + - '7.3' + - '7.4' + - '8.0' + - '8.1' + steps: + - name: Checkout + uses: actions/checkout@v1 + + - name: Setup PHP ${{ matrix.php-version }} + uses: shivammathur/setup-php@v2 + with: + php-version: ${{ matrix.php-version }} + coverage: xdebug + tools: none + ini-values: assert.exception=1, zend.assertions=1 + + - 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 install --no-interaction --prefer-dist + + - name: Run test suite + run: php -d xdebug.mode=coverage ./vendor/bin/phpunit --coverage-clover=coverage.xml + + - name: Upload coverage report + uses: codecov/codecov-action@v2 + with: + fail_ci_if_error: false diff --git a/.scrutinizer.yml b/.scrutinizer.yml index 7c7c845..552f1f2 100644 --- a/.scrutinizer.yml +++ b/.scrutinizer.yml @@ -1,10 +1,8 @@ +build: + nodes: + analysis: + tests: + override: + - php-scrutinizer-run filter: paths: ["src/*"] -tools: - external_code_coverage: true - php_code_coverage: true - php_sim: true - php_mess_detector: true - php_pdepend: true - php_analyzer: true - php_cpd: true diff --git a/.travis.yml b/.travis.yml deleted file mode 100644 index a8bef7c..0000000 --- a/.travis.yml +++ /dev/null @@ -1,45 +0,0 @@ -language: php - -matrix: - include: - - os: linux - dist: precise - sudo: false - php: 5.3 - - os: linux - dist: precise - sudo: false - php: 5.4 - - os: linux - dist: precise - sudo: false - php: 5.5 - - os: linux - dist: precise - sudo: false - php: 5.6 - - os: linux - dist: trusty - sudo: false - php: 7 - - os: linux - dist: trusty - sudo: false - php: 7.1 - - os: linux - dist: trusty - sudo: false - php: hhvm - - os: linux - dist: trusty - sudo: false - php: nightly - -before_script: - - composer self-update - - composer install -script: - - ./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/LICENSE b/LICENSE index 5fbde86..db731c6 100644 --- a/LICENSE +++ b/LICENSE @@ -1,4 +1,4 @@ -Copyright (c) 2011-2017, The Aura Project for PHP +Copyright (c) 2011-2022, The Aura Project for PHP All rights reserved. Redistribution and use in source and binary forms, with or without diff --git a/README.md b/README.md index f2a8eb0..b63b760 100644 --- a/README.md +++ b/README.md @@ -15,10 +15,10 @@ Alternatively, [download a release](https://github.com/auraphp/Aura.Html/release ### Quality [![Scrutinizer Code Quality](https://scrutinizer-ci.com/g/auraphp/Aura.Html/badges/quality-score.png?b=2.x)](https://scrutinizer-ci.com/g/auraphp/Aura.Html/) -[![Code Coverage](https://scrutinizer-ci.com/g/auraphp/Aura.Html/badges/coverage.png?b=2.x)](https://scrutinizer-ci.com/g/auraphp/Aura.Html/) -[![Build Status](https://travis-ci.org/auraphp/Aura.Html.png?branch=2.x)](https://travis-ci.org/auraphp/Aura.Html) +[![codecov](https://codecov.io/gh/auraphp/Aura.Html/branch/2.x/graph/badge.svg?token=UASDouLxyc)](https://codecov.io/gh/auraphp/Aura.Html) +[![Continuous Integration](https://github.com/auraphp/Aura.Html/actions/workflows/continuous-integration.yml/badge.svg?branch=2.x)](https://github.com/auraphp/Aura.Html/actions/workflows/continuous-integration.yml) -To run the unit tests at the command line, issue `composer install` and then `phpunit` at the package root. This requires [Composer](http://getcomposer.org/) to be available as `composer`, and [PHPUnit](http://phpunit.de/manual/) to be available as `phpunit`. +To run the unit tests at the command line, issue `composer install` and then `vendor/bin/phpunit` at the package root. This requires [Composer](http://getcomposer.org/) to be available as `composer`. This library attempts to comply with [PSR-1][], [PSR-2][], and [PSR-4][]. If you notice compliance oversights, please send a patch via pull request. diff --git a/composer.json b/composer.json index 2bacfa2..16138d5 100644 --- a/composer.json +++ b/composer.json @@ -39,8 +39,7 @@ } }, "require-dev": { - "aura/di": "~2.0", - "phpunit/phpunit": "~5.7 || ~4.8" + "yoast/phpunit-polyfills": "~1.0" }, "autoload-dev": { "psr-4": { diff --git a/tests/ContainerTest.php b/tests/ContainerTest.php index 1db3b3a..71d8bb4 100644 --- a/tests/ContainerTest.php +++ b/tests/ContainerTest.php @@ -1,36 +1,36 @@