Skip to content

Commit 31ec554

Browse files
committed
php 8, replaced travis with github actions
1 parent af8f0bb commit 31ec554

File tree

4 files changed

+87
-27
lines changed

4 files changed

+87
-27
lines changed

.github/workflows/main.yaml

+76
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,76 @@
1+
name: "testing"
2+
3+
on:
4+
push:
5+
branches: [ master ]
6+
pull_request:
7+
branches: [ master ]
8+
9+
jobs:
10+
qa:
11+
name: Quality assurance
12+
runs-on: ubuntu-latest
13+
14+
steps:
15+
- name: Checkout
16+
uses: actions/checkout@v2
17+
18+
- name: Validate composer.json and composer.lock
19+
run: composer validate
20+
21+
- name: Cache Composer packages
22+
id: composer-cache
23+
uses: actions/cache@v2
24+
with:
25+
path: vendor
26+
key: ${{ runner.os }}-php-${{ hashFiles('**/composer.lock') }}
27+
restore-keys: |
28+
${{ runner.os }}-php-
29+
30+
- name: Install dependencies
31+
if: steps.composer-cache.outputs.cache-hit != 'true'
32+
run: composer install --prefer-dist --no-progress --no-suggest
33+
34+
- name: Coding Standard
35+
run: composer run-script cs
36+
37+
tests:
38+
name: Tests
39+
runs-on: ubuntu-latest
40+
41+
strategy:
42+
matrix:
43+
php:
44+
- 7.2
45+
- 7.3
46+
- 7.4
47+
composer-args: [ "" ]
48+
include:
49+
- php: 8.0
50+
composer-args: --ignore-platform-reqs
51+
fail-fast: false
52+
53+
steps:
54+
- name: Checkout
55+
uses: actions/checkout@v2
56+
57+
- name: Install PHP
58+
uses: shivammathur/setup-php@v2
59+
with:
60+
php-version: ${{ matrix.php }}
61+
62+
- name: Cache PHP dependencies
63+
uses: actions/cache@v2
64+
with:
65+
path: vendor
66+
key: ${{ runner.os }}-php-${{ matrix.php }}-composer-${{ hashFiles('**/composer.json') }}
67+
restore-keys: ${{ runner.os }}-php-${{ matrix.php }}-composer-
68+
69+
- name: Install dependencies
70+
run: composer install --prefer-dist --no-progress --no-suggest ${{ matrix.composer-args }}
71+
72+
- name: Tests
73+
run: composer test
74+
75+
- name: Tests coverage
76+
run: composer coverage

.travis.yml

-14
This file was deleted.

README.md

+2-5
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,7 @@
22

33
[![Latest Version on Packagist][ico-version]][link-packagist]
44
[![Software License][ico-license]](LICENSE)
5-
[![Build Status][ico-travis]][link-travis]
6-
[![Quality Score][ico-scrutinizer]][link-scrutinizer]
5+
![Testing][ico-ga]
76
[![Total Downloads][ico-downloads]][link-downloads]
87

98
Middleware to encode the response body to `gzip` or `deflate` if the `Accept-Encoding` header is present and adds the `Content-Encoding` header. This package is splitted into the following components:
@@ -92,11 +91,9 @@ The MIT License (MIT). Please see [LICENSE](LICENSE) for more information.
9291

9392
[ico-version]: https://img.shields.io/packagist/v/middlewares/encoder.svg?style=flat-square
9493
[ico-license]: https://img.shields.io/badge/license-MIT-brightgreen.svg?style=flat-square
95-
[ico-travis]: https://img.shields.io/travis/middlewares/encoder/master.svg?style=flat-square
96-
[ico-scrutinizer]: https://img.shields.io/scrutinizer/g/middlewares/encoder.svg?style=flat-square
94+
[ico-ga]: https://github.com/middlewares/encoder/workflows/testing/badge.svg
9795
[ico-downloads]: https://img.shields.io/packagist/dt/middlewares/encoder.svg?style=flat-square
9896

9997
[link-packagist]: https://packagist.org/packages/middlewares/encoder
100-
[link-travis]: https://travis-ci.org/middlewares/encoder
10198
[link-scrutinizer]: https://scrutinizer-ci.com/g/middlewares/encoder
10299
[link-downloads]: https://packagist.org/packages/middlewares/encoder

composer.json

+9-8
Original file line numberDiff line numberDiff line change
@@ -19,16 +19,17 @@
1919
},
2020
"require": {
2121
"ext-zlib": "*",
22-
"php": "^7.2",
22+
"php": "^7.2 || ^8.0",
2323
"middlewares/utils": "^3.0",
2424
"psr/http-server-middleware": "^1.0"
2525
},
2626
"require-dev": {
27-
"phpunit/phpunit": "^8.1",
27+
"phpunit/phpunit": "^8|^9",
2828
"laminas/laminas-diactoros": "^2.2",
2929
"friendsofphp/php-cs-fixer": "^2.0",
3030
"squizlabs/php_codesniffer": "^3.0",
31-
"oscarotero/php-cs-fixer-config": "^1.0"
31+
"oscarotero/php-cs-fixer-config": "^1.0",
32+
"phpstan/phpstan": "^0.12"
3233
},
3334
"autoload": {
3435
"psr-4": {
@@ -41,11 +42,11 @@
4142
}
4243
},
4344
"scripts": {
44-
"test": [
45-
"phpunit --coverage-text",
46-
"phpcs"
47-
],
45+
"cs": "phpcs",
4846
"cs-fix": "php-cs-fixer fix",
49-
"coverage": "phpunit --coverage-html=coverage"
47+
"phpstan": "phpstan analyse",
48+
"test": "phpunit",
49+
"coverage": "phpunit --coverage-text",
50+
"coverage-html": "phpunit --coverage-html=coverage"
5051
}
5152
}

0 commit comments

Comments
 (0)