Skip to content

Commit 749451a

Browse files
committed
Updated dev dependencies & php version to 7.4
2 parents c28cc0a + 487f096 commit 749451a

File tree

8 files changed

+136
-66
lines changed

8 files changed

+136
-66
lines changed

.gitattributes

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,6 @@
1-
/build export-ignore
1+
/.github export-ignore
22
/tests export-ignore
3-
/vendor export-ignore
43
.gitattributes export-ignore
54
.gitignore export-ignore
6-
.travis.yml export-ignore
75
phpunit.xml.dist export-ignore
86
cs-fixer.php.dist export-ignore

.github/workflows/build.yml

Lines changed: 110 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,110 @@
1+
name: build
2+
on: [push, pull_request]
3+
4+
jobs:
5+
full-build:
6+
runs-on: ${{ matrix.operating-system }}
7+
strategy:
8+
matrix:
9+
operating-system: [ubuntu-latest]
10+
php-versions: ["7.4"]
11+
env:
12+
extensions: pcov, dom, json, libxml, mbstring, pdo_sqlite, soap, xml, xmlwriter
13+
key: cache-v2
14+
steps:
15+
- name: "Checkout"
16+
uses: actions/checkout@v2
17+
- name: "Setup PHP extensions cache environment"
18+
id: cache-env
19+
uses: shivammathur/cache-extensions@v1
20+
with:
21+
php-version: ${{ matrix.php-versions }}
22+
extensions: ${{ env.extensions }}
23+
key: ${{ env.key }}
24+
- name: "Cache PHP extensions"
25+
uses: actions/cache@v2
26+
with:
27+
path: ${{ steps.cache-env.outputs.dir }}
28+
key: ${{ steps.cache-env.outputs.key }}
29+
restore-keys: ${{ steps.cache-env.outputs.key }}
30+
- name: "Install PHP with extensions"
31+
uses: shivammathur/setup-php@v2
32+
with:
33+
php-version: ${{ matrix.php-versions }}
34+
coverage: pcov
35+
extensions: ${{ env.extensions }}
36+
ini-values: assert.exception=1, zend.assertions=1
37+
- name: "Validate composer.json"
38+
run: composer validate
39+
- name: "Set composer cache directory"
40+
id: composer-cache-full-build
41+
run: echo "::set-output name=dir::$(composer config cache-files-dir)"
42+
- name: "Setup composer cache"
43+
uses: actions/cache@v2
44+
with:
45+
path: ${{ steps.composer-cache-full-build.outputs.dir }}
46+
key: ${{ runner.os }}-composer-full-${{ hashFiles('**/composer.json') }}
47+
restore-keys: ${{ runner.os }}-composer-full-
48+
- name: "Install highest dependencies"
49+
run: composer update --no-interaction --no-ansi --no-progress --no-suggest --prefer-stable
50+
- name: "Coding standard Php-CS-Fixer checks"
51+
run: vendor/bin/php-cs-fixer --dry-run -v --config=cs-fixer.php.dist --path-mode=intersection fix src tests
52+
- name: "Coding standard CodeSniffer checks"
53+
run: |
54+
vendor/bin/phpcs --extensions=php --standard=vendor/polymorphine/dev/phpcs.xml src
55+
vendor/bin/phpcs --extensions=php --standard=vendor/polymorphine/dev/phpcs.xml tests
56+
- name: "Run PhpUnit tests with coverage"
57+
run: |
58+
mkdir -p build/logs
59+
vendor/bin/phpunit --coverage-clover build/logs/clover.xml
60+
- name: "Send coverage report to coveralls.io"
61+
run: vendor/bin/php-coveralls -v
62+
env:
63+
COVERALLS_RUN_LOCALLY: 1
64+
COVERALLS_REPO_TOKEN: ${{ secrets.COVERALLS_REPO_TOKEN }}
65+
66+
lowest-build:
67+
runs-on: ${{ matrix.operating-system }}
68+
strategy:
69+
matrix:
70+
operating-system: [ubuntu-latest]
71+
php-versions: ["7.4"]
72+
env:
73+
extensions: dom, json, libxml, mbstring, pdo_sqlite, soap, xml, xmlwriter
74+
key: cache-v2
75+
steps:
76+
- name: "Checkout"
77+
uses: actions/checkout@v2
78+
- name: "Setup PHP extensions cache environment"
79+
id: cache-env
80+
uses: shivammathur/cache-extensions@v1
81+
with:
82+
php-version: ${{ matrix.php-versions }}
83+
extensions: ${{ env.extensions }}
84+
key: ${{ env.key }}
85+
- name: "Cache PHP extensions"
86+
uses: actions/cache@v2
87+
with:
88+
path: ${{ steps.cache-env.outputs.dir }}
89+
key: ${{ steps.cache-env.outputs.key }}
90+
restore-keys: ${{ steps.cache-env.outputs.key }}
91+
- name: "Install PHP with extensions"
92+
uses: shivammathur/setup-php@v2
93+
with:
94+
php-version: ${{ matrix.php-versions }}
95+
coverage: none
96+
extensions: ${{ env.extensions }}
97+
ini-values: assert.exception=1, zend.assertions=1
98+
- name: "Set composer cache directory"
99+
id: composer-cache-lowest-build
100+
run: echo "::set-output name=dir::$(composer config cache-files-dir)"
101+
- name: "Setup composer cache"
102+
uses: actions/cache@v2
103+
with:
104+
path: ${{ steps.composer-cache-lowest-build.outputs.dir }}
105+
key: ${{ runner.os }}-composer-low-${{ hashFiles('**/composer.json') }}
106+
restore-keys: ${{ runner.os }}-composer-low-
107+
- name: "Install lowest dependencies"
108+
run: composer update --no-interaction --no-ansi --no-progress --no-suggest --prefer-stable --prefer-lowest
109+
- name: "Run PhpUnit tests (no coverage)"
110+
run: vendor/bin/phpunit --no-coverage

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
.idea/
22
vendor/
33
build/
4+
temp/
45
/composer.lock

.travis.yml

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

README.md

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,9 @@
11
# Polymorphine/Headers
2-
[![Build Status](https://travis-ci.org/shudd3r/polymorphine-headers.svg?branch=develop)](https://travis-ci.org/shudd3r/polymorphine-headers)
3-
[![Coverage Status](https://coveralls.io/repos/github/shudd3r/polymorphine-headers/badge.svg?branch=develop)](https://coveralls.io/github/shudd3r/polymorphine-headers?branch=develop)
4-
[![PHP from Packagist](https://img.shields.io/packagist/php-v/polymorphine/headers/dev-develop.svg)](https://packagist.org/packages/polymorphine/headers)
5-
[![Packagist](https://img.shields.io/packagist/l/polymorphine/headers.svg)](https://packagist.org/packages/polymorphine/headers)
2+
[![Latest Stable Version](https://poser.pugx.org/polymorphine/headers/version)](https://packagist.org/packages/polymorphine/headers)
3+
[![Build status](https://github.com/polymorphine/headers/workflows/build/badge.svg)](https://github.com/polymorphine/headers/actions)
4+
[![Coverage status](https://coveralls.io/repos/github/polymorphine/headers/badge.svg?branch=develop)](https://coveralls.io/github/polymorphine/headers?branch=develop)
5+
[![PHP version](https://img.shields.io/packagist/php-v/polymorphine/headers.svg)](https://packagist.org/packages/polymorphine/headers)
6+
[![LICENSE](https://img.shields.io/github/license/polymorphine/headers.svg?color=blue)](LICENSE)
67
### HTTP Response headers middleware
78

89
### Installation with [Composer](https://getcomposer.org/)

composer.json

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -4,15 +4,13 @@
44
"type": "library",
55
"minimum-stability": "stable",
66
"require": {
7-
"php": "^7.1",
7+
"php": "^7.4",
88
"psr/http-message": "^1.0",
99
"psr/http-server-handler": "^1.0",
1010
"psr/http-server-middleware": "^1.0"
1111
},
1212
"require-dev": {
13-
"polymorphine/cs": "@dev",
14-
"phpunit/phpunit": "^7.0",
15-
"php-coveralls/php-coveralls": "^2.0"
13+
"polymorphine/dev": "0.1.*"
1614
},
1715
"license": "MIT",
1816
"authors": [
@@ -30,9 +28,5 @@
3028
"psr-4": {
3129
"Polymorphine\\Headers\\Tests\\": "tests/"
3230
}
33-
},
34-
"scripts": {
35-
"run-tests": "phpunit --configuration phpunit.xml.dist",
36-
"style-check": "polymorphine-cs"
3731
}
3832
}

cs-fixer.php.dist

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,14 @@
11
<?php
22

3-
use Polymorphine\CodeStandards\FixerFactory;
3+
/*
4+
* This file is part of Polymorphine/Headers package.
5+
*
6+
* (c) Shudd3r <q3.shudder@gmail.com>
7+
*
8+
* This source file is subject to the MIT license that is bundled
9+
* with this source code in the file LICENSE.
10+
*/
11+
12+
use Polymorphine\Dev\FixerFactory;
413

514
return FixerFactory::createFor('Polymorphine/Headers', __DIR__);

phpunit.xml.dist

Lines changed: 7 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,27 +1,22 @@
11
<?xml version="1.0" encoding="UTF-8"?>
2-
32
<phpunit
43
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
5-
xsi:noNamespaceSchemaLocation="https://schema.phpunit.de/7.0/phpunit.xsd"
4+
xsi:noNamespaceSchemaLocation="https://schema.phpunit.de/9.5/phpunit.xsd"
5+
cacheResultFile="temp/.phpunit.result.cache"
66
colors="true"
77
bootstrap="vendor/autoload.php"
88
>
99
<php>
1010
<ini name="error_reporting" value="-1" />
1111
</php>
12-
1312
<testsuites>
14-
<testsuite name="Polymorphine\Headers tests">
13+
<testsuite name="Polymorphine/Headers tests">
1514
<directory>./tests/</directory>
1615
</testsuite>
1716
</testsuites>
18-
<filter>
19-
<whitelist>
17+
<coverage>
18+
<include>
2019
<directory>./src/</directory>
21-
</whitelist>
22-
</filter>
23-
<logging>
24-
<log type="coverage-clover" target="build/logs/clover.xml"/>
25-
<log type="coverage-text" target="php://stdout" showOnlySummary="true"/>
26-
</logging>
20+
</include>
21+
</coverage>
2722
</phpunit>

0 commit comments

Comments
 (0)