Skip to content

Commit 6226d12

Browse files
authored
Merge pull request #271 from ergebnis/feature/synchronize
Enhancement: Synchronize with `ergebnis/php-package-template`
2 parents fb29bbc + 11cfa5c commit 6226d12

25 files changed

+136
-138
lines changed

.github/CODEOWNERS

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
1-
# https://docs.github.com/en/repositories/managing-your-repositorys-settings-and-features/customizing-your-repository/about-code-owners#codeowners-file-size
1+
# https://docs.github.com/en/repositories/managing-your-repositorys-settings-and-features/customizing-your-repository/about-code-owners
22

33
* @ergebnis-bot @localheinz

.github/CONTRIBUTING.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -114,7 +114,7 @@ Run
114114
make
115115
```
116116

117-
to enforce coding standards, run a static code analysis, and run tests!
117+
to automatically refactor code, enforce coding standards, run a static code analysis, and run tests!
118118

119119
## Help
120120

.github/SECURITY.md

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
# Security Policy
2+
3+
## Supported Versions
4+
5+
The following versions of `ergebnis/phpunit-slow-test-detector` have active support:
6+
7+
- `^2.1.1`
8+
9+
## Unsupported Versions
10+
11+
The following versions of `ergebnis/phpunit-slow-test-detector` have reached their end of life:
12+
13+
- `<=2.1.0`
14+
15+
## Reporting a Vulnerability
16+
17+
If you believe that you have found a security vulnerability, please send an email to `[email protected]`. Ensure to include all details required to understand the severity of the issue.

.github/settings.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -75,6 +75,7 @@ repository:
7575
description: ":stopwatch: Provides an extension for detecting slow tests in phpunit/phpunit."
7676
enable_automated_security_fixes: true
7777
enable_vulnerability_alerts: true
78+
has_discussions: false
7879
has_downloads: true
7980
has_issues: true
8081
has_pages: false

.github/workflows/integrate.yaml

Lines changed: 39 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ jobs:
3030
uses: "shivammathur/[email protected]"
3131
with:
3232
coverage: "xdebug"
33-
extensions: "none, ctype, dom, json, mbstring, phar, simplexml, tokenizer, xml, xmlwriter"
33+
extensions: "none, ctype, curl, dom, json, mbstring, phar, simplexml, tokenizer, xml, xmlwriter"
3434
php-version: "${{ matrix.php-version }}"
3535

3636
- name: "Set up problem matchers for PHP"
@@ -39,6 +39,9 @@ jobs:
3939
- name: "Set up problem matchers for phpunit/phpunit"
4040
run: "echo \"::add-matcher::${{ runner.tool_cache }}/phpunit.json\""
4141

42+
- name: "Validate composer.json and composer.lock"
43+
run: "composer validate --ansi --strict"
44+
4245
- name: "Determine composer cache directory"
4346
uses: "ergebnis/.github/actions/composer/[email protected]"
4447

@@ -93,7 +96,7 @@ jobs:
9396
uses: "shivammathur/[email protected]"
9497
with:
9598
coverage: "none"
96-
extensions: "none, ctype, dom, json, mbstring, phar, simplexml, tokenizer, xml, xmlwriter"
99+
extensions: "none, ctype, curl, dom, json, mbstring, phar, simplexml, tokenizer, xml, xmlwriter"
97100
php-version: "${{ matrix.php-version }}"
98101

99102
- name: "Set up problem matchers for PHP"
@@ -121,7 +124,7 @@ jobs:
121124
run: "composer normalize --ansi --dry-run"
122125

123126
- name: "Create cache directory for friendsofphp/php-cs-fixer"
124-
run: "mkdir -p .build/php-cs-fixer"
127+
run: "mkdir -p .build/php-cs-fixer/"
125128

126129
- name: "Cache cache directory for friendsofphp/php-cs-fixer"
127130
uses: "actions/[email protected]"
@@ -156,13 +159,16 @@ jobs:
156159
uses: "shivammathur/[email protected]"
157160
with:
158161
coverage: "none"
159-
extensions: "none, ctype, dom, json, mbstring, phar, simplexml, tokenizer, xml, xmlwriter"
162+
extensions: "none, ctype, curl, dom, json, mbstring, phar, simplexml, tokenizer, xml, xmlwriter"
160163
php-version: "${{ matrix.php-version }}"
161164
tools: "phive"
162165

163166
- name: "Set up problem matchers for PHP"
164167
run: "echo \"::add-matcher::${{ runner.tool_cache }}/php.json\""
165168

169+
- name: "Validate composer.json and composer.lock"
170+
run: "composer validate --ansi --strict"
171+
166172
- name: "Determine composer cache directory"
167173
uses: "ergebnis/.github/actions/composer/[email protected]"
168174

@@ -207,12 +213,15 @@ jobs:
207213
uses: "shivammathur/[email protected]"
208214
with:
209215
coverage: "none"
210-
extensions: "none, ctype, dom, intl, json, mbstring, phar, simplexml, tokenizer, xml, xmlwriter"
216+
extensions: "none, ctype, curl, dom, intl, json, mbstring, phar, simplexml, tokenizer, xml, xmlwriter"
211217
php-version: "${{ matrix.php-version }}"
212218

213219
- name: "Set up problem matchers for PHP"
214220
run: "echo \"::add-matcher::${{ runner.tool_cache }}/php.json\""
215221

222+
- name: "Validate composer.json and composer.lock"
223+
run: "composer validate --ansi --strict"
224+
216225
- name: "Determine composer cache directory"
217226
uses: "ergebnis/.github/actions/composer/[email protected]"
218227

@@ -229,7 +238,7 @@ jobs:
229238
dependencies: "${{ matrix.dependencies }}"
230239

231240
- name: "Create cache directory for rector/rector"
232-
run: "mkdir -p .build/rector"
241+
run: "mkdir -p .build/rector/"
233242

234243
- name: "Cache cache directory for rector/rector"
235244
uses: "actions/[email protected]"
@@ -273,6 +282,21 @@ jobs:
273282
- name: "Validate composer.json and composer.lock"
274283
run: "composer validate --ansi --strict"
275284

285+
- name: "Determine composer cache directory"
286+
uses: "ergebnis/.github/actions/composer/[email protected]"
287+
288+
- name: "Cache dependencies installed with composer"
289+
uses: "actions/[email protected]"
290+
with:
291+
path: "${{ env.COMPOSER_CACHE_DIR }}"
292+
key: "php-${{ matrix.php-version }}-composer-${{ matrix.dependencies }}-${{ hashFiles('composer.lock') }}"
293+
restore-keys: "php-${{ matrix.php-version }}-composer-${{ matrix.dependencies }}-"
294+
295+
- name: "Install ${{ matrix.dependencies }} dependencies with composer"
296+
uses: "ergebnis/.github/actions/composer/[email protected]"
297+
with:
298+
dependencies: "${{ matrix.dependencies }}"
299+
276300
- name: "Check installed packages for security vulnerability advisories"
277301
run: "composer audit --ansi"
278302

@@ -297,12 +321,15 @@ jobs:
297321
uses: "shivammathur/[email protected]"
298322
with:
299323
coverage: "none"
300-
extensions: "none, ctype, curl, dom, json, mbstring, pcntl, phar, posix, simplexml, tokenizer, xml, xmlwriter"
324+
extensions: "none, ctype, curl, dom, json, mbstring, opcache, pcntl, phar, posix, simplexml, tokenizer, xml, xmlwriter"
301325
php-version: "${{ matrix.php-version }}"
302326

303327
- name: "Set up problem matchers for PHP"
304328
run: "echo \"::add-matcher::${{ runner.tool_cache }}/php.json\""
305329

330+
- name: "Validate composer.json and composer.lock"
331+
run: "composer validate --ansi --strict"
332+
306333
- name: "Determine composer cache directory"
307334
uses: "ergebnis/.github/actions/composer/[email protected]"
308335

@@ -319,7 +346,7 @@ jobs:
319346
dependencies: "${{ matrix.dependencies }}"
320347

321348
- name: "Create cache directory for vimeo/psalm"
322-
run: "mkdir -p .build/psalm"
349+
run: "mkdir -p .build/psalm/"
323350

324351
- name: "Run vimeo/psalm"
325352
run: "vendor/bin/psalm --config=psalm.xml --output-format=github --shepherd --show-info=false --stats --threads=4"
@@ -348,7 +375,7 @@ jobs:
348375
uses: "shivammathur/[email protected]"
349376
with:
350377
coverage: "none"
351-
extensions: "none, ctype, dom, json, mbstring, phar, simplexml, tokenizer, xml, xmlwriter"
378+
extensions: "none, ctype, curl, dom, json, mbstring, phar, simplexml, tokenizer, xml, xmlwriter"
352379
php-version: "${{ matrix.php-version }}"
353380

354381
- name: "Set up problem matchers for PHP"
@@ -357,6 +384,9 @@ jobs:
357384
- name: "Set up problem matchers for phpunit/phpunit"
358385
run: "echo \"::add-matcher::${{ runner.tool_cache }}/phpunit.json\""
359386

387+
- name: "Validate composer.json and composer.lock"
388+
run: "composer validate --ansi --strict"
389+
360390
- name: "Determine composer cache directory"
361391
uses: "ergebnis/.github/actions/composer/[email protected]"
362392

.github/workflows/renew.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ jobs:
3030
uses: "shivammathur/[email protected]"
3131
with:
3232
coverage: "none"
33-
extensions: "none, ctype, dom, json, mbstring, phar, simplexml, tokenizer, xml, xmlwriter"
33+
extensions: "none, ctype, curl, dom, json, mbstring, phar, simplexml, tokenizer, xml, xmlwriter"
3434
php-version: "${{ matrix.php-version }}"
3535

3636
- name: "Set up problem matchers for PHP"

.gitignore

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/.build/
2-
/.notes/
2+
/.note/
33
/.phive/
44
/vendor/
55
!/.phive/phars.xml

.php-cs-fixer.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@
3434
->exclude([
3535
'.build/',
3636
'.github/',
37-
'.notes/',
37+
'.note/',
3838
])
3939
->ignoreDotFiles(false)
4040
->in(__DIR__)

.yamllint.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ extends: "default"
22

33
ignore: |
44
.build/
5-
.notes/
5+
.note/
66
vendor/
77
88
rules:

Makefile

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -3,14 +3,14 @@ it: refactoring coding-standards security-analysis static-code-analysis tests ##
33

44
.PHONY: code-coverage
55
code-coverage: vendor ## Collects coverage from running unit tests with phpunit/phpunit
6-
mkdir -p .build/phpunit
7-
vendor/bin/phpunit --configuration=test/phpunit.xml --coverage-text
6+
mkdir -p .build/phpunit/
7+
vendor/bin/phpunit --configuration=test/Unit/phpunit.xml --coverage-text
88

99
.PHONY: coding-standards
1010
coding-standards: vendor ## Lints YAML files with yamllint, normalizes composer.json with ergebnis/composer-normalize, and fixes code style issues with friendsofphp/php-cs-fixer
1111
yamllint -c .yamllint.yaml --strict .
1212
composer normalize
13-
mkdir -p .build/php-cs-fixer
13+
mkdir -p .build/php-cs-fixer/
1414
vendor/bin/php-cs-fixer fix --config=.php-cs-fixer.php --diff --verbose
1515

1616
.PHONY: dependency-analysis
@@ -22,12 +22,13 @@ help: ## Displays this list of targets with descriptions
2222
@grep -E '^[a-zA-Z0-9_-]+:.*?## .*$$' $(MAKEFILE_LIST) | sort | awk 'BEGIN {FS = ":.*?## "}; {printf "\033[32m%-30s\033[0m %s\n", $$1, $$2}'
2323

2424
.PHONY: phive
25-
phive: .phive## Installs dependencies with phive
26-
mkdir -p .build/phive
25+
phive: .phive ## Installs dependencies with phive
26+
mkdir -p .build/phive/
2727
PHIVE_HOME=.build/phive phive install --trust-gpg-keys 0x033E5F8D801A2F8D
2828

2929
.PHONY: refactoring
3030
refactoring: vendor ## Runs automated refactoring with rector/rector
31+
mkdir -p .build/rector/
3132
vendor/bin/rector process --config=rector.php
3233

3334
.PHONY: security-analysis
@@ -36,13 +37,13 @@ security-analysis: vendor ## Runs a security analysis with composer
3637

3738
.PHONY: static-code-analysis
3839
static-code-analysis: vendor ## Runs a static code analysis with vimeo/psalm
39-
mkdir -p .build/psalm
40+
mkdir -p .build/psalm/
4041
vendor/bin/psalm --config=psalm.xml --clear-cache
4142
vendor/bin/psalm --config=psalm.xml --show-info=false --stats --threads=4
4243

4344
.PHONY: static-code-analysis-baseline
4445
static-code-analysis-baseline: vendor ## Generates a baseline for static code analysis with vimeo/psalm
45-
mkdir -p .build/psalm
46+
mkdir -p .build/psalm/
4647
vendor/bin/psalm --config=psalm.xml --clear-cache
4748
vendor/bin/psalm --config=psalm.xml --set-baseline=psalm-baseline.xml
4849

0 commit comments

Comments
 (0)