From 68e8949063d962a77c75dd1b4b28037a3dd73667 Mon Sep 17 00:00:00 2001 From: Mike Russell <3056352+MichaelJ2324@users.noreply.github.com> Date: Tue, 17 Dec 2024 16:52:46 -0500 Subject: [PATCH] Update Coverage Setup + Github Actions --- .github/workflows/coverage.yml | 38 ++++++++++++++++++++++++++++++ .github/workflows/pr-checks-v2.yml | 37 +++++++++++++++++++++++++++++ .github/workflows/pr-checks.yml | 37 +++++++++++++++++++++++++++++ .travis.yml | 21 ----------------- README.md | 4 +--- phpunit.xml | 1 - 6 files changed, 113 insertions(+), 25 deletions(-) create mode 100644 .github/workflows/coverage.yml create mode 100644 .github/workflows/pr-checks-v2.yml create mode 100644 .github/workflows/pr-checks.yml delete mode 100644 .travis.yml diff --git a/.github/workflows/coverage.yml b/.github/workflows/coverage.yml new file mode 100644 index 0000000..b05c4b4 --- /dev/null +++ b/.github/workflows/coverage.yml @@ -0,0 +1,38 @@ +name: PR Checks + +on: + push: + branches: [ "master", "3.x" ] + +permissions: read-all + +jobs: + build: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + + - name: Setup PHP with PECL extension + uses: shivammathur/setup-php@v2 + with: + php-version: '8.2' + + - name: Cache Composer packages + id: composer-cache + uses: actions/cache@v3 + with: + path: vendor + key: ${{ runner.os }}-php-${{ hashFiles('**/composer.lock') }} + restore-keys: | + ${{ runner.os }}-php- + + - name: Install dependencies + run: composer install --prefer-dist --no-progress + + - name: Run test suite + run: composer run coverage + + - name: Coveralls + uses: coverallsapp/github-action@v2 + with: + file: "coverage/clover.xml" diff --git a/.github/workflows/pr-checks-v2.yml b/.github/workflows/pr-checks-v2.yml new file mode 100644 index 0000000..d180afd --- /dev/null +++ b/.github/workflows/pr-checks-v2.yml @@ -0,0 +1,37 @@ +name: PR Checks for v2 + +on: + pull_request: + branches: [ "2.x" ] + +permissions: read-all + +jobs: + build: + runs-on: ${{ matrix.operating-system }} + strategy: + matrix: + operating-system: [ubuntu-latest] + php-versions: ['7.4','8.0','8.2'] + steps: + - uses: actions/checkout@v3 + + - name: Setup PHP with PECL extension + uses: shivammathur/setup-php@v2 + with: + php-version: ${{ matrix.php-versions }} + + - name: Cache Composer packages + id: composer-cache + uses: actions/cache@v3 + with: + path: vendor + key: ${{ runner.os }}-php-${{ hashFiles('**/composer.lock') }} + restore-keys: | + ${{ runner.os }}-php- + + - name: Install dependencies + run: composer install --prefer-dist --no-progress + + - name: Run test suite + run: composer run test diff --git a/.github/workflows/pr-checks.yml b/.github/workflows/pr-checks.yml new file mode 100644 index 0000000..b07d79a --- /dev/null +++ b/.github/workflows/pr-checks.yml @@ -0,0 +1,37 @@ +name: PR Checks + +on: + pull_request: + branches: [ "master", "3.x" ] + +permissions: read-all + +jobs: + build: + runs-on: ${{ matrix.operating-system }} + strategy: + matrix: + operating-system: [ubuntu-latest] + php-versions: ['8.0','8.2','8.3'] + steps: + - uses: actions/checkout@v3 + + - name: Setup PHP with PECL extension + uses: shivammathur/setup-php@v2 + with: + php-version: ${{ matrix.php-versions }} + + - name: Cache Composer packages + id: composer-cache + uses: actions/cache@v3 + with: + path: vendor + key: ${{ runner.os }}-php-${{ hashFiles('**/composer.lock') }} + restore-keys: | + ${{ runner.os }}-php- + + - name: Install dependencies + run: composer install --prefer-dist --no-progress + + - name: Run test suite + run: composer run test diff --git a/.travis.yml b/.travis.yml deleted file mode 100644 index e373116..0000000 --- a/.travis.yml +++ /dev/null @@ -1,21 +0,0 @@ -language: php - -php: - - '7.2' - - '7.3' - - '7.4' - - '8.0' - -install: - - composer require satooshi/php-coveralls:~1.0@stable - -before_script: - - mkdir -p build/logs - - composer self-update - - composer install --prefer-source --no-interaction --dev - -script: - - vendor/bin/phpunit --coverage-clover build/logs/clover.xml - -after_success: - - sh -c 'if [ "$TRAVIS_PHP_VERSION" != "hhvm" ]; then php vendor/bin/coveralls -v; fi;' \ No newline at end of file diff --git a/README.md b/README.md index 1c20a13..9d4b0cb 100644 --- a/README.md +++ b/README.md @@ -1,7 +1,5 @@ -[![Minimum PHP Version](https://img.shields.io/badge/php-%3E%3D%205.3-8892BF.svg)](https://php.net/) [![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT) [![Total Downloads](https://poser.pugx.org/michaelj2324/php-rest-client/downloads)](https://packagist.org/packages/michaelj2324/php-rest-client) -[![Build Status](https://travis-ci.org/MichaelJ2324/PHP-REST-Client.svg?branch=master)](https://travis-ci.org/MichaelJ2324/PHP-REST-Client) [![Coverage Status](https://coveralls.io/repos/github/MichaelJ2324/PHP-REST-Client/badge.svg?branch=master)](https://coveralls.io/github/MichaelJ2324/PHP-REST-Client?branch=master) # PHP REST Client @@ -17,7 +15,7 @@ Install via Composer #### Requirements: You need to have installed: -- [php 7.2+](https://php.org/) +- [php 8.0+](https://php.org/) #### Steps: 1. With PHP installed, navigate to the repo folder (php-rest-client) via terminal. diff --git a/phpunit.xml b/phpunit.xml index c2c62f6..34a7363 100644 --- a/phpunit.xml +++ b/phpunit.xml @@ -22,7 +22,6 @@ tests -