From d22eb8cd88ec4858ff8c0a6928fce21479b762b2 Mon Sep 17 00:00:00 2001 From: Jonathan Foote Date: Wed, 27 Jan 2021 13:06:33 -0600 Subject: [PATCH 1/4] Ignore phpunit cache files --- .gitignore | 1 + 1 file changed, 1 insertion(+) diff --git a/.gitignore b/.gitignore index bafda97..5ed2b48 100644 --- a/.gitignore +++ b/.gitignore @@ -2,3 +2,4 @@ composer.phar composer.lock /vendor/ /build/ +.phpunit.result.cache From e81b4a3bfa433b93e352a0f0c7bb2572a4ea8157 Mon Sep 17 00:00:00 2001 From: Jonathan Foote Date: Wed, 27 Jan 2021 13:07:42 -0600 Subject: [PATCH 2/4] Updating code coverage badge --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 39cc05b..51fe5b1 100644 --- a/README.md +++ b/README.md @@ -2,7 +2,7 @@ [![Software License](https://img.shields.io/badge/license-MIT-brightgreen.svg?style=flat-square)](LICENSE) [![Build Status](https://img.shields.io/travis/zumba/amplitude-php/master.svg?style=flat-square)](https://travis-ci.org/zumba/amplitude-php) -[![Code Coverage](https://img.shields.io/coveralls/zumba/amplitude-php/master.svg)](https://coveralls.io/github/zumba/amplitude-php) +[![Coverage Status](https://coveralls.io/repos/github/zumba/amplitude-php/badge.svg?branch=master)](https://coveralls.io/github/zumba/amplitude-php?branch=master) [![Scrutinizer](https://scrutinizer-ci.com/g/zumba/amplitude-php/badges/quality-score.png?b=master)](https://scrutinizer-ci.com/g/zumba/amplitude-php/) This is a moderately thin PHP API for [Amplitude](https://amplitude.com/), powerful enough to do what you need without getting in the way. Designed to work well in 2 main scenarios: From 678a8e81312aa0984e211a0ffb6cd0b75c9bd791 Mon Sep 17 00:00:00 2001 From: Jonathan Foote Date: Wed, 27 Jan 2021 13:08:24 -0600 Subject: [PATCH 3/4] Use Github Actions for automated tests --- .github/workflows/ci.yml | 36 ++++++++++++++++++++++++++++++++++++ .travis.yml | 17 ----------------- composer.json | 3 ++- phpunit.xml | 5 +++++ 4 files changed, 43 insertions(+), 18 deletions(-) create mode 100644 .github/workflows/ci.yml delete mode 100644 .travis.yml diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml new file mode 100644 index 0000000..cd890d3 --- /dev/null +++ b/.github/workflows/ci.yml @@ -0,0 +1,36 @@ +name: Amplitude PHP CI + +on: + push: + branches: [ master ] + pull_request: + branches: [ master ] + +jobs: + testsuite: + runs-on: ubuntu-latest + strategy: + matrix: + php-version: ['7.2', '7.3', '7.4'] + name: PHP ${{ matrix.php-version }} + steps: + - uses: actions/checkout@v2 + - name: Setup PHP with XDebug + uses: shivammathur/setup-php@v2 + with: + php-version: ${{ matrix.php-version }} + coverage: xdebug + - name: Validate composer.json + run: composer validate + - name: Install dependencies + run: composer install + - name: Run test suite + run: vendor/bin/phpunit --coverage-clover build/logs/clover.xml + - name: PSR2 coverage + run: vendor/bin/phpcs --standard=psr2 src test + + - name: Upload coverage results to Coveralls (only for one result) + if: matrix.php-version == '7.2' + env: + COVERALLS_REPO_TOKEN: ${{ secrets.GITHUB_TOKEN }} + run: vendor/bin/php-coveralls --coverage_clover=build/logs/clover.xml -v diff --git a/.travis.yml b/.travis.yml deleted file mode 100644 index 9e4d269..0000000 --- a/.travis.yml +++ /dev/null @@ -1,17 +0,0 @@ -language: php -sudo: false - -php: - - 7.2 - - 7.3 - -before_script: - - composer require satooshi/php-coveralls - - composer install --dev - -script: - - vendor/bin/phpunit --coverage-clover build/logs/clover.xml - - ./vendor/bin/phpcs --standard=psr2 src test - -after_success: - - php vendor/bin/coveralls diff --git a/composer.json b/composer.json index ecd3caa..0f013d8 100644 --- a/composer.json +++ b/composer.json @@ -22,7 +22,8 @@ }, "require-dev": { "phpunit/phpunit": "8.3.*", - "squizlabs/php_codesniffer": "3.4.*" + "squizlabs/php_codesniffer": "3.4.*", + "php-coveralls/php-coveralls": "^2.4" }, "autoload": { "psr-4": { diff --git a/phpunit.xml b/phpunit.xml index 3cda678..3fa7cdc 100644 --- a/phpunit.xml +++ b/phpunit.xml @@ -13,4 +13,9 @@ ./test + + + ./src + + From f297e5465989dab7c3d378bff73dc6a737f0698f Mon Sep 17 00:00:00 2001 From: Jonathan Foote Date: Wed, 27 Jan 2021 13:17:32 -0600 Subject: [PATCH 4/4] Replace travis build badge with github workflow badge --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 51fe5b1..43463fa 100644 --- a/README.md +++ b/README.md @@ -1,7 +1,7 @@ # Zumba amplitude-php [![Software License](https://img.shields.io/badge/license-MIT-brightgreen.svg?style=flat-square)](LICENSE) -[![Build Status](https://img.shields.io/travis/zumba/amplitude-php/master.svg?style=flat-square)](https://travis-ci.org/zumba/amplitude-php) +![Build Status](https://github.com/zumba/amplitude-php/workflows/Amplitude%20PHP%20CI/badge.svg) [![Coverage Status](https://coveralls.io/repos/github/zumba/amplitude-php/badge.svg?branch=master)](https://coveralls.io/github/zumba/amplitude-php?branch=master) [![Scrutinizer](https://scrutinizer-ci.com/g/zumba/amplitude-php/badges/quality-score.png?b=master)](https://scrutinizer-ci.com/g/zumba/amplitude-php/)