From 19e6a4c65b48dda6ddee65bb596f0c566f5b691d 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 | 40 ++++++++++++++++++++++++++++++++++++++ .travis.yml | 28 -------------------------- 2 files changed, 40 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..9307c50 --- /dev/null +++ b/.github/workflows/test.yml @@ -0,0 +1,40 @@ +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 }} + run: | + composer global require php-coveralls/php-coveralls + php-coveralls --coverage_clover=build/logs/clover.xml -v 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