Skip to content

Commit 671b75b

Browse files
committed
Refactoring to 2.2.x-dev
1 parent a957093 commit 671b75b

File tree

6 files changed

+68
-21
lines changed

6 files changed

+68
-21
lines changed

.github/workflows/main.yml

Lines changed: 31 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20,12 +20,11 @@ jobs:
2020

2121
- name: Install composer dependencies
2222
run: |
23+
# Install code check tools
2324
composer run cs:install
24-
2525
# Install app dependencies
2626
composer install --no-interaction --prefer-dist
2727
28-
# Check code checker and coding standards
2928
- name: Check coding standards
3029
run: |
3130
composer run cs:check
@@ -37,7 +36,7 @@ jobs:
3736
runs-on: ubuntu-latest
3837
strategy:
3938
matrix:
40-
php: ['7.2', '7.3', '7.4'] # 8.0
39+
php: ['7.2', '7.3', '7.4', '8.0']
4140

4241
name: PHP ${{ matrix.php }} tests
4342
steps:
@@ -52,6 +51,9 @@ jobs:
5251

5352
- name: Install composer dependencies
5453
run: |
54+
# Remove unnecesery packages
55+
composer remove phpstan/phpstan phpstan/phpstan-nette --dev --no-interaction
56+
# Install app dependencies
5557
composer install --no-interaction --prefer-dist
5658
5759
- name: Run tests
@@ -65,3 +67,29 @@ jobs:
6567
flags: unittests
6668
name: codecov-umbrella
6769
fail_ci_if_error: true
70+
71+
benchmark:
72+
runs-on: ubuntu-latest
73+
strategy:
74+
matrix:
75+
php: ['7.4']
76+
77+
name: Benchmark on PHP ${{ matrix.php }}
78+
steps:
79+
- name: Git clone
80+
uses: actions/checkout@master
81+
82+
- name: Install PHP
83+
uses: shivammathur/setup-php@master
84+
with:
85+
php-version: ${{ matrix.php }}
86+
87+
- name: Install composer dependencies
88+
run: |
89+
# Install benchmarking tool
90+
composer global require phpbench/phpbench @dev
91+
# Install app dependencies
92+
composer install --no-interaction --prefer-dist
93+
94+
- name: Run benchmarks
95+
run: phpbench run

README.md

Lines changed: 25 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,10 @@
22

33
[![Integrity check](https://github.com/mathematicator-core/mandelbrot-set/workflows/Integrity%20check/badge.svg)](https://github.com/mathematicator-core/mandelbrot-set/actions?query=workflow%3A%22Integrity+check%22)
44
[![codecov](https://codecov.io/gh/mathematicator-core/mandelbrot-set/branch/master/graph/badge.svg)](https://codecov.io/gh/mathematicator-core/mandelbrot-set)
5+
[![Latest Stable Version](https://poser.pugx.org/mathematicator-core/mandelbrot-set/v/stable)](https://packagist.org/packages/mathematicator-core/mandelbrot-set)
6+
[![Latest Unstable Version](https://poser.pugx.org/mathematicator-core/mandelbrot-set/v/unstable)](https://packagist.org/packages/mathematicator-core/mandelbrot-set)
57
[![License: MIT](https://img.shields.io/badge/License-MIT-brightgreen.svg)](./LICENSE)
6-
8+
[![PHPStan Enabled](https://img.shields.io/badge/PHPStan-enabled%20L8-brightgreen.svg?style=flat)](https://phpstan.org/)
79

810
Simple Generator for create image of Mandelbrot set as base64 by full-configuration request.
911

@@ -130,6 +132,28 @@ one to the most abstract one:
130132
</tr>
131133
</table>
132134

135+
**Third-party packages:**
136+
137+
⚠️ Not guaranteed!
138+
139+
<table>
140+
<tr>
141+
<td>
142+
<b>
143+
<a href="https://github.com/cothema/math-php-api">
144+
REST API
145+
</a>
146+
</b>
147+
</td>
148+
<td>
149+
Install the whole pack as a REST API service
150+
on your server (Docker ready) or
151+
access it via public cloud REST API.
152+
</td>
153+
</tr>
154+
</table>
155+
156+
133157
## Contribution
134158

135159
### Tests
File renamed without changes.

composer.json

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@
2323
"require": {
2424
"php": ">=7.2",
2525
"nette/utils": "^3.0",
26-
"mathematicator-core/vizualizator": "^2.0@dev"
26+
"mathematicator-core/vizualizator": "^2.2@dev"
2727
},
2828
"require-dev": {
2929
"brainmaestro/composer-git-hooks": "dev-master",
@@ -50,12 +50,12 @@
5050
"composer create-project nette/coding-standard temp/coding-standard ^2 --no-progress"
5151
],
5252
"cs:check": [
53-
"php temp/code-checker/code-checker --short-arrays --strict-types --no-progress",
54-
"php temp/coding-standard/ecs check src --config temp/coding-standard/coding-standard-php71.yml"
53+
"php temp/code-checker/code-checker -d src -d tests -d benchmarks --short-arrays --strict-types --no-progress",
54+
"php temp/coding-standard/ecs check src tests benchmarks --config temp/coding-standard/coding-standard-php71.yml"
5555
],
5656
"cs:fix": [
57-
"php temp/code-checker/code-checker --short-arrays --strict-types --fix --no-progress",
58-
"php temp/coding-standard/ecs check src --config temp/coding-standard/coding-standard-php71.yml --fix"
57+
"php temp/code-checker/code-checker -d src -d tests -d benchmarks --short-arrays --strict-types --fix --no-progress",
58+
"php temp/coding-standard/ecs check src tests benchmarks --config temp/coding-standard/coding-standard-php71.yml --fix"
5959
],
6060
"phpstan": "vendor/bin/phpstan analyse src -c phpstan.neon --level 8 --no-progress",
6161
"fix": [
@@ -73,7 +73,7 @@
7373
},
7474
"extra": {
7575
"branch-alias": {
76-
"dev-master": "2.0.x-dev"
76+
"dev-master": "2.2.x-dev"
7777
},
7878
"hooks": {
7979
"post-merge": "composer install",

tests/bootstrap.php renamed to tests/Bootstrap.php

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -5,15 +5,14 @@
55
namespace Mathematicator\MandelbrotSet\Tests;
66

77

8-
require __DIR__ . '/../vendor/autoload.php';
9-
10-
11-
use Mathematicator\Engine\Translation\TranslatorHelper;
128
use Nette\Configurator;
139
use Nette\DI\Container;
1410
use Tester\Environment;
1511

16-
Environment::setup();
12+
if (\is_file($autoload = __DIR__ . '/../vendor/autoload.php')) {
13+
require_once $autoload;
14+
Environment::setup();
15+
}
1716

1817
class Bootstrap
1918
{
@@ -29,8 +28,7 @@ public static function boot(): Container
2928
->register();
3029

3130
$configurator
32-
->addConfig(__DIR__ . '/../common.neon')
33-
->addConfig(__DIR__ . '/test.common.neon');
31+
->addConfig(__DIR__ . '/../common.neon');
3432

3533
return $configurator->createContainer();
3634
}

tests/MandelbrotSetTests/MandelbrotSetRequestTest.php

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,18 +9,15 @@
99
use Tester\Assert;
1010
use Tester\TestCase;
1111

12-
require __DIR__ . '/../bootstrap.php';
12+
require __DIR__ . '/../Bootstrap.php';
1313

1414
class MandelbrotSetRequestTest extends TestCase
1515
{
16-
17-
1816
public function testEntity(): void
1917
{
2018
$request = new MandelbrotSetRequest(10, 10);
2119
Assert::same('300_300_18_-2_1_-1_1_10_10.png', $request->getFileName());
2220
}
23-
2421
}
2522

2623
Bootstrap::boot();

0 commit comments

Comments
 (0)