Skip to content

Commit f38355e

Browse files
committed
Add (or update) GitHub Action (GHA) files and related config.
1 parent 0c5f65b commit f38355e

File tree

11 files changed

+300
-87
lines changed

11 files changed

+300
-87
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: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
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"
@@ -30,4 +30,4 @@
3030
<text outputFile="php://stdout"/>
3131
</report>
3232
</coverage>
33-
</phpunit>
33+
</phpunit>

.github/workflows/json.yml

Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
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+
types: [ opened, reopened, synchronize ]
12+
# This event occurs when there is a push to the repository.
13+
push:
14+
paths:
15+
- '**.json'
16+
# Allow manually triggering the workflow.
17+
workflow_dispatch:
18+
19+
concurrency:
20+
group: ${{ github.workflow }}-${{ github.ref }}
21+
cancel-in-progress: true
22+
23+
permissions:
24+
# Needed to allow the "concurrency" section to cancel a workflow run.
25+
actions: write
26+
27+
jobs:
28+
# 01.preflight.json.lint-syntax.yml
29+
lint-json-syntax:
30+
name: JSON Syntax Linting
31+
runs-on: ubuntu-24.04
32+
steps:
33+
- uses: actions/checkout@v4
34+
- uses: docker://pipelinecomponents/jsonlint
35+
with:
36+
args: >-
37+
find .
38+
-not -path './.git/*'
39+
-not -path './node_modules/*'
40+
-not -path './vendor/*'
41+
-name '*.json'
42+
-type f
43+
-exec jsonlint --quiet {} ;

.github/workflows/linting-php.yml

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

.github/workflows/markdown.yml

Lines changed: 55 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,55 @@
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+
types: [ opened, reopened, synchronize ]
12+
# This event occurs when there is a push to the repository.
13+
push:
14+
paths:
15+
- '**.md'
16+
# Allow manually triggering the workflow.
17+
workflow_dispatch:
18+
19+
concurrency:
20+
group: ${{ github.workflow }}-${{ github.ref }}
21+
cancel-in-progress: true
22+
23+
permissions:
24+
# Needed to allow the "concurrency" section to cancel a workflow run.
25+
actions: write
26+
27+
jobs:
28+
# 01.quality.markdown.lint-syntax.yml
29+
lint-markdown-syntax:
30+
name: Markdown Linting
31+
runs-on: ubuntu-24.04
32+
steps:
33+
- uses: actions/checkout@v4
34+
- uses: docker://pipelinecomponents/remark-lint
35+
with:
36+
args: >-
37+
remark
38+
--rc-path=.config/.remarkrc
39+
--ignore-pattern='*/vendor/*'
40+
# 03.quality.markdown.lint-spelling.yml
41+
spellcheck-markdown:
42+
name: Markdown Spellcheck
43+
runs-on: ubuntu-24.04
44+
steps:
45+
- uses: actions/checkout@v4
46+
- uses: docker://pipelinecomponents/markdown-spellcheck
47+
with:
48+
args: >-
49+
mdspell
50+
--en-us
51+
--ignore-numbers
52+
--report
53+
'**/*.md'
54+
'!**/node_modules/**/*.md'
55+
'!**/vendor/**/*.md'

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

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

.github/workflows/php.yml

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

.github/workflows/tests.yml

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

0 commit comments

Comments
 (0)