Skip to content

Commit 3f36539

Browse files
authored
Merge pull request #6 from Chris53897/feature/symfony5
Feature/symfony5
2 parents f06e967 + 8e100f1 commit 3f36539

28 files changed

+260
-288
lines changed

.github/workflows/code_checks.yaml

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
# .github/workflows/code_checks.yaml
2+
name: Code_Checks
3+
4+
on: ["push", "pull_request"]
5+
6+
jobs:
7+
tests:
8+
runs-on: ubuntu-latest
9+
strategy:
10+
fail-fast: false
11+
matrix:
12+
php: ['7.2', '7.3', '7.4', '8.0', '8.1']
13+
stability: [ prefer-lowest, prefer-stable ]
14+
15+
name: PHP ${{ matrix.php }} - ${{ matrix.stability }} tests
16+
steps:
17+
# basically git clone
18+
- uses: actions/checkout@v2
19+
20+
- name: Cache dependencies
21+
uses: actions/cache@v1
22+
with:
23+
path: ~/.composer/cache/files
24+
key: dependencies-php-${{ matrix.php }}-composer-${{ hashFiles('composer.json') }}
25+
26+
# use PHP of specific version
27+
- uses: shivammathur/setup-php@v2
28+
with:
29+
php-version: ${{ matrix.php }}
30+
extensions: pcov, dom, mbstring, pcntl
31+
coverage: pcov
32+
33+
- name: Install dependencies
34+
#run: composer update --${{ matrix.stability }} --prefer-dist --no-interaction
35+
# To install laminas/code Version 4.5.x with php 8.1 support
36+
run: composer update --${{ matrix.stability }} --prefer-dist --no-interaction --with-all-dependencies
37+
38+
- name: Execute tests
39+
run: vendor/bin/phpunit --verbose
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
# .github/workflows/code_coverage.yaml
2+
name: Code_Coverage
3+
4+
on: ["push", "pull_request"]
5+
6+
jobs:
7+
code_coverage:
8+
runs-on: ubuntu-latest
9+
steps:
10+
- uses: actions/checkout@v2
11+
- uses: shivammathur/setup-php@v2
12+
with:
13+
php-version: 8.0
14+
coverage: pcov
15+
16+
- run: composer install --no-progress
17+
18+
- run: vendor/bin/phpunit --coverage-clover build/logs/clover.xml
19+
20+
- uses: codecov/[email protected]
21+
with:
22+
token: ${{ secrets.CODECOV_TOKEN }}
23+
files: build/logs/clover.xml
Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
# OS: Linux; Symfony: upcoming (still unreleased) version; PHP: latest stable
2+
name: "Tests - Upcoming Symfony version (allowed to fail !)"
3+
4+
on: ["push", "pull_request"]
5+
6+
env:
7+
fail-fast: true
8+
9+
jobs:
10+
tests:
11+
runs-on: 'ubuntu-latest'
12+
continue-on-error: true
13+
steps:
14+
- name: 'Checkout code'
15+
uses: actions/[email protected]
16+
17+
- name: 'Install PHP with extensions'
18+
uses: shivammathur/[email protected]
19+
with:
20+
coverage: none
21+
php-version: '8.0'
22+
tools: composer:v2
23+
extensions: mbstring
24+
ini-values: date.timezone=UTC
25+
26+
- name: 'Install project dependencies'
27+
env:
28+
SYMFONY_REQUIRE: '6.0.x@dev'
29+
run: |
30+
composer global require --no-progress --no-scripts --no-plugins symfony/flex
31+
composer config minimum-stability dev
32+
composer config prefer-stable false
33+
composer update --no-interaction --optimize-autoloader
34+
composer require symfony/phpunit-bridge
35+
36+
- name: 'Run tests'
37+
env:
38+
SYMFONY_DEPRECATIONS_HELPER: 'weak'
39+
#SYMFONY_DEPRECATIONS_HELPER: 'max[indirect]=9999&max[direct]=0&max[self]=9999'
40+
run: vendor/bin/phpunit -v || exit 0

.gitignore

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,8 @@
1-
/vendor/
2-
/cache.properties
1+
vendor/
2+
composer.lock
3+
.php_cs.cache
4+
.phpcs-cache
5+
.phpunit.result.cache
6+
composer.phar
7+
.idea/
8+
_gsdata_/

.travis.yml

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

CHANGELOG.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
11
# Changelog
22

3+
## 3.0.0
4+
Add support for Symfony 5 and 6. Bump PHP to >= 7.2
5+
36
## 2.1.0
47
Add opcache information to the info endpoint when available #7
58

README.md

Lines changed: 18 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
11
# OpenConext Monitor bundle
2-
[![Build Status](https://travis-ci.org/OpenConext/Monitor-bundle.svg)](https://travis-ci.org/OpenConext/Monitor-bundle)
32

4-
A Symfony2 bundle that adds a /health and /info endpoint to your application.
3+
[![Code_Checks](https://github.com/OpenConext/Monitor-bundle/actions/workflows/code_checks.yaml/badge.svg)](https://github.com/OpenConext/Monitor-bundle/actions/workflows/code_checks.yaml)
4+
5+
A Symfony 3/4/5 bundle that adds a /health and /info endpoint to your application.
56

67
The endpoints return JSON responses. The `/info` endpoint tries to give as much information about the currently installed
78
version of the application as possible. This information is based on the build path of the installation. But also
@@ -29,22 +30,25 @@ When a health check failed the HTTP Response status code will be 503. And the JS
2930
composer require openconext/monitor-bundle
3031
```
3132

32-
* Add the bundle to your kernel in `app/AppKernel.php`
33+
* If you don't use [Symfony Flex](https://symfony.com/doc/current/setup/flex.html), you must enable the bundle manually in the application:
34+
3335
```php
34-
public function registerBundles()
35-
{
36-
// ...
37-
new OpenConext\MonitorBundle\OpenConextMonitorBundle(),
38-
}
39-
```
40-
* Include the routing configuration in `app/config/routing.yml` by adding:
36+
// config/bundles.php
37+
// in older Symfony apps, enable the bundle in app/AppKernel.php
38+
return [
39+
// ...
40+
OpenConext\MonitorBundle\OpenConextMonitorBundle::class => ['all' => true],
41+
];
42+
```
43+
44+
* Include the routing configuration in `config/routes.yml` by adding:
4145
```yaml
42-
openconext_monitor:
46+
open_conext_monitor:
4347
resource: "@OpenConextMonitorBundle/Resources/config/routing.yml"
4448
prefix: /
4549
```
4650
47-
* Add security exceptions in `app/config/security.yml` (if this is required at all)
51+
* Add security exceptions in `config/packages/security.yml` (if this is required at all)
4852
```yaml
4953
security:
5054
firewalls:
@@ -82,11 +86,7 @@ class ApiHealthCheck implements HealthCheckInterface
8286
$this->testService = $service;
8387
}
8488
85-
/**
86-
* @param HealthReportInterface $report
87-
* @return HealthReportInterface
88-
*/
89-
public function check(HealthReportInterface $report)
89+
public function check(HealthReportInterface $report): HealthReportInterface
9090
{
9191
if (!$this->testService->everythingOk()) {
9292
// Return a HealthReport with a DOWN status when there are indications the application is not functioning as
@@ -136,4 +136,4 @@ For example in your ACME bunde that is using the monitor bundle:
136136
The rest of the service configuration is up to your own needs. You can inject arguments, factory calls and other service features as need be.
137137
138138
## Release strategy
139-
Please read: https://github.com/OpenConext/Stepup-Deploy/wiki/Release-Management fro more information on the release strategy used in Stepup projects.
139+
Please read: https://github.com/OpenConext/Stepup-Deploy/wiki/Release-Management for more information on the release strategy used in Stepup projects.

build.xml

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

composer.json

Lines changed: 38 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,31 +1,55 @@
11
{
22
"name": "openconext/monitor-bundle",
33
"type": "symfony-bundle",
4-
"description": "A Symfony 4 bundle that facilitates health and info endpoints to a Symfony application. The bundle is backwards compatible with Symfony 2 projects.",
4+
"description": "A Symfony 4/5/6 bundle that facilitates health and info endpoints to a Symfony application. The bundle is backwards compatible with Symfony 2 projects.",
55
"keywords": ["SURFnet", "StepUp", "OpenConext", "monitoring", "health"],
66
"license": "Apache-2.0",
77
"minimum-stability": "stable",
88
"require": {
9-
"php": ">=5.4,<8.0-dev",
10-
"symfony/dependency-injection": ">=3.4,<5",
11-
"symfony/framework-bundle": ">=3.4,<5",
12-
"webmozart/assert": "^1.2"
9+
"php": ">=7.2, <9.0-dev",
10+
"symfony/dependency-injection": "^4.4|^5.0|^6.0",
11+
"symfony/framework-bundle": "^4.4|^5.0|^6.0",
12+
"doctrine/orm": "^2.9",
13+
"webmozart/assert": "^1.10"
1314
},
1415
"require-dev": {
15-
"jakub-onderka/php-parallel-lint": "^0.9.2",
16+
"php-parallel-lint/php-parallel-lint": "^1.3",
1617
"phpmd/phpmd": "^2.6",
17-
"matthiasnoback/symfony-config-test": "^2.1",
18-
"phpdocumentor/reflection-docblock": "3.3.*",
19-
"phpunit/php-token-stream": "1.4.*",
20-
"phpunit/phpunit": "^5.7",
21-
"sebastian/phpcpd": "^3.0",
22-
"squizlabs/php_codesniffer": "^3.1",
23-
"malukenho/docheader": "^0.1.6",
24-
"mockery/mockery": "~0.9"
18+
"matthiasnoback/symfony-config-test": "^4.3",
19+
"phpdocumentor/reflection-docblock": "^5.2",
20+
"phpunit/php-token-stream": "^3.1.3|^4.0.4",
21+
"phpunit/phpunit": "^8.5|^9.0",
22+
"sebastian/phpcpd": "^4.1|^5.0|^6.0",
23+
"squizlabs/php_codesniffer": "^3.6",
24+
"malukenho/docheader": "^0.1.8",
25+
"mockery/mockery": "^1.3.5|^1.4.4"
2526
},
2627
"autoload": {
2728
"psr-4": {
2829
"OpenConext\\MonitorBundle\\": "src"
2930
}
31+
},
32+
"autoload-dev": {
33+
"psr-4": {
34+
"App\\Tests\\": "src/Tests/"
35+
}
36+
},
37+
"scripts": {
38+
"tests": {
39+
"docheader": "vendor/bin/docheader check src/",
40+
"phpcmd": "vendor/bin/phpmd src xml phpmd.xml --exclude=*/Tests/*",
41+
"phpcs": "vendor/bin/phpcs src --report=full --standard=phpcs.xml --extensions=php --warning-severity=0",
42+
"phpcpd": "vendor/bin/phpcpd src --exclude=src/Tests/*",
43+
"phpunit": "vendor/bin/phpunit --coverage-text"
44+
},
45+
"post-update-cmd": [
46+
"@tests"
47+
]
48+
},
49+
"config": {
50+
"preferred-install": {
51+
"*": "dist"
52+
},
53+
"sort-packages": true
3054
}
3155
}

0 commit comments

Comments
 (0)