From 8eb99eaf6c4256c97f9ec5aa47fed9b3878134a9 Mon Sep 17 00:00:00 2001 From: Simon Frings Date: Mon, 8 Feb 2021 13:19:29 +0100 Subject: [PATCH] Use GitHub actions for continuous integration (CI) Bye bye Travis CI, you've served us well. --- .gitattributes | 4 ++-- .github/workflows/ci.yml | 28 ++++++++++++++++++++++++++++ .gitignore | 6 ++---- .travis.yml | 22 ---------------------- README.md | 3 +-- 5 files changed, 33 insertions(+), 30 deletions(-) create mode 100644 .github/workflows/ci.yml delete mode 100644 .travis.yml diff --git a/.gitattributes b/.gitattributes index e9da46b9..21be40ca 100644 --- a/.gitattributes +++ b/.gitattributes @@ -1,6 +1,6 @@ /.gitattributes export-ignore +/.github/ export-ignore /.gitignore export-ignore -/.travis.yml export-ignore /phpunit.xml.dist export-ignore /phpunit.xml.legacy export-ignore -/tests export-ignore +/tests/ export-ignore diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml new file mode 100644 index 00000000..2bf63e6c --- /dev/null +++ b/.github/workflows/ci.yml @@ -0,0 +1,28 @@ +name: CI + +on: + push: + pull_request: + +jobs: + PHPUnit: + name: PHPUnit (PHP ${{ matrix.php }}) + runs-on: ubuntu-20.04 + strategy: + matrix: + php: + - 7.4 + - 7.3 + - 7.2 + - 7.1 + steps: + - uses: actions/checkout@v2 + - uses: shivammathur/setup-php@v2 + with: + php-version: ${{ matrix.php }} + coverage: xdebug + - run: composer install + - run: vendor/bin/phpunit --coverage-text + if: ${{ matrix.php >= 7.3 }} + - run: vendor/bin/phpunit --coverage-text -c phpunit.xml.legacy + if: ${{ matrix.php < 7.3 }} diff --git a/.gitignore b/.gitignore index ff40baa3..c8153b57 100644 --- a/.gitignore +++ b/.gitignore @@ -1,4 +1,2 @@ -composer.lock -composer.phar -build/ -vendor/ +/composer.lock +/vendor/ diff --git a/.travis.yml b/.travis.yml deleted file mode 100644 index 30eabd4a..00000000 --- a/.travis.yml +++ /dev/null @@ -1,22 +0,0 @@ -language: php - -# lock distro so new future defaults will not break the build -dist: trusty - -jobs: - include: - - php: 7.1 - - php: 7.2 - - php: 7.3 - - php: 7.4 - -install: - - composer install - -script: - - if [[ "$TRAVIS_PHP_VERSION" > "7.2" ]]; then vendor/bin/phpunit --coverage-text --coverage-clover=./build/logs/clover.xml; fi - - if [[ "$TRAVIS_PHP_VERSION" < "7.3" ]]; then vendor/bin/phpunit --coverage-text --coverage-clover=./build/logs/clover.xml -c phpunit.xml.legacy; fi - -after_script: - - if [ -f ./build/logs/clover.xml ]; then travis_retry composer require php-coveralls/php-coveralls --no-interaction --update-with-dependencies; fi - - if [ -f ./build/logs/clover.xml ]; then php vendor/bin/php-coveralls -v; fi diff --git a/README.md b/README.md index 28ebf048..89b22eb2 100644 --- a/README.md +++ b/README.md @@ -4,8 +4,7 @@ Promise A lightweight implementation of [CommonJS Promises/A](http://wiki.commonjs.org/wiki/Promises/A) for PHP. -[![Build Status](https://travis-ci.org/reactphp/promise.svg?branch=master)](http://travis-ci.org/reactphp/promise) -[![Coverage Status](https://coveralls.io/repos/github/reactphp/promise/badge.svg?branch=master)](https://coveralls.io/github/reactphp/promise?branch=master) +[![CI status](https://github.com/reactphp/promise/workflows/CI/badge.svg)](https://github.com/reactphp/promise/actions) > The master branch contains the code for the upcoming 3.0 release. > For the code of the current stable 2.x release, checkout the