From b8560350810f3e0cbb9af8b653f834ad6d49bc68 Mon Sep 17 00:00:00 2001 From: Saif Eddin G <29315886+azjezz@users.noreply.github.com> Date: Wed, 7 Oct 2020 07:25:03 +0200 Subject: [PATCH] use TravisCI to send code coverage (#79) --- .coveralls.yml | 3 +++ .github/workflows/unit-tests.yml | 5 ----- .travis.yml | 29 +++++++++++++++++++++++++++++ README.md | 9 +++++---- composer.json | 4 ++-- 5 files changed, 39 insertions(+), 11 deletions(-) create mode 100644 .coveralls.yml create mode 100644 .travis.yml diff --git a/.coveralls.yml b/.coveralls.yml new file mode 100644 index 0000000..428247c --- /dev/null +++ b/.coveralls.yml @@ -0,0 +1,3 @@ +coverage_clover: tests/logs/clover.xml +json_path: tests/logs/coveralls-upload.json +service_name: travis-ci diff --git a/.github/workflows/unit-tests.yml b/.github/workflows/unit-tests.yml index 4464ceb..e81f847 100644 --- a/.github/workflows/unit-tests.yml +++ b/.github/workflows/unit-tests.yml @@ -49,8 +49,3 @@ jobs: - name: "running unit tests ( phpunit )" run: "composer test:unit" - - - name: "sending code coverage data to coveralls" - env: - COVERALLS_REPO_TOKEN: ${{ secrets.GITHUB_TOKEN }} - run: "php vendor/bin/coveralls tests/logs/clover.xml" diff --git a/.travis.yml b/.travis.yml new file mode 100644 index 0000000..29748dc --- /dev/null +++ b/.travis.yml @@ -0,0 +1,29 @@ +dist: trusty +language: php +sudo: required +os: + - linux + +jobs: + include: + - php: 7.4 + fast_finish: true + +cache: + directories: + - $HOME/.composer/cache/files + +before_install: + - git clone -b stable https://github.com/jedisct1/libsodium.git + - cd libsodium && sudo ./configure && sudo make check && sudo make install && cd .. + +install: + - pecl channel-update pecl.php.net + - pecl install libsodium + - composer install + +script: + - composer test:unit + +after_script: + - composer code:coverage diff --git a/README.md b/README.md index 43eaaf1..903d1a3 100644 --- a/README.md +++ b/README.md @@ -1,9 +1,10 @@ # Psl - PHP Standard Library -![unit tests status](https://github.com/azjezz/psl/workflows/unit%20tests/badge.svg?branch=develop) -![static analysis status](https://github.com/azjezz/psl/workflows/static%20analysis/badge.svg?branch=develop) -![security analysis status](https://github.com/azjezz/psl/workflows/security%20analysis/badge.svg?branch=develop) -![coding standards status](https://github.com/azjezz/psl/workflows/coding%20standards/badge.svg?branch=develop) +![Unit tests status](https://github.com/azjezz/psl/workflows/unit%20tests/badge.svg?branch=develop) +![Static analysis status](https://github.com/azjezz/psl/workflows/static%20analysis/badge.svg?branch=develop) +![Security analysis status](https://github.com/azjezz/psl/workflows/security%20analysis/badge.svg?branch=develop) +![Coding standards status](https://github.com/azjezz/psl/workflows/coding%20standards/badge.svg?branch=develop) +[![TravisCI Build Status](https://travis-ci.com/azjezz/psl.svg?branch=develop)](https://travis-ci.com/azjezz/psl) [![Scrutinizer Build Status](https://scrutinizer-ci.com/g/azjezz/psl/badges/build.png?b=develop)](https://scrutinizer-ci.com/g/azjezz/psl/build-status/develop) [![Coverage Status](https://coveralls.io/repos/github/azjezz/psl/badge.svg?branch=develop)](https://coveralls.io/github/azjezz/psl?branch=develop) [![Type Coverage](https://shepherd.dev/github/azjezz/psl/coverage.svg)](https://shepherd.dev/github/azjezz/psl) diff --git a/composer.json b/composer.json index 9c80124..5dfbc45 100644 --- a/composer.json +++ b/composer.json @@ -19,7 +19,7 @@ "require-dev": { "vimeo/psalm": "dev-master", "phpunit/phpunit": "^9.0", - "cedx/coveralls": "dev-main", + "php-coveralls/php-coveralls": "^2.2", "roave/security-advisories": "dev-master", "squizlabs/php_codesniffer": "^3.5" }, @@ -42,7 +42,7 @@ "type:check": "psalm", "type:coverage": "psalm --shepherd", "test:unit": "phpunit", - "code:coverage": "coveralls tests/logs/clover.xml", + "code:coverage": "php-coveralls -v", "security:analysis": "psalm --taint-analysis", "check": [ "@cs:check",