From 431cc482d590708d6cd2afdea7dcca0dd2cd930a Mon Sep 17 00:00:00 2001 From: Ryan Holt Date: Fri, 7 Apr 2023 00:08:24 -0400 Subject: [PATCH 1/4] Replace Travis CI with Github Actions Adds test script to composer Remove old unsupported versions of PHP Remove newer unsupported PHP versions Remove travis ci config --- .github/workflows/.run-tests.yml | 44 ++++++++++++++++++++++++++++++++ .travis.yml | 16 ------------ composer.json | 6 +++++ 3 files changed, 50 insertions(+), 16 deletions(-) create mode 100644 .github/workflows/.run-tests.yml delete mode 100644 .travis.yml diff --git a/.github/workflows/.run-tests.yml b/.github/workflows/.run-tests.yml new file mode 100644 index 0000000..a5fb61d --- /dev/null +++ b/.github/workflows/.run-tests.yml @@ -0,0 +1,44 @@ +name: Unit Tests + +on: + push: + branches: + - master + - gh-actions + pull_request: + branches: + - "*" + schedule: + - cron: '0 0 * * *' + +jobs: + php-tests: + runs-on: ubuntu-latest + timeout-minutes: 15 + env: + COMPOSER_NO_INTERACTION: 1 + + strategy: + matrix: + php: [7.3, 7.2] + dependency-version: [prefer-lowest, prefer-stable] + + name: P${{ matrix.php }} - ${{ matrix.dependency-version }} + + steps: + - name: Checkout code + uses: actions/checkout@v3 + + - name: Setup PHP + uses: shivammathur/setup-php@v2 + with: + php-version: ${{ matrix.php }} + coverage: xdebug + tools: composer:v2 + + - name: Install dependencies + run: | + composer update --${{ matrix.dependency-version }} --prefer-dist + + - name: Execute Unit Tests + run: composer test \ No newline at end of file diff --git a/.travis.yml b/.travis.yml deleted file mode 100644 index e4e9f17..0000000 --- a/.travis.yml +++ /dev/null @@ -1,16 +0,0 @@ -language: php - -sudo: false - -php: - - 7.2 - -before_script: - - travis_retry composer self-update - - travis_retry composer update ${COMPOSER_FLAGS} --no-interaction --prefer-source - -script: - - php vendor/bin/phpunit --coverage-text --coverage-clover=coverage.clover - -after_script: - - php vendor/bin/ocular code-coverage:upload --format=php-clover coverage.clover diff --git a/composer.json b/composer.json index 353f9f0..22acfab 100644 --- a/composer.json +++ b/composer.json @@ -41,5 +41,11 @@ "branch-alias": { "dev-master": "4.0.x-dev" } + }, + "scripts": { + "test": [ + "@putenv XDEBUG_MODE=coverage", + "vendor/bin/phpunit --coverage-text --coverage-clover=coverage.clover" + ] } } From bf104433d2139da9072fe46f8528b24a756ac499 Mon Sep 17 00:00:00 2001 From: Ryan Holt Date: Fri, 7 Apr 2023 00:27:33 -0400 Subject: [PATCH 2/4] Remove gh-actions branch from workflow --- .github/workflows/.run-tests.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/.github/workflows/.run-tests.yml b/.github/workflows/.run-tests.yml index a5fb61d..1fc7ed4 100644 --- a/.github/workflows/.run-tests.yml +++ b/.github/workflows/.run-tests.yml @@ -4,7 +4,6 @@ on: push: branches: - master - - gh-actions pull_request: branches: - "*" From abe621a7f91c58e1fa8f710ff77be392749f10e8 Mon Sep 17 00:00:00 2001 From: Ryan Holt Date: Fri, 7 Apr 2023 07:36:33 -0400 Subject: [PATCH 3/4] Fix file name --- .github/workflows/{.run-tests.yml => run-tests.yml} | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename .github/workflows/{.run-tests.yml => run-tests.yml} (100%) diff --git a/.github/workflows/.run-tests.yml b/.github/workflows/run-tests.yml similarity index 100% rename from .github/workflows/.run-tests.yml rename to .github/workflows/run-tests.yml From e00bcabbc91976559f2433f9a974d6dea1ca1d29 Mon Sep 17 00:00:00 2001 From: Ryan Holt Date: Fri, 7 Apr 2023 07:38:51 -0400 Subject: [PATCH 4/4] Replace CI badge in readme --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index d24a8d9..347cd7e 100644 --- a/README.md +++ b/README.md @@ -2,7 +2,7 @@ **Braintree driver for the Omnipay PHP payment processing library** -[![Build Status](https://travis-ci.org/thephpleague/omnipay-braintree.svg?branch=master)](https://travis-ci.org/thephpleague/omnipay-braintree) +[![Unit Tests](https://github.com/thephpleague/omnipay-braintree/actions/workflows/run-tests.yml/badge.svg)](https://github.com/thephpleague/omnipay-braintree/actions/workflows/run-tests.yml) [![Latest Stable Version](https://poser.pugx.org/omnipay/braintree/version.png)](https://packagist.org/packages/omnipay/braintree) [![Total Downloads](https://poser.pugx.org/omnipay/braintree/d/total.png)](https://packagist.org/packages/omnipay/braintree)