Skip to content

Commit 9d747a9

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

File tree

11 files changed

+294
-87
lines changed

11 files changed

+294
-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: 134 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,134 @@
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+
# 01.quality.php.validate.dependencies-file.yml
50+
validate-dependencies-file:
51+
name: Validate dependencies file
52+
runs-on: ubuntu-24.04
53+
steps:
54+
- uses: actions/checkout@v4
55+
- uses: docker://composer
56+
with:
57+
args: >-
58+
composer validate
59+
--check-lock
60+
--no-plugins
61+
--no-scripts
62+
--strict
63+
# 02.test.php.test-unit.yml
64+
php-unittest:
65+
continue-on-error: ${{ matrix.php < '8.1' || matrix.php > '8.4' }}
66+
name: PHP Unit Tests
67+
needs:
68+
- lint-php-syntax
69+
- validate-dependencies-file
70+
runs-on: ubuntu-24.04
71+
strategy:
72+
matrix:
73+
php:
74+
- 8.0 # from 2020-11 to 2022-11 (2023-11)
75+
- 8.1 # from 2021-11 to 2023-11 (2025-12)
76+
- 8.2 # from 2022-12 to 2024-12 (2026-12)
77+
- 8.3 # from 2023-11 to 2025-12 (2027-12)
78+
- 8.4 # from 2024-11 to 2026-12 (2028-12)
79+
- 8.5 # from 2025-11 to 2027-12 (2029-12)
80+
steps:
81+
- uses: actions/checkout@v4
82+
- uses: shivammathur/setup-php@v2
83+
with:
84+
coverage: xdebug
85+
ini-values: error_reporting=E_ALL, display_errors=On
86+
php-version: ${{ matrix.php }}
87+
- name: Install and Cache Composer dependencies
88+
uses: "ramsey/composer-install@v2"
89+
env:
90+
COMPOSER_AUTH: '{"github-oauth": {"github.com": "${{ secrets.GITHUB_TOKEN }}"}}'
91+
- run: bin/phpunit --configuration .config/phpunit.xml.dist
92+
# 03.quality.php.scan.dependencies-vulnerabilities.yml
93+
scan-dependencies-vulnerabilities:
94+
name: Scan Dependencies Vulnerabilities
95+
needs:
96+
- validate-dependencies-file
97+
runs-on: ubuntu-24.04
98+
steps:
99+
- uses: actions/checkout@v4
100+
- uses: docker://composer
101+
with:
102+
args: >-
103+
composer audit
104+
--abandoned=report
105+
--locked
106+
--no-dev
107+
--no-plugins
108+
--no-scripts
109+
# 03.quality.php.lint-version-compatibility.yml
110+
php-check-version-compatibility:
111+
continue-on-error: ${{ matrix.php < '8.1' || matrix.php > '8.4' }}
112+
name: PHP Version Compatibility
113+
needs:
114+
- lint-php-syntax
115+
runs-on: ubuntu-24.04
116+
strategy:
117+
matrix:
118+
php:
119+
- 8.0 # from 2020-11 to 2022-11 (2023-11)
120+
- 8.1 # from 2021-11 to 2023-11 (2025-12)
121+
- 8.2 # from 2022-12 to 2024-12 (2026-12)
122+
- 8.3 # from 2023-11 to 2025-12 (2027-12)
123+
- 8.4 # from 2024-11 to 2026-12 (2028-12)
124+
- 8.5 # from 2025-11 to 2027-12 (2029-12)
125+
steps:
126+
- uses: actions/checkout@v4
127+
- uses: docker://pipelinecomponents/php-codesniffer
128+
with:
129+
options: >-
130+
-s
131+
--extensions=php
132+
--ignore='*vendor/*'
133+
--runtime-set testVersion ${{ matrix.php }}
134+
--standard=PHPCompatibility

.github/workflows/tests.yml

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

.github/workflows/yaml.yml

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

0 commit comments

Comments
 (0)