From acc5916f0539b73edb8a2511d392ee82f4727b70 Mon Sep 17 00:00:00 2001 From: Woody Gilk Date: Tue, 20 Jul 2021 07:40:37 -0500 Subject: [PATCH] Switch to Github Actions --- .github/workflows/ci.yaml | 60 +++++++++++++++++++++++++++++++++++++++ .travis.yml | 32 --------------------- 2 files changed, 60 insertions(+), 32 deletions(-) create mode 100644 .github/workflows/ci.yaml delete mode 100644 .travis.yml diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml new file mode 100644 index 0000000..6d076b8 --- /dev/null +++ b/.github/workflows/ci.yaml @@ -0,0 +1,60 @@ +name: CI + +on: + pull_request: + push: + branches: [ master ] + +jobs: + run: + runs-on: ubuntu-18.04 + strategy: + fail-fast: false + matrix: + php: + - '7.3' + - '7.4' + - '8.0' + minimum_versions: [false] + coverage: ['none'] + include: + - description: 'Minimum version' + php: '7.3' + minimum_versions: true + - description: 'Log Code Coverage' + php: '8.0' + coverage: 'xdebug' + + name: PHP ${{ matrix.php }} ${{ matrix.description }} + steps: + - name: Checkout + uses: actions/checkout@v2 + + - uses: actions/cache@v2 + with: + path: ~/.composer/cache/files + key: ${{ matrix.php }} + + - name: Setup PHP + uses: shivammathur/setup-php@v2 + with: + php-version: ${{ matrix.php }} + coverage: ${{ matrix.coverage }} + + - name: Install dependencies + run: composer install + if: matrix.minimum_versions == false + + - name: Install dependencies (lowest versions) + run: composer update --no-interaction --prefer-lowest + if: matrix.minimum_versions == true + + - name: Run PHPUnit tests + run: vendor/bin/phpunit + + - name: Upload code coverage + uses: codecov/codecov-action@v2 + if: matrix.coverage == 'xdebug' + with: + file: './build/logs/clover.xml' + fail_ci_if_error: true diff --git a/.travis.yml b/.travis.yml deleted file mode 100644 index ba0d99f..0000000 --- a/.travis.yml +++ /dev/null @@ -1,32 +0,0 @@ -language: php - -php: - - 7.3 - - 7.4 - - 8.0 - -sudo: false - -cache: - directories: - - $HOME/.composer/cache - - vendor - -git: - depth: 1 - -matrix: - include: - - php: 7.3 - env: - - COMPOSER_FLAGS="--prefer-stable --prefer-lowest" - -before_script: - - travis_retry composer update ${COMPOSER_FLAGS} --no-interaction --prefer-source - -script: - - vendor/bin/phpunit - -after_script: - - bash -c '[[ -f "build/logs/clover.xml" ]] && wget https://scrutinizer-ci.com/ocular.phar' - - bash -c '[[ -f "build/logs/clover.xml" ]] && php ocular.phar code-coverage:upload --format=php-clover build/logs/clover.xml'