Skip to content

Commit 9a655d4

Browse files
authored
Merge branch 'main' into feature/php84
2 parents 9512e48 + 2f48942 commit 9a655d4

File tree

14 files changed

+296
-95
lines changed

14 files changed

+296
-95
lines changed

.config/.remarkrc

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
{
2+
"plugins": [
3+
"remark-preset-lint-recommended",
4+
["remark-lint-list-item-indent", "space"]
5+
]
6+
}

.config/.yamllint

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
---
2+
extends: default
3+
4+
ignore: |
5+
vendor/
6+
7+
rules:
8+
brackets:
9+
max-spaces-inside: 1
10+
document-start: disable
11+
line-length:
12+
level: warning
13+
max: 120
14+
truthy: {allowed-values: ["true", "false", "on"]}
Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
11
<?xml version="1.0" encoding="UTF-8"?>
22
<phpunit
33
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
4-
xsi:noNamespaceSchemaLocation="./vendor/phpunit/phpunit/phpunit.xsd"
4+
xsi:noNamespaceSchemaLocation="../vendor/phpunit/phpunit/phpunit.xsd"
55

66
beStrictAboutCoversAnnotation="true"
77
beStrictAboutOutputDuringTests="true"
88
beStrictAboutTodoAnnotatedTests="true"
9-
bootstrap="vendor/autoload.php"
10-
cacheResultFile=".phpunit.cache/test-results"
9+
bootstrap="../vendor/autoload.php"
10+
cacheResultFile="../.phpunit.cache/test-results"
1111
convertDeprecationsToExceptions="true"
1212
failOnRisky="true"
1313
failOnWarning="true"
@@ -16,18 +16,18 @@
1616
>
1717
<testsuites>
1818
<testsuite name="all">
19-
<directory suffix=".php">tests/</directory>
19+
<directory suffix=".php">../tests/</directory>
2020
</testsuite>
2121
</testsuites>
2222

23-
<coverage processUncoveredFiles="false">
23+
<coverage cacheDirectory="../.phpunit.cache/code-coverage" processUncoveredFiles="false">
2424
<include>
25-
<directory suffix=".php">src/</directory>
25+
<directory suffix=".php">../src/</directory>
2626
</include>
2727
<report>
2828
<!-- clover outputFile="build/clover.xml"/ -->
2929
<!-- html outputDirectory="build/coverage"/ -->
3030
<text outputFile="php://stdout"/>
3131
</report>
3232
</coverage>
33-
</phpunit>
33+
</phpunit>

.github/workflows/json.yml

Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
---
2+
name: JSON Quality Assistance
3+
4+
on:
5+
# This event occurs when there is activity on a pull request. The workflow
6+
# will be run against the commits, after merge to the target branch (main).
7+
pull_request:
8+
branches: [ main ]
9+
paths:
10+
- '**.json'
11+
- '.github/workflows/json.yml'
12+
types: [ opened, reopened, synchronize ]
13+
# This event occurs when there is a push to the repository.
14+
push:
15+
paths:
16+
- '**.json'
17+
- '.github/workflows/json.yml'
18+
# Allow manually triggering the workflow.
19+
workflow_dispatch:
20+
21+
# Cancels all previous workflow runs for the same branch that have not yet completed.
22+
concurrency:
23+
group: ${{ github.workflow }}-${{ github.ref }}
24+
cancel-in-progress: true
25+
26+
permissions:
27+
# Needed to allow the "concurrency" section to cancel a workflow run.
28+
actions: write
29+
30+
jobs:
31+
# 01.preflight.json.lint-syntax.yml
32+
lint-json-syntax:
33+
name: JSON Syntax Linting
34+
runs-on: ubuntu-24.04
35+
steps:
36+
- uses: actions/checkout@v4
37+
- uses: docker://pipelinecomponents/jsonlint
38+
with:
39+
args: >-
40+
find .
41+
-not -path '*/.git/*'
42+
-not -path '*/node_modules/*'
43+
-not -path '*/vendor/*'
44+
-name '*.json'
45+
-type f
46+
-exec jsonlint --quiet {} ;

.github/workflows/linting-php.yml

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

.github/workflows/markdown.yml

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
---
2+
name: Markdown Quality Assistance
3+
4+
on:
5+
# This event occurs when there is activity on a pull request. The workflow
6+
# will be run against the commits, after merge to the target branch (main).
7+
pull_request:
8+
branches: [ main ]
9+
paths:
10+
- '**.md'
11+
- '.github/workflows/markdown.yml'
12+
types: [ opened, reopened, synchronize ]
13+
# This event occurs when there is a push to the repository.
14+
push:
15+
paths:
16+
- '**.md'
17+
- '.github/workflows/markdown.yml'
18+
# Allow manually triggering the workflow.
19+
workflow_dispatch:
20+
21+
# Cancels all previous workflow runs for the same branch that have not yet completed.
22+
concurrency:
23+
group: ${{ github.workflow }}-${{ github.ref }}
24+
cancel-in-progress: true
25+
26+
permissions:
27+
# Needed to allow the "concurrency" section to cancel a workflow run.
28+
actions: write
29+
30+
jobs:
31+
# 01.quality.markdown.lint-syntax.yml
32+
lint-markdown-syntax:
33+
name: Markdown Linting
34+
runs-on: ubuntu-24.04
35+
steps:
36+
- uses: actions/checkout@v4
37+
- uses: docker://pipelinecomponents/remark-lint
38+
with:
39+
args: >-
40+
remark
41+
--rc-path=.config/.remarkrc
42+
--ignore-pattern='*/vendor/*'

.github/workflows/php-version-sniff.yml

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

.github/workflows/php.yml

Lines changed: 136 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,136 @@
1+
---
2+
name: PHP Quality Assistance
3+
4+
on:
5+
# This event occurs when there is activity on a pull request. The workflow
6+
# will be run against the commits, after merge to the target branch (main).
7+
pull_request:
8+
paths:
9+
- '**.php'
10+
- '.config/phpcs.xml.dist'
11+
- '.config/phpunit.xml.dist'
12+
- '.github/workflows/php.yml'
13+
- 'composer.json'
14+
- 'composer.lock'
15+
branches: [ main ]
16+
types: [ opened, reopened, synchronize ]
17+
# This event occurs when there is a push to the repository.
18+
push:
19+
paths:
20+
- '**.php'
21+
- '.config/phpcs.xml.dist'
22+
- '.config/phpunit.xml.dist'
23+
- '.github/workflows/php.yml'
24+
- 'composer.json'
25+
- 'composer.lock'
26+
# Allow manually triggering the workflow.
27+
workflow_dispatch:
28+
29+
30+
# Cancels all previous workflow runs for the same branch that have not yet completed.
31+
concurrency:
32+
group: ${{ github.workflow }}-${{ github.ref }}
33+
cancel-in-progress: true
34+
35+
permissions:
36+
# Needed to allow the "concurrency" section to cancel a workflow run.
37+
actions: write
38+
39+
jobs:
40+
# 01.preflight.php.lint-syntax.yml
41+
lint-php-syntax:
42+
name: PHP Syntax Linting
43+
runs-on: ubuntu-24.04
44+
steps:
45+
- uses: actions/checkout@v4
46+
- uses: docker://pipelinecomponents/php-linter
47+
with:
48+
args: >-
49+
parallel-lint
50+
--exclude .git
51+
--exclude vendor
52+
--no-progress
53+
.
54+
# 01.quality.php.validate.dependencies-file.yml
55+
validate-dependencies-file:
56+
name: Validate dependencies file
57+
runs-on: ubuntu-24.04
58+
steps:
59+
- uses: actions/checkout@v4
60+
- run: >-
61+
composer validate
62+
--check-lock
63+
--no-plugins
64+
--no-scripts
65+
--strict
66+
# 02.test.php.test-unit.yml
67+
php-unittest:
68+
name: PHP Unit Tests
69+
needs:
70+
- lint-php-syntax
71+
- validate-dependencies-file
72+
runs-on: ubuntu-24.04
73+
strategy:
74+
fail-fast: false
75+
matrix:
76+
php:
77+
- '8.0' # from 2020-11 to 2022-11 (2023-11)
78+
- '8.1' # from 2021-11 to 2023-11 (2025-12)
79+
- '8.2' # from 2022-12 to 2024-12 (2026-12)
80+
- '8.3' # from 2023-11 to 2025-12 (2027-12)
81+
steps:
82+
- uses: actions/checkout@v4
83+
- uses: shivammathur/setup-php@v2
84+
with:
85+
coverage: xdebug
86+
ini-values: error_reporting=E_ALL, display_errors=On
87+
php-version: ${{ matrix.php }}
88+
- name: Install and Cache Composer dependencies
89+
uses: "ramsey/composer-install@v2"
90+
env:
91+
COMPOSER_AUTH: '{"github-oauth": {"github.com": "${{ secrets.GITHUB_TOKEN }}"}}'
92+
- run: bin/phpunit --configuration .config/phpunit.xml.dist
93+
# 03.quality.php.scan.dependencies-vulnerabilities.yml
94+
scan-dependencies-vulnerabilities:
95+
name: Scan Dependencies Vulnerabilities
96+
needs:
97+
- validate-dependencies-file
98+
runs-on: ubuntu-24.04
99+
steps:
100+
- uses: actions/checkout@v4
101+
- name: Install and Cache Composer dependencies
102+
uses: "ramsey/composer-install@v2"
103+
env:
104+
COMPOSER_AUTH: '{"github-oauth": {"github.com": "${{ secrets.GITHUB_TOKEN }}"}}'
105+
- run: >-
106+
composer audit
107+
--abandoned=report
108+
--no-dev
109+
--no-plugins
110+
--no-scripts
111+
# 03.quality.php.lint-version-compatibility.yml
112+
php-check-version-compatibility:
113+
name: PHP Version Compatibility
114+
needs:
115+
- lint-php-syntax
116+
runs-on: ubuntu-24.04
117+
strategy:
118+
fail-fast: false
119+
matrix:
120+
php:
121+
- '8.0' # from 2020-11 to 2022-11 (2023-11)
122+
- '8.1' # from 2021-11 to 2023-11 (2025-12)
123+
- '8.2' # from 2022-12 to 2024-12 (2026-12)
124+
- '8.3' # from 2023-11 to 2025-12 (2027-12)
125+
steps:
126+
- uses: actions/checkout@v4
127+
- uses: docker://pipelinecomponents/php-codesniffer
128+
with:
129+
args: >-
130+
phpcs
131+
-s
132+
--extensions=php
133+
--ignore='*vendor/*'
134+
--runtime-set testVersion ${{ matrix.php }}
135+
--standard=PHPCompatibility
136+
.

.github/workflows/tests.yml

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

0 commit comments

Comments
 (0)