Skip to content

switch to github actions #18

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Dec 6, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .github/workflows/.editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
[*.yml]
indent_size = 2
99 changes: 99 additions & 0 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,99 @@
name: tests

on:
push:
branches:
- master
pull_request:

jobs:
latest:
name: PHP ${{ matrix.php }} Latest with Symfony ${{ matrix.symfony-require }}
runs-on: ubuntu-latest
strategy:
matrix:
php: ['7.3', '7.4', '8.0']
symfony-require: ['*']
include:
- php: '7.4'
symfony-require: 3.4.*
- php: '7.4'
symfony-require: 4.4.*
- php: '8.0'
symfony-require: 5.4.*

steps:
- name: Checkout code
uses: actions/checkout@v2

- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php }}
tools: composer:v2
coverage: none

- name: Composer validate
run: composer validate --strict --no-check-lock

- name: Globally install symfony/flex
if: matrix.symfony-require != '*'
run: composer global require --no-progress --no-scripts --no-plugins symfony/flex

- name: Install dependencies
run: composer update --prefer-dist --no-interaction --no-progress

- name: Execute tests
run: composer test

lowest:
name: PHP ${{ matrix.php }} Lowest
runs-on: ubuntu-latest
strategy:
matrix:
php: ['7.3']

steps:
- name: Checkout code
uses: actions/checkout@v2

- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php }}
tools: composer:v2
coverage: none

- name: Install dependencies
run: composer update --prefer-dist --prefer-stable --prefer-lowest --no-interaction --no-progress

- name: Execute tests
run: composer test

coverage:
name: Code Coverage
runs-on: ubuntu-latest

steps:
- name: Checkout code
uses: actions/checkout@v2

- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: 7.4
tools: composer:v2
coverage: xdebug

- name: Install dependencies
run: |
composer require "friends-of-phpspec/phpspec-code-coverage:^6.1.0" --no-interaction --no-update
composer update --prefer-dist --no-interaction --no-progress

- name: Execute tests
run: composer test-ci

- name: Upload coverage
run: |
wget https://scrutinizer-ci.com/ocular.phar
php ocular.phar code-coverage:upload --format=php-clover build/coverage.xml
60 changes: 0 additions & 60 deletions .travis.yml

This file was deleted.

2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

[![Latest Version](https://img.shields.io/github/release/php-http/stopwatch-plugin.svg?style=flat-square)](https://github.com/php-http/stopwatch-plugin/releases)
[![Software License](https://img.shields.io/badge/license-MIT-brightgreen.svg?style=flat-square)](LICENSE)
[![Build Status](https://img.shields.io/travis/php-http/stopwatch-plugin.svg?style=flat-square)](https://travis-ci.org/php-http/stopwatch-plugin)
[![Build Status](https://github.com/php-http/stopwatch-plugin/actions/workflows/tests.yml/badge.svg)](https://github.com/php-http/stopwatch-plugin/actions/workflows/tests.yml)
[![Code Coverage](https://img.shields.io/scrutinizer/coverage/g/php-http/stopwatch-plugin.svg?style=flat-square)](https://scrutinizer-ci.com/g/php-http/stopwatch-plugin)
[![Quality Score](https://img.shields.io/scrutinizer/g/php-http/stopwatch-plugin.svg?style=flat-square)](https://scrutinizer-ci.com/g/php-http/stopwatch-plugin)
[![Total Downloads](https://img.shields.io/packagist/dt/php-http/stopwatch-plugin.svg?style=flat-square)](https://packagist.org/packages/php-http/stopwatch-plugin)
Expand Down
2 changes: 1 addition & 1 deletion phpspec.yml.ci
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ suites:
psr4_prefix: Http\Client\Common\Plugin
formatter.name: pretty
extensions:
- PhpSpec\Extension\CodeCoverageExtension
FriendsOfPhpSpec\PhpSpec\CodeCoverage\CodeCoverageExtension: ~
code_coverage:
format: clover
output: build/coverage.xml
5 changes: 0 additions & 5 deletions src/StopwatchPlugin.php
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,6 @@ final class StopwatchPlugin implements Plugin
*/
private $stopwatch;

/**
* @param Stopwatch $stopwatch
*/
public function __construct(Stopwatch $stopwatch)
{
$this->stopwatch = $stopwatch;
Expand All @@ -51,8 +48,6 @@ protected function doHandleRequest(RequestInterface $request, callable $next, ca
/**
* Generates the event name.
*
* @param RequestInterface $request
*
* @return string
*/
private function getStopwatchEventName(RequestInterface $request)
Expand Down