Skip to content

Commit

Permalink
Updated dev dependencies & php version to 7.4
Browse files Browse the repository at this point in the history
  • Loading branch information
shudd3r committed Mar 6, 2021
2 parents c28cc0a + 487f096 commit 749451a
Show file tree
Hide file tree
Showing 8 changed files with 136 additions and 66 deletions.
4 changes: 1 addition & 3 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
/build export-ignore
/.github export-ignore
/tests export-ignore
/vendor export-ignore
.gitattributes export-ignore
.gitignore export-ignore
.travis.yml export-ignore
phpunit.xml.dist export-ignore
cs-fixer.php.dist export-ignore
110 changes: 110 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,110 @@
name: build
on: [push, pull_request]

jobs:
full-build:
runs-on: ${{ matrix.operating-system }}
strategy:
matrix:
operating-system: [ubuntu-latest]
php-versions: ["7.4"]
env:
extensions: pcov, dom, json, libxml, mbstring, pdo_sqlite, soap, xml, xmlwriter
key: cache-v2
steps:
- name: "Checkout"
uses: actions/checkout@v2
- name: "Setup PHP extensions cache environment"
id: cache-env
uses: shivammathur/cache-extensions@v1
with:
php-version: ${{ matrix.php-versions }}
extensions: ${{ env.extensions }}
key: ${{ env.key }}
- name: "Cache PHP extensions"
uses: actions/cache@v2
with:
path: ${{ steps.cache-env.outputs.dir }}
key: ${{ steps.cache-env.outputs.key }}
restore-keys: ${{ steps.cache-env.outputs.key }}
- name: "Install PHP with extensions"
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php-versions }}
coverage: pcov
extensions: ${{ env.extensions }}
ini-values: assert.exception=1, zend.assertions=1
- name: "Validate composer.json"
run: composer validate
- name: "Set composer cache directory"
id: composer-cache-full-build
run: echo "::set-output name=dir::$(composer config cache-files-dir)"
- name: "Setup composer cache"
uses: actions/cache@v2
with:
path: ${{ steps.composer-cache-full-build.outputs.dir }}
key: ${{ runner.os }}-composer-full-${{ hashFiles('**/composer.json') }}
restore-keys: ${{ runner.os }}-composer-full-
- name: "Install highest dependencies"
run: composer update --no-interaction --no-ansi --no-progress --no-suggest --prefer-stable
- name: "Coding standard Php-CS-Fixer checks"
run: vendor/bin/php-cs-fixer --dry-run -v --config=cs-fixer.php.dist --path-mode=intersection fix src tests
- name: "Coding standard CodeSniffer checks"
run: |
vendor/bin/phpcs --extensions=php --standard=vendor/polymorphine/dev/phpcs.xml src
vendor/bin/phpcs --extensions=php --standard=vendor/polymorphine/dev/phpcs.xml tests
- name: "Run PhpUnit tests with coverage"
run: |
mkdir -p build/logs
vendor/bin/phpunit --coverage-clover build/logs/clover.xml
- name: "Send coverage report to coveralls.io"
run: vendor/bin/php-coveralls -v
env:
COVERALLS_RUN_LOCALLY: 1
COVERALLS_REPO_TOKEN: ${{ secrets.COVERALLS_REPO_TOKEN }}

lowest-build:
runs-on: ${{ matrix.operating-system }}
strategy:
matrix:
operating-system: [ubuntu-latest]
php-versions: ["7.4"]
env:
extensions: dom, json, libxml, mbstring, pdo_sqlite, soap, xml, xmlwriter
key: cache-v2
steps:
- name: "Checkout"
uses: actions/checkout@v2
- name: "Setup PHP extensions cache environment"
id: cache-env
uses: shivammathur/cache-extensions@v1
with:
php-version: ${{ matrix.php-versions }}
extensions: ${{ env.extensions }}
key: ${{ env.key }}
- name: "Cache PHP extensions"
uses: actions/cache@v2
with:
path: ${{ steps.cache-env.outputs.dir }}
key: ${{ steps.cache-env.outputs.key }}
restore-keys: ${{ steps.cache-env.outputs.key }}
- name: "Install PHP with extensions"
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php-versions }}
coverage: none
extensions: ${{ env.extensions }}
ini-values: assert.exception=1, zend.assertions=1
- name: "Set composer cache directory"
id: composer-cache-lowest-build
run: echo "::set-output name=dir::$(composer config cache-files-dir)"
- name: "Setup composer cache"
uses: actions/cache@v2
with:
path: ${{ steps.composer-cache-lowest-build.outputs.dir }}
key: ${{ runner.os }}-composer-low-${{ hashFiles('**/composer.json') }}
restore-keys: ${{ runner.os }}-composer-low-
- name: "Install lowest dependencies"
run: composer update --no-interaction --no-ansi --no-progress --no-suggest --prefer-stable --prefer-lowest
- name: "Run PhpUnit tests (no coverage)"
run: vendor/bin/phpunit --no-coverage
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
.idea/
vendor/
build/
temp/
/composer.lock
38 changes: 0 additions & 38 deletions .travis.yml

This file was deleted.

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

### Installation with [Composer](https://getcomposer.org/)
Expand Down
10 changes: 2 additions & 8 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,13 @@
"type": "library",
"minimum-stability": "stable",
"require": {
"php": "^7.1",
"php": "^7.4",
"psr/http-message": "^1.0",
"psr/http-server-handler": "^1.0",
"psr/http-server-middleware": "^1.0"
},
"require-dev": {
"polymorphine/cs": "@dev",
"phpunit/phpunit": "^7.0",
"php-coveralls/php-coveralls": "^2.0"
"polymorphine/dev": "0.1.*"
},
"license": "MIT",
"authors": [
Expand All @@ -30,9 +28,5 @@
"psr-4": {
"Polymorphine\\Headers\\Tests\\": "tests/"
}
},
"scripts": {
"run-tests": "phpunit --configuration phpunit.xml.dist",
"style-check": "polymorphine-cs"
}
}
11 changes: 10 additions & 1 deletion cs-fixer.php.dist
Original file line number Diff line number Diff line change
@@ -1,5 +1,14 @@
<?php

use Polymorphine\CodeStandards\FixerFactory;
/*
* This file is part of Polymorphine/Headers package.
*
* (c) Shudd3r <q3.shudder@gmail.com>
*
* This source file is subject to the MIT license that is bundled
* with this source code in the file LICENSE.
*/

use Polymorphine\Dev\FixerFactory;

return FixerFactory::createFor('Polymorphine/Headers', __DIR__);
19 changes: 7 additions & 12 deletions phpunit.xml.dist
Original file line number Diff line number Diff line change
@@ -1,27 +1,22 @@
<?xml version="1.0" encoding="UTF-8"?>

<phpunit
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="https://schema.phpunit.de/7.0/phpunit.xsd"
xsi:noNamespaceSchemaLocation="https://schema.phpunit.de/9.5/phpunit.xsd"
cacheResultFile="temp/.phpunit.result.cache"
colors="true"
bootstrap="vendor/autoload.php"
>
<php>
<ini name="error_reporting" value="-1" />
</php>

<testsuites>
<testsuite name="Polymorphine\Headers tests">
<testsuite name="Polymorphine/Headers tests">
<directory>./tests/</directory>
</testsuite>
</testsuites>
<filter>
<whitelist>
<coverage>
<include>
<directory>./src/</directory>
</whitelist>
</filter>
<logging>
<log type="coverage-clover" target="build/logs/clover.xml"/>
<log type="coverage-text" target="php://stdout" showOnlySummary="true"/>
</logging>
</include>
</coverage>
</phpunit>

0 comments on commit 749451a

Please sign in to comment.