Skip to content

Commit 2fd8cad

Browse files
committed
use renovate
use renovate instead of dependabot for deps management
1 parent c45ac63 commit 2fd8cad

File tree

9 files changed

+169
-119
lines changed

9 files changed

+169
-119
lines changed

.github/dependabot.yaml

Lines changed: 0 additions & 13 deletions
This file was deleted.
Lines changed: 119 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,119 @@
1+
name: "continuous integration"
2+
3+
on:
4+
pull_request:
5+
push:
6+
branches:
7+
- "main"
8+
- "renovate/*"
9+
10+
env:
11+
MIN_MSI: 95.00
12+
MIN_COVERED_MSI: 98.00
13+
14+
jobs:
15+
phpunit-tests:
16+
name: "phpunit tests"
17+
18+
runs-on: ${{ matrix.operating-system }}
19+
20+
strategy:
21+
matrix:
22+
dependencies:
23+
- "lowest"
24+
- "highest"
25+
- "locked"
26+
php-version:
27+
- "8.1"
28+
- "8.2"
29+
operating-system:
30+
- "ubuntu-latest"
31+
steps:
32+
- name: "checkout"
33+
uses: "actions/checkout@v3"
34+
35+
- name: "install php"
36+
uses: "shivammathur/setup-php@v2"
37+
with:
38+
coverage: "pcov"
39+
php-version: "${{ matrix.php-version }}"
40+
ini-values: memory_limit=-1
41+
tools: composer:v2, cs2pr
42+
43+
- name: "install dependencies"
44+
uses: "ramsey/[email protected]"
45+
with:
46+
dependency-versions: "${{ matrix.dependencies }}"
47+
48+
- name: "tests"
49+
run: "vendor/bin/phpunit --exclude=ci-borked --coverage-clover=coverage.xml"
50+
51+
mutation-tests:
52+
name: "mutation tests"
53+
54+
runs-on: ${{ matrix.operating-system }}
55+
56+
strategy:
57+
matrix:
58+
dependencies:
59+
- "locked"
60+
php-version:
61+
- "8.1"
62+
operating-system:
63+
- "ubuntu-latest"
64+
65+
steps:
66+
- name: "checkout"
67+
uses: "actions/checkout@v3"
68+
69+
- name: "install php"
70+
uses: "shivammathur/setup-php@v2"
71+
with:
72+
coverage: "xdebug"
73+
php-version: "${{ matrix.php-version }}"
74+
ini-values: memory_limit=-1, zend.assertions=1
75+
76+
- name: "install dependencies"
77+
uses: "ramsey/[email protected]"
78+
with:
79+
dependency-versions: "${{ matrix.dependencies }}"
80+
81+
- name: "infection"
82+
run: "./vendor/bin/infection -j$(nproc) --logger-github --min-msi=$MIN_MSI --min-covered-msi=$MIN_COVERED_MSI --test-framework-options='--testsuite=unit --exclude=ci-borked'"
83+
env:
84+
INFECTION_BADGE_API_KEY: ${{ secrets.STRYKER_DASHBOARD_API_KEY }}
85+
STRYKER_DASHBOARD_API_KEY: ${{ secrets.STRYKER_DASHBOARD_API_KEY }}
86+
87+
coding-standards:
88+
name: "php cs fixer"
89+
90+
runs-on: ${{ matrix.operating-system }}
91+
92+
strategy:
93+
matrix:
94+
dependencies:
95+
- "locked"
96+
php-version:
97+
- "8.1"
98+
operating-system:
99+
- "ubuntu-latest"
100+
101+
steps:
102+
- name: "checkout"
103+
uses: "actions/checkout@v3"
104+
105+
- name: "install PHP"
106+
uses: "shivammathur/setup-php@v2"
107+
with:
108+
coverage: "none"
109+
php-version: "${{ matrix.php-version }}"
110+
ini-values: memory_limit=-1
111+
tools: composer:v2, cs2pr, php-cs-fixer
112+
113+
- name: "install dependencies"
114+
uses: "ramsey/[email protected]"
115+
with:
116+
dependency-versions: "${{ matrix.dependencies }}"
117+
118+
- name: "php cs fixer dry run"
119+
run: "php-cs-fixer fix --dry-run --format=checkstyle | cs2pr"

.github/workflows/infection.yaml

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

.github/workflows/merge-dependabot-upgrades.yaml

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

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
/vendor/
22
.phpunit.result.cache
3+
.php-cs-fixer.cache
34
/.coverage-cache
45
/build

.php-cs-fixer.dist.php

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
<?php
2+
3+
$header = <<<'EOF'
4+
This file is part of WickedOne\PHPUnitPrinter.
5+
6+
(c) wicliff <[email protected]>
7+
8+
For the full copyright and license information, please view the LICENSE
9+
file that was distributed with this source code.
10+
EOF;
11+
12+
return (new PhpCsFixer\Config())
13+
->setRiskyAllowed(true)
14+
->setRules(array(
15+
'@Symfony' => true,
16+
'@Symfony:risky' => true,
17+
'combine_consecutive_unsets' => true,
18+
'array_syntax' => array('syntax' => 'short'),
19+
'no_extra_blank_lines' => ['tokens' => ['break', 'continue', 'extra', 'return', 'throw', 'use', 'parenthesis_brace_block', 'square_brace_block', 'curly_brace_block']],
20+
'header_comment' => array('header' => $header),
21+
'no_useless_else' => true,
22+
'no_useless_return' => true,
23+
'ordered_class_elements' => true,
24+
'ordered_imports' => true,
25+
'php_unit_strict' => true,
26+
'phpdoc_add_missing_param_annotation' => true,
27+
'psr_autoloading' => true,
28+
'strict_comparison' => true,
29+
'strict_param' => true,
30+
'fopen_flags' => array('b_mode' => true),
31+
))
32+
->setFinder(
33+
(new PhpCsFixer\Finder())
34+
->in([__DIR__ . '/src/', __DIR__ . '/tests/'])
35+
->name('*.php')
36+
);

composer.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
"testing"
99
],
1010
"require": {
11-
"php": ">=7.4",
11+
"php": "~8.1.0 || ~8.2.0",
1212
"phpunit/phpunit": "^9.5"
1313
},
1414
"license": "MIT",
@@ -28,7 +28,7 @@
2828
"WickedOne\\PHPUnitPrinter\\Tests\\": "tests/"
2929
}
3030
},
31-
"minimum-stability": "dev",
31+
"minimum-stability": "stable",
3232
"prefer-stable": true,
3333
"require-dev": {
3434
"infection/infection": "^0.25.3"

renovate.json

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
{
2+
"$schema": "https://docs.renovatebot.com/renovate-schema.json",
3+
"extends": [
4+
"local>wickedOne/.github:renovate-config"
5+
]
6+
}

src/PhpStormPrinter.php

Lines changed: 5 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -13,36 +13,32 @@
1313

1414
namespace WickedOne\PHPUnitPrinter;
1515

16-
use const PHP_SAPI;
1716
use PHPUnit\Framework\TestFailure;
1817
use PHPUnit\TextUI\DefaultResultPrinter;
1918

2019
/**
21-
* PhpStorm Printer.
22-
*
2320
* @author wicliff <[email protected]>
2421
*/
2522
class PhpStormPrinter extends DefaultResultPrinter
2623
{
27-
/**
28-
* @param \PHPUnit\Framework\TestFailure $defect
29-
* @param int $count
30-
*/
3124
protected function printDefect(TestFailure $defect, int $count): void
3225
{
3326
parent::printDefect($defect, $count);
3427

35-
if (PHP_SAPI === 'cli') {
28+
if (\PHP_SAPI === 'cli') {
3629
$this->printDefectFooter($defect);
3730
}
3831
}
3932

4033
/**
41-
* @param \PHPUnit\Framework\TestFailure $defect
34+
* @group ci-borked
35+
*
36+
* github actions for some reason _always_ has a failing line so this test will always fail.
4237
*/
4338
private function printDefectFooter(TestFailure $defect): void
4439
{
4540
$trace = explode(\PHP_EOL, trim((string) $defect->thrownException()));
41+
print_r($trace);
4642
$offender = end($trace);
4743

4844
// the things you do to please infection... ;-)

0 commit comments

Comments
 (0)