Skip to content

Commit c764d91

Browse files
authored
Merge pull request #18 from php-http/github-actions
switch to github actions
2 parents ca38350 + a78a3d5 commit c764d91

File tree

6 files changed

+103
-67
lines changed

6 files changed

+103
-67
lines changed

.github/workflows/.editorconfig

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
[*.yml]
2+
indent_size = 2

.github/workflows/tests.yml

Lines changed: 99 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,99 @@
1+
name: tests
2+
3+
on:
4+
push:
5+
branches:
6+
- master
7+
pull_request:
8+
9+
jobs:
10+
latest:
11+
name: PHP ${{ matrix.php }} Latest with Symfony ${{ matrix.symfony-require }}
12+
runs-on: ubuntu-latest
13+
strategy:
14+
matrix:
15+
php: ['7.3', '7.4', '8.0']
16+
symfony-require: ['*']
17+
include:
18+
- php: '7.4'
19+
symfony-require: 3.4.*
20+
- php: '7.4'
21+
symfony-require: 4.4.*
22+
- php: '8.0'
23+
symfony-require: 5.4.*
24+
25+
steps:
26+
- name: Checkout code
27+
uses: actions/checkout@v2
28+
29+
- name: Setup PHP
30+
uses: shivammathur/setup-php@v2
31+
with:
32+
php-version: ${{ matrix.php }}
33+
tools: composer:v2
34+
coverage: none
35+
36+
- name: Composer validate
37+
run: composer validate --strict --no-check-lock
38+
39+
- name: Globally install symfony/flex
40+
if: matrix.symfony-require != '*'
41+
run: composer global require --no-progress --no-scripts --no-plugins symfony/flex
42+
43+
- name: Install dependencies
44+
run: composer update --prefer-dist --no-interaction --no-progress
45+
46+
- name: Execute tests
47+
run: composer test
48+
49+
lowest:
50+
name: PHP ${{ matrix.php }} Lowest
51+
runs-on: ubuntu-latest
52+
strategy:
53+
matrix:
54+
php: ['7.3']
55+
56+
steps:
57+
- name: Checkout code
58+
uses: actions/checkout@v2
59+
60+
- name: Setup PHP
61+
uses: shivammathur/setup-php@v2
62+
with:
63+
php-version: ${{ matrix.php }}
64+
tools: composer:v2
65+
coverage: none
66+
67+
- name: Install dependencies
68+
run: composer update --prefer-dist --prefer-stable --prefer-lowest --no-interaction --no-progress
69+
70+
- name: Execute tests
71+
run: composer test
72+
73+
coverage:
74+
name: Code Coverage
75+
runs-on: ubuntu-latest
76+
77+
steps:
78+
- name: Checkout code
79+
uses: actions/checkout@v2
80+
81+
- name: Setup PHP
82+
uses: shivammathur/setup-php@v2
83+
with:
84+
php-version: 7.4
85+
tools: composer:v2
86+
coverage: xdebug
87+
88+
- name: Install dependencies
89+
run: |
90+
composer require "friends-of-phpspec/phpspec-code-coverage:^6.1.0" --no-interaction --no-update
91+
composer update --prefer-dist --no-interaction --no-progress
92+
93+
- name: Execute tests
94+
run: composer test-ci
95+
96+
- name: Upload coverage
97+
run: |
98+
wget https://scrutinizer-ci.com/ocular.phar
99+
php ocular.phar code-coverage:upload --format=php-clover build/coverage.xml

.travis.yml

Lines changed: 0 additions & 60 deletions
This file was deleted.

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
[![Latest Version](https://img.shields.io/github/release/php-http/stopwatch-plugin.svg?style=flat-square)](https://github.com/php-http/stopwatch-plugin/releases)
44
[![Software License](https://img.shields.io/badge/license-MIT-brightgreen.svg?style=flat-square)](LICENSE)
5-
[![Build Status](https://img.shields.io/travis/php-http/stopwatch-plugin.svg?style=flat-square)](https://travis-ci.org/php-http/stopwatch-plugin)
5+
[![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)
66
[![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)
77
[![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)
88
[![Total Downloads](https://img.shields.io/packagist/dt/php-http/stopwatch-plugin.svg?style=flat-square)](https://packagist.org/packages/php-http/stopwatch-plugin)

phpspec.yml.ci

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ suites:
44
psr4_prefix: Http\Client\Common\Plugin
55
formatter.name: pretty
66
extensions:
7-
- PhpSpec\Extension\CodeCoverageExtension
7+
FriendsOfPhpSpec\PhpSpec\CodeCoverage\CodeCoverageExtension: ~
88
code_coverage:
99
format: clover
1010
output: build/coverage.xml

src/StopwatchPlugin.php

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -24,9 +24,6 @@ final class StopwatchPlugin implements Plugin
2424
*/
2525
private $stopwatch;
2626

27-
/**
28-
* @param Stopwatch $stopwatch
29-
*/
3027
public function __construct(Stopwatch $stopwatch)
3128
{
3229
$this->stopwatch = $stopwatch;
@@ -51,8 +48,6 @@ protected function doHandleRequest(RequestInterface $request, callable $next, ca
5148
/**
5249
* Generates the event name.
5350
*
54-
* @param RequestInterface $request
55-
*
5651
* @return string
5752
*/
5853
private function getStopwatchEventName(RequestInterface $request)

0 commit comments

Comments
 (0)