diff --git a/.gitattributes b/.gitattributes index dfede83..dae39b4 100644 --- a/.gitattributes +++ b/.gitattributes @@ -1,6 +1,6 @@ /.gitattributes export-ignore /.gitignore export-ignore -/.travis.yml export-ignore +/.github/ export-ignore /CONTRIBUTING.md export-ignore /fixtures/ 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..5b44684 --- /dev/null +++ b/.github/workflows/ci.yml @@ -0,0 +1,58 @@ +name: CI + +on: + push: + pull_request: + # Allow manually triggering the workflow. + workflow_dispatch: + +# Cancels all previous workflow runs for the same branch that have not yet completed. +concurrency: + group: ${{ github.workflow }}-${{ github.ref }} + cancel-in-progress: true + +jobs: + check_composer: + name: Check composer.json + runs-on: ubuntu-latest + steps: + - name: Checkout code + uses: actions/checkout@v2 + + - name: Setup PHP + uses: shivammathur/setup-php@v2 + with: + php-version: '8.0' + coverage: none + + - name: Validate composer.json + run: composer validate --strict --no-check-lock + + test: + runs-on: ubuntu-latest + + strategy: + fail-fast: false + matrix: + php: ['7.3', '7.4', '8.0', '8.1'] + + name: PHP ${{ matrix.php }} + + steps: + - name: Checkout code + uses: actions/checkout@v2 + + - name: Setup PHP + uses: shivammathur/setup-php@v2 + with: + php-version: ${{ matrix.php }} + ini-values: zend.assertions=1, error_reporting=-1, display_errors=On + coverage: xdebug + + # Install dependencies and handle caching in one go. + # @link https://github.com/marketplace/actions/install-composer-dependencies + - name: Install Composer dependencies + uses: "ramsey/composer-install@v1" + + - name: Execute Unit Tests + run: vendor/bin/phpunit --coverage-text diff --git a/.travis.yml b/.travis.yml deleted file mode 100644 index d7218f0..0000000 --- a/.travis.yml +++ /dev/null @@ -1,19 +0,0 @@ -language: php - -sudo: false - -php: - - 7.3 - - 7.4 - -jobs: - include: - - php: nightly - env: COMPOSER_FLAGS='--ignore-platform-reqs' - allow_failures: - - php: nightly - - -install: composer update $COMPOSER_FLAGS - -script: ./vendor/bin/phpunit --coverage-text diff --git a/README.md b/README.md index cb9f604..ee0e1b0 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,6 @@ # Prophecy -[![Build Status](https://travis-ci.org/phpspec/prophecy-phpunit.png?branch=master)](https://travis-ci.org/phpspec/prophecy-phpunit) +[![Build Status](https://github.com/phpspec/prophecy-phpunit/actions/workflows/ci.yml/badge.svg)](https://github.com/phpspec/prophecy-phpunit/actions/workflows/ci.yml) Prophecy PhpUnit integrates the [Prophecy](https://github.com/phpspec/prophecy) mocking library with [PHPUnit](https://phpunit.de) to provide an easier mocking in your testsuite.