From 1411e824aa0aa6b1e426caca863b4625ecea94c5 Mon Sep 17 00:00:00 2001 From: Ivan Voskoboinyk Date: Tue, 20 Jul 2021 18:08:16 +0300 Subject: [PATCH] Rewrite Travis CI tests to Github Actions --- .github/workflows/test.yml | 51 ++++++++++++++++++++++++++++++++++++++ .travis.yml | 28 --------------------- 2 files changed, 51 insertions(+), 28 deletions(-) create mode 100644 .github/workflows/test.yml delete mode 100644 .travis.yml diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml new file mode 100644 index 0000000..e607065 --- /dev/null +++ b/.github/workflows/test.yml @@ -0,0 +1,51 @@ +on: push +name: Test +jobs: + test: + name: Test + runs-on: ubuntu-latest + strategy: + matrix: + php: [ '7.0', '7.1', '7.2', '7.3', '7.4' ] + + continue-on-error: ${{ matrix.php == '7.4' }} + + steps: + - uses: actions/checkout@master + + - name: Setup PHP + uses: shivammathur/setup-php@v2 + with: + php-version: ${{ matrix.php }} + coverage: xdebug2 + + - name: Install Dependencies + env: + COMPOSER_FLAGS: ${{ (matrix.php == '7.4') && ' --ignore-platform-reqs' || '' }} + run: | + composer install $COMPOSER_FLAGS + + - name: Test + run: | + php -d error_reporting=$(php -r 'echo E_ALL & ~ E_DEPRECATED & ~ E_NOTICE;') \ + -d xdebug.mode=coverage \ + -d xdebug.overload_var_dump=0 \ + vendor/bin/phpunit + + - name: Upload coverage results to Coveralls + env: + COVERALLS_REPO_TOKEN: ${{ secrets.GITHUB_TOKEN }} + COVERALLS_PARALLEL: true + COVERALLS_FLAG_NAME: PHP ${{ matrix.php }} + run: | + composer global require php-coveralls/php-coveralls + php-coveralls --coverage_clover=build/logs/clover.xml -v + + coveralls-webhook: + # @see https://github.com/php-coveralls/php-coveralls#parallel-builds + # @see https://docs.coveralls.io/parallel-build-webhook + name: Merge Coveralls parallel build results + runs-on: ubuntu-latest + needs: test + steps: + - run: curl https://coveralls.io/webhook?repo_token=${{ secrets.GITHUB_TOKEN }} diff --git a/.travis.yml b/.travis.yml deleted file mode 100644 index 1386ccb..0000000 --- a/.travis.yml +++ /dev/null @@ -1,28 +0,0 @@ -language: php - -php: - - 7.0 - - 7.1 - - 7.2 - - 7.3 - - 7.4snapshot - - nightly - -matrix: - allow_failures: - - php: nightly - - php: 7.4snapshot - -sudo: false - -before_script: - - phpenv config-rm xdebug.ini || true - - if [[ $TRAVIS_PHP_VERSION = nightly ]]; then export COMPOSER_FLAGS=" --ignore-platform-reqs"; fi - - composer require satooshi/php-coveralls:~2.0.0 --no-update --dev $COMPOSER_FLAGS - - composer install --prefer-source $COMPOSER_FLAGS - -script: - - php vendor/bin/phpunit - -after_script: - - php vendor/bin/coveralls