Skip to content

Commit

Permalink
update from template
Browse files Browse the repository at this point in the history
  • Loading branch information
mimmi20 committed Jul 20, 2020
1 parent e401c1b commit a332c6b
Show file tree
Hide file tree
Showing 11 changed files with 98 additions and 72 deletions.
2 changes: 1 addition & 1 deletion .gitattributes
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ infection.json export-ignore text eol=lf
phpcs.xml export-ignore text eol=lf
phpstan.neon export-ignore text eol=lf
phpunit.xml export-ignore text eol=lf
/tests export-ignore
/cache export-ignore
/tests export-ignore
/.github export-ignore
/.dependabot export-ignore
2 changes: 1 addition & 1 deletion .github/dependabot.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ updates:
- mimmi20
labels:
- dependencies
versioning-strategy: increase-if-necessary
versioning-strategy: increase
ignore:
- dependency-name: infection/infection
versions:
Expand Down
79 changes: 54 additions & 25 deletions .github/workflows/continuous-integration.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ name: "Continuous Integration"

jobs:
validate:
name: "Validate"
name: "Validate composer"

runs-on: "ubuntu-latest"

Expand All @@ -18,6 +18,9 @@ jobs:
php-versions:
- "7.1"

dependencies:
- ""

steps:
- name: "Checkout"
uses: "actions/checkout@v2"
Expand All @@ -41,11 +44,11 @@ jobs:
uses: "actions/cache@v1"
with:
path: "${{ steps.determine-composer-cache-directory.outputs.directory }}"
key: "php-${{ matrix.php-versions }}-composer--${{ hashFiles('composer.lock') }}"
restore-keys: "php-${{ matrix.php-versions }}-composer--"
key: "php-${{ matrix.php-versions }}-composer-${{ matrix.dependencies }}-${{ hashFiles('composer.lock') }}"
restore-keys: "php-${{ matrix.php-versions }}-composer-${{ matrix.dependencies }}-"

- name: "Update dependencies with composer"
run: "composer update --optimize-autoloader --prefer-dist --prefer-stable --no-progress --no-interaction --no-suggest -vv "
run: "composer update --optimize-autoloader --prefer-dist --prefer-stable --no-progress --no-interaction --no-suggest -vv ${{ matrix.dependencies }}"

- name: "Run composer-normalize"
run: "composer normalize --dry-run"
Expand All @@ -65,7 +68,11 @@ jobs:
- "7.2"
- "7.3"
- "7.4"
#- "8.0"
# - "8.0"

dependencies:
- "--prefer-lowest"
- ""

steps:
- name: "Checkout"
Expand All @@ -87,17 +94,17 @@ jobs:
uses: "actions/cache@v1"
with:
path: "${{ steps.determine-composer-cache-directory.outputs.directory }}"
key: "php-${{ matrix.php-versions }}-composer--${{ hashFiles('composer.lock') }}"
restore-keys: "php-${{ matrix.php-versions }}-composer--"
key: "php-${{ matrix.php-versions }}-composer-${{ matrix.dependencies }}-${{ hashFiles('composer.lock') }}"
restore-keys: "php-${{ matrix.php-versions }}-composer-${{ matrix.dependencies }}-"

- name: "Update dependencies with composer"
run: "composer update --optimize-autoloader --prefer-dist --prefer-stable --no-progress --no-interaction --no-suggest -vv "
run: "composer update --optimize-autoloader --prefer-dist --prefer-stable --no-progress --no-interaction --no-suggest -vv ${{ matrix.dependencies }}"

- name: "Check dependencies with composer"
run: "composer outdated --direct --strict"

coding-standards:
name: "Coding Standards"
name: "Check Coding Standards"

needs: "install"

Expand All @@ -109,6 +116,9 @@ jobs:
php-versions:
- "7.1"

dependencies:
- ""

steps:
- name: "Checkout"
uses: "actions/checkout@v2"
Expand All @@ -129,11 +139,11 @@ jobs:
uses: "actions/cache@v1"
with:
path: "${{ steps.determine-composer-cache-directory.outputs.directory }}"
key: "php-${{ matrix.php-versions }}-composer--${{ hashFiles('composer.lock') }}"
restore-keys: "php-${{ matrix.php-versions }}-composer--"
key: "php-${{ matrix.php-versions }}-composer-${{ matrix.dependencies }}-${{ hashFiles('composer.lock') }}"
restore-keys: "php-${{ matrix.php-versions }}-composer-${{ matrix.dependencies }}-"

- name: "Update dependencies with composer"
run: "composer update --optimize-autoloader --prefer-dist --prefer-stable --no-progress --no-interaction --no-suggest -vv "
run: "composer update --optimize-autoloader --prefer-dist --prefer-stable --no-progress --no-interaction --no-suggest -vv ${{ matrix.dependencies }}"

- name: "Run friendsofphp/php-cs-fixer"
run: "vendor/bin/php-cs-fixer fix --dry-run -vv"
Expand All @@ -154,6 +164,9 @@ jobs:
php-versions:
- "7.1"

dependencies:
- ""

steps:
- name: "Checkout"
uses: "actions/checkout@v2"
Expand All @@ -174,11 +187,11 @@ jobs:
uses: "actions/cache@v1"
with:
path: "${{ steps.determine-composer-cache-directory.outputs.directory }}"
key: "php-${{ matrix.php-versions }}-composer--${{ hashFiles('composer.lock') }}"
restore-keys: "php-${{ matrix.php-versions }}-composer--"
key: "php-${{ matrix.php-versions }}-composer-${{ matrix.dependencies }}-${{ hashFiles('composer.lock') }}"
restore-keys: "php-${{ matrix.php-versions }}-composer-${{ matrix.dependencies }}-"

- name: "Update dependencies with composer"
run: "composer update --optimize-autoloader --prefer-dist --prefer-stable --no-progress --no-interaction --no-suggest -vv "
run: "composer update --optimize-autoloader --prefer-dist --prefer-stable --no-progress --no-interaction --no-suggest -vv ${{ matrix.dependencies }}"

- name: "Run phpstan/phpstan"
run: "vendor/bin/phpstan analyse -c phpstan.neon --memory-limit=768M --no-progress"
Expand All @@ -197,6 +210,13 @@ jobs:
matrix:
php-versions:
- "7.1"
- "7.2"
- "7.3"
- "7.4"
# - "8.0"

dependencies:
- ""

steps:
- name: "Checkout"
Expand All @@ -218,11 +238,11 @@ jobs:
uses: "actions/cache@v1"
with:
path: "${{ steps.determine-composer-cache-directory.outputs.directory }}"
key: "php-${{ matrix.php-versions }}-composer--${{ hashFiles('composer.lock') }}"
restore-keys: "php-${{ matrix.php-versions }}-composer--"
key: "php-${{ matrix.php-versions }}-composer-${{ matrix.dependencies }}-${{ hashFiles('composer.lock') }}"
restore-keys: "php-${{ matrix.php-versions }}-composer-${{ matrix.dependencies }}-"

- name: "Update dependencies with composer"
run: "composer update --optimize-autoloader --prefer-dist --prefer-stable --no-progress --no-interaction --no-suggest -vv "
run: "composer update --optimize-autoloader --prefer-dist --prefer-stable --no-progress --no-interaction --no-suggest -vv ${{ matrix.dependencies }}"

- name: "Run unit tests with phpunit/phpunit"
run: "vendor/bin/phpunit -c phpunit.xml --colors --no-coverage"
Expand All @@ -240,6 +260,9 @@ jobs:
php-versions:
- "7.1"

dependencies:
- ""

steps:
- name: "Checkout"
uses: "actions/checkout@v2"
Expand All @@ -260,14 +283,17 @@ jobs:
uses: "actions/cache@v1"
with:
path: "${{ steps.determine-composer-cache-directory.outputs.directory }}"
key: "php-${{ matrix.php-versions }}-composer--${{ hashFiles('composer.lock') }}"
restore-keys: "php-${{ matrix.php-versions }}-composer--"
key: "php-${{ matrix.php-versions }}-composer-${{ matrix.dependencies }}-${{ hashFiles('composer.lock') }}"
restore-keys: "php-${{ matrix.php-versions }}-composer-${{ matrix.dependencies }}-"

- name: "Update dependencies with composer"
run: "composer update --optimize-autoloader --prefer-dist --prefer-stable --no-progress --no-interaction --no-suggest -vv "
run: "composer update --optimize-autoloader --prefer-dist --prefer-stable --no-progress --no-interaction --no-suggest -vv ${{ matrix.dependencies }}"

- name: "Create cache directory for phpunit/phpunit"
run: "mkdir -p .build/coverage"

- name: "Collect code coverage with Xdebug and phpunit/phpunit"
run: "vendor/bin/phpunit -c phpunit.xml --colors --coverage-clover=clover.xml --coverage-text"
run: "vendor/bin/phpunit -c phpunit.xml --colors --coverage-clover=clover.xml --coverage-text --coverage-xml=.build/coverage/coverage-xml --log-junit=.build/coverage/junit.xml"

- name: "Upload coverage to Codecov"
uses: "codecov/codecov-action@master"
Expand All @@ -291,6 +317,9 @@ jobs:
php-versions:
- "7.1"

dependencies:
- ""

steps:
- name: "Checkout"
uses: "actions/checkout@v2"
Expand All @@ -311,11 +340,11 @@ jobs:
uses: "actions/cache@v1"
with:
path: "${{ steps.determine-composer-cache-directory.outputs.directory }}"
key: "php-${{ matrix.php-versions }}-composer--${{ hashFiles('composer.lock') }}"
restore-keys: "php-${{ matrix.php-versions }}-composer--"
key: "php-${{ matrix.php-versions }}-composer-${{ matrix.dependencies }}-${{ hashFiles('composer.lock') }}"
restore-keys: "php-${{ matrix.php-versions }}-composer-${{ matrix.dependencies }}-"

- name: "Update dependencies with composer"
run: "composer update --optimize-autoloader --prefer-dist --prefer-stable --no-progress --no-interaction --no-suggest -vv "
run: "composer update --optimize-autoloader --prefer-dist --prefer-stable --no-progress --no-interaction --no-suggest -vv ${{ matrix.dependencies }}"

- name: "Run mutation tests with infection/infection"
run: "vendor/bin/infection --min-covered-msi=82 --min-msi=82"
4 changes: 2 additions & 2 deletions .github/workflows/stale.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Close stale issues and pull requests
name: "Close stale issues and pull requests"

on:
schedule:
Expand All @@ -10,7 +10,7 @@ jobs:
runs-on: "ubuntu-latest"

steps:
- uses: "actions/stale@v2"
- uses: "actions/stale@v3"
with:
repo-token: "${{ secrets.GITHUB_TOKEN }}"
days-before-stale: 60
Expand Down
21 changes: 0 additions & 21 deletions LICENSE

This file was deleted.

16 changes: 16 additions & 0 deletions LICENSE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
# The MIT License (MIT)

Copyright (c) 2015-2020 Thomas Müller

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated
documentation files (the _Software_), to deal in the Software without restriction, including without limitation the
rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit
persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the
Software.

THE SOFTWARE IS PROVIDED **AS IS**, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
2 changes: 1 addition & 1 deletion codecov.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,4 @@ codecov:
require_ci_to_pass: yes

comment:
require_changes: yes
require_changes: yes
20 changes: 9 additions & 11 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,6 @@
"name": "mimmi20/ua-generic-request",
"type": "library",
"description": "the Generic Request Object extracted from Wurfl for PHP 7.1+",
"keywords": [
"generic request"
],
"homepage": "https://github.com/mimmi20/ua-generic-request",
"license": "MIT",
"authors": [
Expand All @@ -25,17 +22,18 @@
"psr/http-message": "^1.0.1"
},
"require-dev": {
"ergebnis/composer-normalize": "^2.5.1",
"ergebnis/composer-normalize": "^2.6.1",
"ergebnis/phpstan-rules": "^0.15.0",
"infection/infection": "^0.13.6 || ^0.16.3",
"mimmi20/coding-standard": "~1.0.0",
"mimmi20/coding-standard": "~1.0.1",
"mimmi20/json-class": "~2.0.11",
"pepakriz/phpstan-exception-rules": "^0.11.0",
"phpstan/phpstan": "^0.12.25",
"phpstan/phpstan-deprecation-rules": "^0.12.2",
"phpstan/phpstan-phpunit": "^0.12.8",
"phpstan/phpstan-strict-rules": "^0.12.2",
"phpunit/phpunit": "^7.5.20 || ^8.5.4 || ^9.1.3",
"pepakriz/phpstan-exception-rules": "^0.11.1",
"phpstan/extension-installer": "^1.0.4",
"phpstan/phpstan": "^0.12.33",
"phpstan/phpstan-deprecation-rules": "^0.12.4",
"phpstan/phpstan-phpunit": "^0.12.12",
"phpstan/phpstan-strict-rules": "^0.12.3",
"phpunit/phpunit": "^7.5.20 || ^8.5.5 || ^9.1.5",
"symfony/finder": "^4.4.8 || ^5.0.8"
},
"config": {
Expand Down
5 changes: 4 additions & 1 deletion infection.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,5 +12,8 @@
"logs": {
"text": "infection-log.log",
"debug": "infection-debug.log"
},
"mutators": {
"@default": true
}
}
}
11 changes: 3 additions & 8 deletions phpstan.neon
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
parameters:
level: max
parallel:
maximumNumberOfProcesses: 1
processTimeout: 200.0
paths:
- src
- tests
Expand All @@ -22,11 +25,3 @@ parameters:
ergebnis:
classesAllowedToBeExtended:
- UnexpectedValueException

includes:
- vendor/phpstan/phpstan-strict-rules/rules.neon
- vendor/phpstan/phpstan-phpunit/extension.neon
- vendor/phpstan/phpstan-phpunit/rules.neon
- vendor/pepakriz/phpstan-exception-rules/extension.neon
- vendor/phpstan/phpstan-deprecation-rules/rules.neon
- vendor/ergebnis/phpstan-rules/rules.neon
8 changes: 7 additions & 1 deletion phpunit.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,18 @@
xsi:noNamespaceSchemaLocation="vendor/phpunit/phpunit/phpunit.xsd"
backupGlobals="false"
backupStaticAttributes="false"
beStrictAboutChangesToGlobalState="true"
beStrictAboutCoversAnnotation="false"
beStrictAboutOutputDuringTests="true"
beStrictAboutTestsThatDoNotTestAnything="true"
beStrictAboutTodoAnnotatedTests="true"
verbose="true"
failOnWarning="true"
failOnRisky="true"
verbose="false"
bootstrap="vendor/autoload.php"
enforceTimeLimit="false"
executionOrder="default"
resolveDependencies="true"
>
<php>
<ini name="error_reporting" value="-1"/>
Expand Down

0 comments on commit a332c6b

Please sign in to comment.