Skip to content

Commit 78682a3

Browse files
authored
Merge pull request #1 from tvdijen/feature/ssp-upgrade
Update code to be compatible with newer SSP-versions
2 parents bd61e21 + 10a2227 commit 78682a3

26 files changed

+673
-176
lines changed

.gitattributes

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
/tools/ export-ignore
2+
/tests/ export-ignore
3+
codecov.yml export-ignore
4+
.editorconfig export-ignore
5+
.gitattributes export-ignore
6+
.gitignore export-ignore
7+
phpstan.neon export-ignore
8+
phpstan-dev.neon export-ignore
9+
phpcs.xml export-ignore
10+
phpunit.xml export-ignore
11+
.github export-ignore
12+
.php_cs.dist export-ignore
13+
.markdownlintignore export-ignore
14+
.markdownlintrc export-ignore

.github/dependabot.yml

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
---
2+
3+
# To get started with Dependabot version updates, you'll need to specify which
4+
# package ecosystems to update and where the package manifests are located.
5+
# Please see the documentation for all configuration options:
6+
# https://docs.github.com/github/administering-a-repository/configuration-options-for-dependency-updates
7+
8+
version: 2
9+
updates:
10+
- package-ecosystem: "github-actions" # See documentation for possible values
11+
directory: "/" # Location of package manifests
12+
schedule:
13+
interval: "weekly"
14+
groups:
15+
all-actions:
16+
patterns: ["*"]
17+
18+
- package-ecosystem: "composer" # See documentation for possible values
19+
directory: "/" # Location of package manifests
20+
schedule:
21+
interval: "daily"
22+
groups:
23+
dev-dependencies:
24+
dependency-type: "development"
25+
update-types:
26+
- "minor"
27+
- "patch"
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
---
2+
3+
name: 'Lock Threads'
4+
5+
on: # yamllint disable-line rule:truthy
6+
schedule:
7+
- cron: '0 0 1 * *'
8+
workflow_dispatch:
9+
10+
permissions:
11+
issues: write
12+
pull-requests: write
13+
14+
concurrency:
15+
group: lock
16+
17+
jobs:
18+
action:
19+
runs-on: ubuntu-latest
20+
steps:
21+
- uses: dessant/lock-threads@v5
22+
with:
23+
issue-inactive-days: '90'
24+
pr-inactive-days: '90'
25+
log-output: true
Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
---
2+
3+
name: Documentation
4+
5+
on: # yamllint disable-line rule:truthy
6+
push:
7+
branches: [master, release-*]
8+
paths:
9+
- '**.md'
10+
pull_request:
11+
branches: [master, release-*]
12+
paths:
13+
- '**.md'
14+
workflow_dispatch:
15+
16+
jobs:
17+
quality:
18+
name: Quality checks
19+
runs-on: [ubuntu-latest]
20+
21+
steps:
22+
- uses: actions/checkout@v4
23+
24+
- name: Lint markdown files
25+
uses: nosborn/github-action-markdown-cli@v3
26+
with:
27+
files: .
28+
ignore_path: .markdownlintignore
29+
30+
- name: Perform spell check
31+
uses: codespell-project/actions-codespell@v2
32+
with:
33+
path: '**/*.md'
34+
check_filenames: true

.github/workflows/php.yml

Lines changed: 288 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,288 @@
1+
---
2+
3+
name: CI
4+
5+
on: # yamllint disable-line rule:truthy
6+
push:
7+
branches: ['**']
8+
paths-ignore:
9+
- '**.md'
10+
pull_request:
11+
branches: [master, release-*]
12+
paths-ignore:
13+
- '**.md'
14+
workflow_dispatch:
15+
16+
jobs:
17+
linter:
18+
name: Linter
19+
runs-on: ['ubuntu-latest']
20+
21+
steps:
22+
- uses: actions/checkout@v4
23+
with:
24+
# super-linter needs the full git history to get the
25+
# list of files that changed across commits
26+
fetch-depth: 0
27+
28+
- name: Lint Code Base
29+
uses: super-linter/super-linter/slim@v6
30+
env:
31+
# To report GitHub Actions status checks
32+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
33+
LINTER_RULES_PATH: 'tools/linters'
34+
LOG_LEVEL: NOTICE
35+
VALIDATE_ALL_CODEBASE: true
36+
VALIDATE_BASH: true
37+
VALIDATE_BASH_EXEC: true
38+
VALIDATE_JSON: true
39+
VALIDATE_PHP_BUILTIN: true
40+
VALIDATE_YAML: true
41+
VALIDATE_XML: true
42+
VALIDATE_GITHUB_ACTIONS: true
43+
44+
quality:
45+
name: Quality control
46+
runs-on: [ubuntu-latest]
47+
48+
steps:
49+
- name: Setup PHP, with composer and extensions
50+
id: setup-php
51+
# https://github.com/shivammathur/setup-php
52+
uses: shivammathur/setup-php@v2
53+
with:
54+
# Should be the higest supported version, so we can use the newest tools
55+
php-version: '8.3'
56+
tools: composer, composer-require-checker, composer-unused, phpcs, phpstan
57+
extensions: ctype, date, dom, filter, hash, mbstring, openssl, pcre, spl, xml
58+
coverage: none
59+
60+
- name: Setup problem matchers for PHP
61+
run: echo "::add-matcher::${{ runner.tool_cache }}/php.json"
62+
63+
- uses: actions/checkout@v4
64+
65+
- name: Get composer cache directory
66+
run: echo COMPOSER_CACHE="$(composer config cache-files-dir)" >> "$GITHUB_ENV"
67+
68+
- name: Cache composer dependencies
69+
uses: actions/cache@v4
70+
with:
71+
path: $COMPOSER_CACHE
72+
key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.lock') }}
73+
restore-keys: ${{ runner.os }}-composer-
74+
75+
- name: Validate composer.json and composer.lock
76+
run: composer validate
77+
78+
- name: Install Composer dependencies
79+
run: composer install --no-progress --prefer-dist --optimize-autoloader
80+
81+
- name: Check code for hard dependencies missing in composer.json
82+
run: composer-require-checker check composer.json
83+
84+
- name: Check code for unused dependencies in composer.json
85+
run: composer-unused
86+
87+
- name: PHP Code Sniffer
88+
run: phpcs
89+
90+
- name: PHPStan
91+
run: |
92+
phpstan analyze -c phpstan.neon
93+
94+
- name: PHPStan (testsuite)
95+
run: |
96+
phpstan analyze -c phpstan-dev.neon
97+
98+
security:
99+
name: Security checks
100+
runs-on: [ubuntu-latest]
101+
steps:
102+
- name: Setup PHP, with composer and extensions
103+
# https://github.com/shivammathur/setup-php
104+
uses: shivammathur/setup-php@v2
105+
with:
106+
# Should be the lowest supported version
107+
php-version: '8.1'
108+
extensions: ctype, date, dom, filter, hash, mbstring, openssl, pcre, spl, xml
109+
tools: composer
110+
coverage: none
111+
112+
- name: Setup problem matchers for PHP
113+
run: echo "::add-matcher::${{ runner.tool_cache }}/php.json"
114+
115+
- uses: actions/checkout@v4
116+
117+
- name: Get composer cache directory
118+
run: echo COMPOSER_CACHE="$(composer config cache-files-dir)" >> "$GITHUB_ENV"
119+
120+
- name: Cache composer dependencies
121+
uses: actions/cache@v4
122+
with:
123+
path: $COMPOSER_CACHE
124+
key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.lock') }}
125+
restore-keys: ${{ runner.os }}-composer-
126+
127+
- name: Install Composer dependencies
128+
run: composer install --no-progress --prefer-dist --optimize-autoloader
129+
130+
- name: Security check for locked dependencies
131+
run: composer audit
132+
133+
- name: Update Composer dependencies
134+
run: composer update --no-progress --prefer-dist --optimize-autoloader
135+
136+
- name: Security check for updated dependencies
137+
run: composer audit
138+
139+
unit-tests-linux:
140+
name: "Unit tests, PHP ${{ matrix.php-versions }}, ${{ matrix.operating-system }}"
141+
runs-on: ${{ matrix.operating-system }}
142+
needs: [linter, quality, security]
143+
strategy:
144+
fail-fast: false
145+
matrix:
146+
operating-system: [ubuntu-latest]
147+
php-versions: ['8.1', '8.2', '8.3']
148+
149+
steps:
150+
- name: Print OpenSSL version
151+
run: openssl version
152+
153+
- name: Setup PHP, with composer and extensions
154+
# https://github.com/shivammathur/setup-php
155+
uses: shivammathur/setup-php@v2
156+
with:
157+
php-version: ${{ matrix.php-versions }}
158+
extensions: ctype, date, dom, filter, hash, mbstring, openssl, pcre, spl, xml
159+
tools: composer
160+
ini-values: error_reporting=E_ALL
161+
coverage: pcov
162+
163+
- name: Setup problem matchers for PHP
164+
run: echo "::add-matcher::${{ runner.tool_cache }}/php.json"
165+
166+
- name: Setup problem matchers for PHPUnit
167+
run: echo "::add-matcher::${{ runner.tool_cache }}/phpunit.json"
168+
169+
- name: Set git to use LF
170+
run: |
171+
git config --global core.autocrlf false
172+
git config --global core.eol lf
173+
174+
- uses: actions/checkout@v4
175+
176+
- name: Get composer cache directory
177+
run: echo COMPOSER_CACHE="$(composer config cache-files-dir)" >> "$GITHUB_ENV"
178+
179+
- name: Cache composer dependencies
180+
uses: actions/cache@v4
181+
with:
182+
path: $COMPOSER_CACHE
183+
key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.lock') }}
184+
restore-keys: ${{ runner.os }}-composer-
185+
186+
- name: Install Composer dependencies
187+
run: composer install --no-progress --prefer-dist --optimize-autoloader
188+
189+
- name: Run unit tests with coverage
190+
if: ${{ matrix.php-versions == '8.3' }}
191+
run: vendor/bin/phpunit
192+
193+
- name: Run unit tests (no coverage)
194+
if: ${{ matrix.php-versions != '8.3' }}
195+
run: vendor/bin/phpunit --no-coverage
196+
197+
- name: Save coverage data
198+
if: ${{ matrix.php-versions == '8.3' }}
199+
uses: actions/upload-artifact@v4
200+
with:
201+
name: coverage-data
202+
path: ${{ github.workspace }}/build
203+
204+
unit-tests-windows:
205+
name: "Unit tests, PHP ${{ matrix.php-versions }}, ${{ matrix.operating-system }}"
206+
runs-on: ${{ matrix.operating-system }}
207+
needs: [linter, quality, security]
208+
strategy:
209+
fail-fast: true
210+
matrix:
211+
operating-system: [windows-latest]
212+
php-versions: ['8.1', '8.2', '8.3']
213+
214+
steps:
215+
- name: Print OpenSSL version
216+
run: openssl version
217+
218+
- name: Setup PHP, with composer and extensions
219+
# https://github.com/shivammathur/setup-php
220+
uses: shivammathur/setup-php@v2
221+
with:
222+
php-version: ${{ matrix.php-versions }}
223+
extensions: ctype, date, dom, filter, hash, mbstring, openssl, pcre, spl, xml
224+
tools: composer
225+
ini-values: error_reporting=E_ALL
226+
coverage: none
227+
228+
- name: Setup problem matchers for PHP
229+
run: echo "::add-matcher::${{ runner.tool_cache }}/php.json"
230+
231+
- name: Setup problem matchers for PHPUnit
232+
run: echo "::add-matcher::${{ runner.tool_cache }}/phpunit.json"
233+
234+
- name: Set git to use LF
235+
run: |
236+
git config --global core.autocrlf false
237+
git config --global core.eol lf
238+
239+
- uses: actions/checkout@v4
240+
241+
- name: Get composer cache directory
242+
run: echo COMPOSER_CACHE="$(composer config cache-files-dir)" >> "$env:GITHUB_ENV"
243+
244+
- name: Cache composer dependencies
245+
uses: actions/cache@v4
246+
with:
247+
path: $COMPOSER_CACHE
248+
key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.lock') }}
249+
restore-keys: ${{ runner.os }}-composer-
250+
251+
- name: Install Composer dependencies
252+
run: composer install --no-progress --prefer-dist --optimize-autoloader
253+
254+
- name: Run unit tests
255+
run: vendor/bin/phpunit --no-coverage
256+
257+
coverage:
258+
name: Code coverage
259+
runs-on: [ubuntu-latest]
260+
needs: [unit-tests-linux]
261+
steps:
262+
- uses: actions/checkout@v4
263+
264+
- uses: actions/download-artifact@v4
265+
with:
266+
name: coverage-data
267+
path: ${{ github.workspace }}/build
268+
269+
- name: Codecov
270+
uses: codecov/codecov-action@v4
271+
with:
272+
token: ${{ secrets.CODECOV_TOKEN }}
273+
fail_ci_if_error: true
274+
verbose: true
275+
276+
cleanup:
277+
name: Cleanup artifacts
278+
needs: [unit-tests-linux, coverage]
279+
runs-on: [ubuntu-latest]
280+
if: |
281+
always() &&
282+
needs.coverage.result == 'success' ||
283+
(needs.unit-tests-linux == 'success' && needs.coverage == 'skipped')
284+
285+
steps:
286+
- uses: geekyeggo/delete-artifact@v5
287+
with:
288+
name: coverage-data

0 commit comments

Comments
 (0)