Skip to content

Commit ec14da8

Browse files
authored
Merge pull request #8 from Micro-PHP/v1.6.0-release
v1.6.0 - implements tests and CI
2 parents 5baece6 + c79aafa commit ec14da8

26 files changed

+577
-122
lines changed

.gitattributes

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
/.github export-ignore
2+
/tests export-ignore
3+
/phpunit.xml.dist export-ignore
4+
/.gitattributes export-ignore
5+
/.gitignore export-ignore
6+
/.php-cs-fixer.dist.php export-ignore
7+
/psalm.xml export-ignore
8+
9+
*.php diff=php

.github/workflows/.editorconfig

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

.github/workflows/ci.yaml

Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
name: Plugin CI
2+
on:
3+
push:
4+
branches: [ 'master' ]
5+
pull_request:
6+
7+
env:
8+
PHP_CS_FIXER_IGNORE_ENV: 1
9+
XDEBUG_MODE: coverage
10+
11+
jobs:
12+
tests:
13+
name: "Tests ${{ matrix.php-version }} deps ${{ matrix.dependency-versions }}"
14+
runs-on: ubuntu-22.04
15+
16+
strategy:
17+
fail-fast: false
18+
matrix:
19+
# normal, highest, non-dev installs
20+
php-version: [ '8.2' ]
21+
dependency-versions: [ 'highest' ]
22+
include:
23+
# testing lowest PHP version with the lowest dependencies
24+
# - php-version: '8.2'
25+
# dependency-versions: 'lowest'
26+
27+
# testing dev versions with the highest PHP
28+
- php-version: '8.2'
29+
dependency-versions: 'highest'
30+
31+
steps:
32+
- name: "Checkout code"
33+
uses: "actions/checkout@v2"
34+
35+
- name: "Install PHP"
36+
uses: "shivammathur/setup-php@v2"
37+
with:
38+
coverage: "none"
39+
php-version: "${{ matrix.php-version }}"
40+
41+
- name: "Composer install"
42+
uses: "ramsey/composer-install@v2"
43+
with:
44+
dependency-versions: "${{ matrix.dependency-versions }}"
45+
composer-options: "--prefer-dist --no-progress"
46+
47+
- name: Run tests
48+
run: composer run test

.gitignore

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,9 @@
1-
vendor/
1+
.idea
2+
vendor
23
composer.lock
34
.phpunit.result.cache
5+
.php-cs-fixer.cache
6+
test-coverage-report
7+
phpunit.xml
8+
.php-cs-fixer.php
9+
phpstan.neon

.php-cs-fixer.dist.php

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
<?php
2+
3+
if (!file_exists(__DIR__.'/src')) {
4+
exit(0);
5+
}
6+
7+
$finder = (new PhpCsFixer\Finder())
8+
->in(__DIR__.'/src')
9+
->in(__DIR__.'/tests')
10+
;
11+
12+
return (new PhpCsFixer\Config())
13+
->setRules(array(
14+
'@Symfony' => true,
15+
'@Symfony:risky' => true,
16+
'protected_to_private' => false,
17+
'semicolon_after_instruction' => false,
18+
'header_comment' => [
19+
'header' => <<<EOF
20+
This file is part of the Micro framework package.
21+
22+
(c) Stanislau Komar <kost@micro-php.net>
23+
24+
For the full copyright and license information, please view the LICENSE
25+
file that was distributed with this source code.
26+
EOF
27+
]
28+
))
29+
->setRiskyAllowed(true)
30+
->setFinder($finder);

LICENSE

100644100755
File mode changed.

README.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
# Micro Framework - The minimum kernel for application initialization.
2+
3+
Documentation is available [here](https://micro-php.net/docs). If not, we will be grateful if you can become its author :)

composer.json

100644100755
Lines changed: 51 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,25 +1,65 @@
11
{
22
"name": "micro/kernel-app",
33
"description": "Micro Framework: App Kernel component",
4-
"type": "library",
54
"license": "MIT",
6-
"autoload": {
7-
"psr-4": {
8-
"Micro\\Kernel\\App\\": "src/"
9-
}
10-
},
5+
"type": "library",
116
"authors": [
127
{
138
"name": "Stanislau.Komar",
149
"email": "stanislau_komar@epam.com"
1510
}
1611
],
1712
"require": {
18-
"micro/kernel": "^1",
1913
"micro/deprecation-supports": "^1",
20-
"micro/plugin-event-emitter": "^1",
21-
"micro/kernel-boot-dependency": "^1",
14+
"micro/kernel": "^1.6",
2215
"micro/kernel-boot-configuration": "^1",
23-
"micro/kernel-boot-plugin-depended": "^1"
16+
"micro/kernel-boot-dependency": "^1",
17+
"micro/kernel-boot-plugin-depended": "^1",
18+
"micro/plugin-event-emitter": "^1",
19+
"micro/plugin-locator": "^1"
20+
},
21+
"require-dev": {
22+
"ergebnis/composer-normalize": "^2.29",
23+
"friendsofphp/php-cs-fixer": "^3.13",
24+
"phpstan/phpstan": "^1.9",
25+
"phpunit/php-code-coverage": "^9.2",
26+
"phpunit/phpunit": "^9.5",
27+
"vimeo/psalm": "^5.2"
28+
},
29+
"autoload": {
30+
"psr-4": {
31+
"Micro\\Kernel\\App\\": "src/"
32+
}
33+
},
34+
"autoload-dev": {
35+
"psr-4": {
36+
"Micro\\Kernel\\App\\Test\\Unit\\": "tests/Unit"
37+
}
38+
},
39+
"config": {
40+
"allow-plugins": {
41+
"ergebnis/composer-normalize": true
42+
},
43+
"sort-packages": true
44+
},
45+
"scripts": {
46+
"coverage": "XDEBUG_MODE=coverage ./vendor/bin/phpunit --coverage-text",
47+
"coverage-html": "XDEBUG_MODE=coverage ./vendor/bin/phpunit --coverage-html ./test-coverage-report",
48+
"php-cs-fix": "PHP_CS_FIXER_IGNORE_ENV=1 ./vendor/bin/php-cs-fixer fix --verbose --using-cache=no",
49+
"php-cs-try": "PHP_CS_FIXER_IGNORE_ENV=1 ./vendor/bin/php-cs-fixer fix --verbose --dry-run --using-cache=no",
50+
"phpstan": "./vendor/bin/phpstan analyze --no-progress",
51+
"phpunit": "./vendor/bin/phpunit",
52+
"psalm": "./vendor/bin/psalm --no-progress --show-info=true --no-cache",
53+
"statics": [
54+
"@phpstan",
55+
"@psalm",
56+
"@php-cs-try"
57+
],
58+
"test": [
59+
"@statics",
60+
"composer validate --strict",
61+
"composer normalize",
62+
"@coverage"
63+
]
2464
}
25-
}
65+
}

phpcs.xml

100644100755
File mode changed.

phpstan.neon.dist

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
parameters:
2+
level: 7
3+
paths:
4+
- src

0 commit comments

Comments
 (0)