Skip to content

Commit 96cd8aa

Browse files
Pothercaylebre
authored andcommitted
Add (or update) GitHub Action (GHA) files and related config.
1 parent b4437c5 commit 96cd8aa

File tree

14 files changed

+481
-58
lines changed

14 files changed

+481
-58
lines changed
File renamed without changes.
File renamed without changes.

.config/hadolint.yml

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
---
2+
# For all available rules see: https://github.com/hadolint/hadolint#rules
3+
ignored:
4+
- DL3008 # We do not want to pin versions in apt get install.
5+
- DL3018 # We do not want to pin versions in apk add
6+
7+
# For full details see https://github.com/hadolint/hadolint#configure
8+
#
9+
# The following keys are available:
10+
#
11+
# failure-threshold: string # name of threshold level (error | warning | info | style | ignore | none)
12+
# format: string # Output format (tty | json | checkstyle | codeclimate | gitlab_codeclimate | gnu | codacy)
13+
# label-schema: # See https://github.com/hadolint/hadolint#linting-labels for details
14+
# author: string # Your name
15+
# contact: string # email address
16+
# created: timestamp # rfc3339 datetime
17+
# version: string # semver
18+
# documentation: string # url
19+
# git-revision: string # hash
20+
# license: string # spdx
21+
# no-color: boolean # true | false
22+
# no-fail: boolean # true | false
23+
# override:
24+
# error: [string] # list of rules
25+
# warning: [string] # list of rules
26+
# info: [string] # list of rules
27+
# style: [string] # list of rules
28+
# strict-labels: boolean # true | false
29+
# disable-ignore-pragma: boolean # true | false
30+
# trustedRegistries: string | [string] # registry or list of registries
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
<!-- <arg name="parallel" value="75"/>-->
1616

1717
<file>.</file>
18-
<exclude-pattern>*/vendor/*|*/build/*</exclude-pattern>
18+
<exclude-pattern>*/vendor/*|*/.config/*</exclude-pattern>
1919

2020
<rule ref="PHPCompatibility"/>
2121
<config name="testVersion" value="8.0-"/>

.github/workflows/dependancy-security-check.yml

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

.github/workflows/dockerfile.yml

Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,56 @@
1+
---
2+
name: Dockerfile 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+
- '.config/hadolint.yml'
11+
- '.dockerignore'
12+
- '.github/workflows/dockerfile.yml'
13+
- 'Dockerfile'
14+
# Docker project specific, Dockerfile "COPY" and "ADD" entries.
15+
- 'solid/'
16+
- 'init-live.sh'
17+
- 'init.sh'
18+
- 'site.conf'
19+
types: [ opened, reopened, synchronize ]
20+
# This event occurs when there is a push to the repository.
21+
push:
22+
paths:
23+
- '.config/hadolint.yml'
24+
- '.dockerignore'
25+
- '.github/workflows/dockerfile.yml'
26+
- 'Dockerfile'
27+
# Docker project specific, Dockerfile "COPY" and "ADD" entries.
28+
- 'solid/'
29+
- 'init-live.sh'
30+
- 'init.sh'
31+
- 'site.conf'
32+
# Allow manually triggering the workflow.
33+
workflow_dispatch:
34+
35+
# Cancels all previous workflow runs for the same branch that have not yet completed.
36+
concurrency:
37+
group: ${{ github.workflow }}-${{ github.ref }}
38+
cancel-in-progress: true
39+
40+
permissions:
41+
# Needed to allow the "concurrency" section to cancel a workflow run.
42+
actions: write
43+
44+
jobs:
45+
# 03.quality.docker.lint.yml
46+
lint-dockerfile:
47+
name: Dockerfile Linting
48+
runs-on: ubuntu-24.04
49+
steps:
50+
- uses: actions/checkout@v4
51+
- uses: docker://pipelinecomponents/hadolint
52+
with:
53+
args: >-
54+
hadolint
55+
--config .config/hadolint.yml
56+
Dockerfile

.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/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.yml

Lines changed: 152 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,152 @@
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+
# Cancels all previous workflow runs for the same branch that have not yet completed.
30+
concurrency:
31+
group: ${{ github.workflow }}-${{ github.ref }}
32+
cancel-in-progress: true
33+
34+
permissions:
35+
# Needed to allow the "concurrency" section to cancel a workflow run.
36+
actions: write
37+
38+
jobs:
39+
# 01.preflight.php.lint-syntax.yml
40+
lint-php-syntax:
41+
name: PHP Syntax Linting
42+
runs-on: ubuntu-24.04
43+
steps:
44+
- uses: actions/checkout@v4
45+
- uses: docker://pipelinecomponents/php-linter
46+
with:
47+
args: >-
48+
parallel-lint
49+
--exclude .git
50+
--exclude vendor
51+
--no-progress
52+
.
53+
# 01.quality.php.validate.dependencies-file.yml
54+
validate-dependencies-file:
55+
name: Validate dependencies file
56+
runs-on: ubuntu-24.04
57+
steps:
58+
- uses: actions/checkout@v4
59+
- run: >-
60+
composer validate
61+
--check-lock
62+
--no-plugins
63+
--no-scripts
64+
--strict
65+
working-directory: "solid"
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+
with:
91+
working-directory: "solid"
92+
env:
93+
COMPOSER_AUTH: '{"github-oauth": {"github.com": "${{ secrets.GITHUB_TOKEN }}"}}'
94+
- run: bin/phpunit --configuration .config/phpunit.xml.dist
95+
# 03.quality.php.scan.dependencies-vulnerabilities.yml
96+
scan-dependencies-vulnerabilities:
97+
name: Scan Dependencies Vulnerabilities
98+
needs:
99+
- validate-dependencies-file
100+
runs-on: ubuntu-24.04
101+
steps:
102+
- uses: actions/checkout@v4
103+
- run: >-
104+
composer audit
105+
--abandoned=report
106+
--locked
107+
--no-dev
108+
--no-plugins
109+
--no-scripts
110+
working-directory: "solid"
111+
# 03.quality.php.lint-quality.yml
112+
php-lint-quality:
113+
needs:
114+
- lint-php-syntax
115+
runs-on: ubuntu-24.04
116+
steps:
117+
- uses: actions/checkout@v4
118+
- uses: docker://pipelinecomponents/php-codesniffer
119+
with:
120+
args: >-
121+
phpcs
122+
-s
123+
--extensions=php
124+
--ignore='*vendor/*'
125+
--standard=.config/phpcs.xml.dist
126+
.
127+
# 03.quality.php.lint-version-compatibility.yml
128+
php-check-version-compatibility:
129+
name: PHP Version Compatibility
130+
needs:
131+
- lint-php-syntax
132+
runs-on: ubuntu-24.04
133+
strategy:
134+
fail-fast: false
135+
matrix:
136+
php:
137+
- '8.0' # from 2020-11 to 2022-11 (2023-11)
138+
- '8.1' # from 2021-11 to 2023-11 (2025-12)
139+
- '8.2' # from 2022-12 to 2024-12 (2026-12)
140+
- '8.3' # from 2023-11 to 2025-12 (2027-12)
141+
steps:
142+
- uses: actions/checkout@v4
143+
- uses: docker://pipelinecomponents/php-codesniffer
144+
with:
145+
args: >-
146+
phpcs
147+
-s
148+
--extensions=php
149+
--ignore='*vendor/*'
150+
--runtime-set testVersion ${{ matrix.php }}
151+
--standard=PHPCompatibility
152+
.

0 commit comments

Comments
 (0)