diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml new file mode 100644 index 0000000..6cb7388 --- /dev/null +++ b/.github/workflows/ci.yml @@ -0,0 +1,59 @@ +name: CI + +on: + push: + branches: [ master ] + pull_request: + branches: [ master ] + +jobs: + phpunit: + runs-on: ubuntu-latest + + strategy: + matrix: + php-version: + - "7.1" + - "7.2" + - "7.3" + - "7.4" + - "8.0" + deps: + - "high" + include: + - php-version: "7.1" + deps: "low" + + steps: + - name: Checkout + uses: actions/checkout@v2 + + - name: Setup PHP + uses: shivammathur/setup-php@v2 + with: + php-version: ${{ matrix.php-version }} + coverage: xdebug + + - name: Install composer dependencies + run: composer install --no-interaction --no-progress --no-suggest + if: ${{ matrix.deps == 'high' }} + + - name: Install lowest composer dependencies + run: composer update --no-interaction --no-progress --no-suggest --prefer-lowest + if: ${{ matrix.deps == 'low' }} + + - name: Run PHPUnit + run: vendor/bin/phpunit + if: ${{ matrix.php-version != '8.0' }} + + - name: Run PHPUnit with coverage + run: | + mkdir -p mkdir -p build/logs + vendor/bin/phpunit --coverage-clover build/logs/clover.xml + if: ${{ matrix.php-version == '8.0' }} + + - name: Upload coverage report to Coveralls + run: vendor/bin/php-coveralls --coverage_clover=build/logs/clover.xml -v + env: + COVERALLS_REPO_TOKEN: ${{ secrets.GITHUB_TOKEN }} + if: ${{ matrix.php-version == '8.0' }} diff --git a/.travis.yml b/.travis.yml deleted file mode 100644 index 9af1e51..0000000 --- a/.travis.yml +++ /dev/null @@ -1,23 +0,0 @@ -language: php - -php: - - 7.1 - - 7.2 - - 7.3 - - 7.4 - - 8.0 - -matrix: - include: - - php: 7.1.0 - env: dependencies=lowest - -before_script: - - if [ "$dependencies" = "lowest" ]; then composer update --prefer-lowest --prefer-stable; else composer update; fi; - -script: - - mkdir -p build/logs - - vendor/bin/phpunit --coverage-clover build/logs/clover.xml - -after_script: - - vendor/bin/php-coveralls -v