Skip to content

Commit

Permalink
Update Coverage Setup + Github Actions
Browse files Browse the repository at this point in the history
  • Loading branch information
MichaelJ2324 committed Dec 17, 2024
1 parent 5d28571 commit 68e8949
Show file tree
Hide file tree
Showing 6 changed files with 113 additions and 25 deletions.
38 changes: 38 additions & 0 deletions .github/workflows/coverage.yml
Original file line number Diff line number Diff line change
@@ -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"
37 changes: 37 additions & 0 deletions .github/workflows/pr-checks-v2.yml
Original file line number Diff line number Diff line change
@@ -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
37 changes: 37 additions & 0 deletions .github/workflows/pr-checks.yml
Original file line number Diff line number Diff line change
@@ -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
21 changes: 0 additions & 21 deletions .travis.yml

This file was deleted.

4 changes: 1 addition & 3 deletions README.md
Original file line number Diff line number Diff line change
@@ -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
Expand All @@ -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.
Expand Down
1 change: 0 additions & 1 deletion phpunit.xml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@
<directory>tests</directory>
</testsuite>
</testsuites>

<coverage cacheDirectory=".phpunit.cache/code-coverage"
processUncoveredFiles="true">
<include>
Expand Down

0 comments on commit 68e8949

Please sign in to comment.