Skip to content

Commit cec0cd1

Browse files
committed
feat: add support for php 8.3
Signed-off-by: Emilien Escalle <[email protected]>
1 parent 95c09b1 commit cec0cd1

22 files changed

+386
-209
lines changed

.dockerignore

+8-5
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,10 @@
11
.git/
22
nbproject/
3-
vendor/
4-
build/
5-
.phpdoc/
6-
**/*.cache
7-
**/composer.lock
3+
vendor
4+
tools/vendor
5+
**/composer.lock
6+
**/tests/.phpunit.result.cache
7+
**/build/
8+
# From tools/cache/.gitignore
9+
tools/cache/**/*
10+
!tools/cache/**/.gitignore

.github/dependabot.yml

+12-2
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,25 @@
11
version: 2
22
updates:
33
- package-ecosystem: composer
4-
versioning-strategy: widen
5-
directory: "/"
4+
versioning-strategy: increase
5+
directories:
6+
- "/"
7+
- "/tools"
68
schedule:
79
interval: weekly
810
day: friday
911
time: "04:00"
12+
groups:
13+
dev-dependencies:
14+
dependency-type: development
15+
1016
- package-ecosystem: github-actions
1117
directory: "/"
1218
schedule:
1319
interval: weekly
1420
day: friday
1521
time: "04:00"
22+
groups:
23+
github-actions-dependencies:
24+
patterns:
25+
- "*"

.github/workflows/__shared-ci.yml

+77
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,77 @@
1+
name: Shared - Continuous Integration for common tasks
2+
3+
on:
4+
workflow_call:
5+
6+
jobs:
7+
checks:
8+
strategy:
9+
matrix:
10+
include:
11+
- php-versions: "8.1"
12+
- php-versions: "8.2"
13+
- php-versions: "8.3"
14+
stable: true
15+
16+
runs-on: ubuntu-latest
17+
steps:
18+
- name: Checkout
19+
uses: actions/checkout@v4
20+
21+
- name: ⚙️ Setup PHP, with composer and extensions
22+
uses: shivammathur/setup-php@v2
23+
with:
24+
php-version: ${{ matrix.php-versions }}
25+
extensions: none,iconv,dom,curl,mbstring,tokenizer,xml,xmlwriter,simplexml,ctype
26+
coverage: pcov
27+
28+
- name: ♻️ Get composer cache directory
29+
id: composer-cache
30+
shell: bash
31+
run: echo "dir=$(composer config cache-files-dir)" >> "$GITHUB_OUTPUT"
32+
33+
- name: ♻️ Cache composer dependencies
34+
uses: actions/cache@v4
35+
with:
36+
path: ${{ steps.composer-cache.outputs.dir }}
37+
key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.json') }}
38+
restore-keys: ${{ runner.os }}-composer-
39+
40+
- name: ⚙️ Install dependencies
41+
shell: bash
42+
run: |
43+
composer install --no-progress --prefer-dist --optimize-autoloader
44+
composer --working-dir=tools install --no-progress --prefer-dist --optimize-autoloader
45+
46+
- name: ♻️ Tools cache
47+
uses: actions/cache@v4
48+
with:
49+
path: tools/cache
50+
key: ${{ runner.os }}-tools-${{ github.sha }}
51+
restore-keys: |
52+
${{ runner.os }}-tools-
53+
54+
- name: 👕 Lint
55+
if: matrix.stable
56+
run: composer php-cs-fixer -- --format=checkstyle | tools/vendor/bin/cs2pr
57+
58+
- name: 🔬 Static analysis
59+
if: matrix.stable
60+
run: composer stan -- --error-format=checkstyle | tools/vendor/bin/cs2pr
61+
62+
- name: ♻️ Tests cache
63+
uses: actions/cache@v4
64+
with:
65+
path: tests/.phpunit.result.cache
66+
key: ${{ runner.os }}-tests-${{ github.sha }}
67+
restore-keys: |
68+
${{ runner.os }}-tests-
69+
70+
- name: 🧪 Test
71+
run: composer test:ci
72+
73+
- name: 📊 Upload coverage results to Codecov
74+
if: matrix.stable
75+
uses: codecov/codecov-action@v5
76+
with:
77+
files: ./build/logs/clover.xml

.github/workflows/continuous-integration.yml

-62
This file was deleted.

.github/workflows/main-ci.yml

+110
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,110 @@
1+
name: Main - Continuous Integration
2+
3+
concurrency:
4+
group: ${{ github.workflow }}-${{ github.ref }}
5+
cancel-in-progress: true
6+
7+
on:
8+
push:
9+
branches:
10+
- main
11+
12+
permissions:
13+
contents: read
14+
pages: write
15+
id-token: write
16+
17+
jobs:
18+
ci:
19+
name: Continuous Integration
20+
uses: ./.github/workflows/__shared-ci.yml
21+
secrets: inherit
22+
23+
docs-generate-site:
24+
runs-on: ubuntu-latest
25+
needs: ci
26+
steps:
27+
- uses: actions/checkout@v4
28+
- run: |
29+
mkdir -p ./_site
30+
31+
echo -e "theme: jekyll-theme-cayman" > ./_site/_config.yml
32+
33+
to_title_case() {
34+
echo "$1" | awk '{
35+
for (i=1; i<=NF; i++) {
36+
$i = toupper(substr($i, 1, 1)) tolower(substr($i, 2))
37+
}
38+
print
39+
}'
40+
}
41+
42+
create_site_page() {
43+
page="$1"
44+
title="$(to_title_case "$2")"
45+
content_path="$3"
46+
echo -e "---\nlayout: default\ntitle: $title\n---\n" > "$page"
47+
echo "$(sed -r s"/(\{%[^%]+%\})/{% raw %}\1{% endraw %}/g" "$content_path")" >> "$page"
48+
}
49+
50+
create_site_page "./_site/index.md" "Home" "./README.md"
51+
52+
for filepath in ./docs/*.md; do
53+
filename=$(basename -- "$filepath")
54+
section="${filename%.*}"
55+
mkdir -p "./_site/$section"
56+
create_site_page "./_site/$section/index.md" "$section" "$filepath"
57+
done
58+
59+
- uses: actions/upload-artifact@v4
60+
with:
61+
name: docs-site
62+
path: ./_site
63+
64+
docs-generate-phpdoc:
65+
runs-on: ubuntu-latest
66+
needs: ci
67+
steps:
68+
- uses: actions/checkout@v4
69+
70+
- name: 📃 Generate PHP documentation
71+
run: docker run --rm -v $(pwd):/data phpdoc/phpdoc:3 -d ./src -t ./_site/phpdoc
72+
73+
- uses: actions/upload-artifact@v4
74+
with:
75+
name: docs-phpdoc
76+
path: ./_site
77+
78+
docs-publish:
79+
name: Publish documentation
80+
needs: [docs-generate-site, docs-generate-phpdoc]
81+
runs-on: ubuntu-latest
82+
permissions:
83+
pages: write
84+
id-token: write
85+
environment:
86+
name: github-pages
87+
url: ${{ steps.deployment.outputs.page_url }}
88+
steps:
89+
90+
- uses: actions/download-artifact@v4
91+
with:
92+
pattern: 'docs-*'
93+
path: ./
94+
merge-multiple: true
95+
96+
- name: ⚙️ Setup Pages
97+
uses: actions/configure-pages@v5
98+
99+
- name: Build with Jekyll
100+
uses: actions/jekyll-build-pages@v1
101+
with:
102+
source: ./
103+
destination: ./_site
104+
105+
- name: Upload artifact
106+
uses: actions/upload-pages-artifact@v3
107+
108+
- name: 🚀 Deploy to GitHub Pages
109+
id: deployment
110+
uses: actions/deploy-pages@v4
+21
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
name: Need fix to Issue
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
workflow_dispatch:
8+
inputs:
9+
manual-commit-ref:
10+
description: "The SHA of the commit to get the diff for"
11+
required: true
12+
manual-base-ref:
13+
description: "By default, the commit entered above is compared to the one directly before it; to go back further, enter an earlier SHA here"
14+
required: false
15+
16+
jobs:
17+
main:
18+
uses: hoverkraft-tech/ci-github-common/.github/workflows/[email protected]
19+
with:
20+
manual-commit-ref: ${{ inputs.manual-commit-ref }}
21+
manual-base-ref: ${{ inputs.manual-base-ref }}

.github/workflows/publish.yml

-63
This file was deleted.

0 commit comments

Comments
 (0)