Skip to content

Commit 39cfc17

Browse files
chore: prepare coding standards repo for public release
1 parent 164cf4b commit 39cfc17

4 files changed

Lines changed: 54 additions & 17 deletions

File tree

.github/workflows/qa.yml

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
name: QA
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
pull_request:
8+
workflow_dispatch:
9+
10+
jobs:
11+
qa:
12+
name: PHP ${{ matrix.php-version }}
13+
runs-on: ubuntu-latest
14+
15+
strategy:
16+
fail-fast: false
17+
matrix:
18+
php-version:
19+
- '8.2'
20+
- '8.3'
21+
- '8.4'
22+
- '8.5'
23+
24+
steps:
25+
- name: Checkout
26+
uses: actions/checkout@v4
27+
28+
- name: Setup PHP
29+
uses: shivammathur/setup-php@v2
30+
with:
31+
php-version: ${{ matrix.php-version }}
32+
coverage: none
33+
tools: composer:v2
34+
35+
- name: Validate Composer metadata
36+
run: composer validate --strict
37+
38+
- name: Install dependencies
39+
run: composer install --no-interaction --no-progress --prefer-dist
40+
41+
- name: Run QA
42+
run: composer qa

README.md

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -59,8 +59,6 @@ composer config allow-plugins.dealerdirect/phpcodesniffer-composer-installer tru
5959
composer require --dev sympress/coding-standards
6060
```
6161

62-
Inside this monorepo, the package is resolved through the existing path repository.
63-
6462
### Global Installation
6563

6664
The package can also be installed globally:
@@ -421,16 +419,16 @@ Run PHPUnit:
421419
composer tests
422420
```
423421

424-
Run the full QA script:
422+
Run PHPUnit with coverage reports when Xdebug or PCOV is available:
425423

426424
```bash
427-
composer qa
425+
composer tests:coverage
428426
```
429427

430-
Inside this DDEV project, use the root vendor binaries when the package is installed as a path dependency:
428+
Run the full QA script:
431429

432430
```bash
433-
ddev exec 'cd packages/coding-standards && ../../vendor/bin/phpcs --standard=phpcs.xml'
431+
composer qa
434432
```
435433

436434
## Copyright and License

composer.json

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -67,19 +67,23 @@
6767
"scripts": {
6868
"cs": [
6969
"Composer\\Config::disableProcessTimeout",
70-
"@php ../../bin/package-quality.php cs"
70+
"phpcs --standard=phpcs.xml"
7171
],
7272
"cs:fix": [
7373
"Composer\\Config::disableProcessTimeout",
74-
"@php ../../bin/package-quality.php cs:fix"
74+
"phpcbf --standard=phpcs.xml"
7575
],
7676
"static-analysis": [
7777
"Composer\\Config::disableProcessTimeout",
78-
"@php ../../bin/package-quality.php static-analysis"
78+
"phpstan analyse"
7979
],
8080
"tests": [
8181
"Composer\\Config::disableProcessTimeout",
82-
"@php ../../bin/package-quality.php tests"
82+
"phpunit"
83+
],
84+
"tests:coverage": [
85+
"Composer\\Config::disableProcessTimeout",
86+
"phpunit --coverage-text --coverage-clover tmp/coverage.xml --coverage-html tmp/coverage"
8387
],
8488
"qa": [
8589
"@cs",

phpunit.xml.dist

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -22,11 +22,4 @@
2222
<directory suffix=".php">SymPress</directory>
2323
</include>
2424
</source>
25-
<coverage>
26-
<report>
27-
<clover outputFile="tmp/coverage.xml" />
28-
<html outputDirectory="tmp/coverage" />
29-
<text outputFile="php://stdout" showUncoveredFiles="true" showOnlySummary="true" />
30-
</report>
31-
</coverage>
3225
</phpunit>

0 commit comments

Comments
 (0)