Skip to content

Commit 8328057

Browse files
committed
Base CI
1 parent 3484d9a commit 8328057

File tree

4 files changed

+45
-5
lines changed

4 files changed

+45
-5
lines changed

.github/workflows/ci.yml

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
name: CI
2+
3+
on:
4+
- pull_request
5+
- push
6+
7+
jobs:
8+
tests:
9+
name: "PHP ${{matrix.php}}"
10+
runs-on: "ubuntu-24.04"
11+
strategy:
12+
fail-fast: false
13+
matrix:
14+
include:
15+
- php: "8.1"
16+
- php: "8.2"
17+
- php: "8.3"
18+
19+
steps:
20+
- name: Checkout source
21+
uses: actions/checkout@v4
22+
23+
- name: PHP setup
24+
uses: shivammathur/setup-php@v2
25+
with:
26+
php-version: ${{ matrix.php }}
27+
ini-values: zend.assertions=1, error_reporting=-1, display_errors=On, log_errors_max_len=0
28+
29+
- name: "Update composer dependencies"
30+
run: composer update -o --no-interaction --no-progress
31+
32+
- name: Run check
33+
run: composer reproduce

.php-cs-fixer.dist.php

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,16 @@
11
<?php
22

33
declare(strict_types=1);
4+
use PhpCsFixer\Config;
5+
use PhpCsFixer\Finder;
46

5-
$finder = PhpCsFixer\Finder::create()
7+
$finder = Finder::create()
68
->ignoreDotFiles(false)
79
->ignoreVCSIgnored(true)
810
->in(__DIR__)
911
;
1012

11-
$config = new PhpCsFixer\Config();
13+
$config = new Config();
1214
$config
1315
->setRiskyAllowed(true)
1416
->setRules([

README.md

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,8 @@
11
# Repo helps to reproduce reported bugs
22

3-
Select branch and run `composer repro`.
3+
Send PR against `master` branch with with needed adjustments, especially:
4+
- sample code in `src/`
5+
- adjusted config in `.php-cs-fixer.dist.php`
6+
- adjusted PHP version in `.github.workflows/ci.yml`
7+
- adjusted PHP CS Fixer version in `composer.json`
8+
- adjust `composer reproduce` command in `composer.json`

composer.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,14 +2,14 @@
22
"name": "keradus/php-cs-fixer-repro-cases",
33
"require": {
44
"php": "^8.1",
5-
"friendsofphp/php-cs-fixer": "3.13.1"
5+
"friendsofphp/php-cs-fixer": "3.72"
66
},
77
"autoload": {
88
"psr-4": {
99
"keradus\\PhpCsFixerReproCases\\": "src/"
1010
}
1111
},
1212
"scripts": {
13-
"repro": "./vendor/bin/php-cs-fixer fix -vvv --dry-run --diff"
13+
"reproduce": "./vendor/bin/php-cs-fixer check -vvv --diff"
1414
}
1515
}

0 commit comments

Comments
 (0)