Skip to content

Commit c788eeb

Browse files
PHP 8.3 support (#52)
* PHP 8.3 support Signed-off-by: Graham Campbell <[email protected]> * Reverted bad phpunit config file change Signed-off-by: Graham Campbell <[email protected]> --------- Signed-off-by: Graham Campbell <[email protected]>
1 parent 1d8c77e commit c788eeb

File tree

5 files changed

+37
-14
lines changed

5 files changed

+37
-14
lines changed

.github/workflows/static.yml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -8,11 +8,11 @@ on:
88
jobs:
99
codesniffer:
1010
name: PHP CodeSniffer
11-
runs-on: ubuntu-20.04
11+
runs-on: ubuntu-22.04
1212

1313
steps:
1414
- name: Checkout code
15-
uses: actions/checkout@v2
15+
uses: actions/checkout@v4
1616

1717
- name: Setup PHP
1818
uses: shivammathur/setup-php@v2
@@ -24,7 +24,7 @@ jobs:
2424
update: true
2525

2626
- name: Install Dependencies
27-
uses: nick-invision/retry@v1
27+
uses: nick-invision/retry@v2
2828
with:
2929
timeout_minutes: 5
3030
max_attempts: 5
@@ -39,7 +39,7 @@ jobs:
3939

4040
steps:
4141
- name: Checkout code
42-
uses: actions/checkout@v2
42+
uses: actions/checkout@v4
4343

4444
- name: Setup PHP
4545
uses: shivammathur/setup-php@v2
@@ -51,7 +51,7 @@ jobs:
5151
update: true
5252

5353
- name: Install Dependencies
54-
uses: nick-invision/retry@v1
54+
uses: nick-invision/retry@v2
5555
with:
5656
timeout_minutes: 5
5757
max_attempts: 5

.github/workflows/tests.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,11 +12,11 @@ jobs:
1212

1313
strategy:
1414
matrix:
15-
php: ['7.4', '8.0', '8.1', '8.2']
15+
php: ['7.4', '8.0', '8.1', '8.2', '8.3']
1616

1717
steps:
1818
- name: Checkout Code
19-
uses: actions/checkout@v2
19+
uses: actions/checkout@v3
2020

2121
- name: Setup PHP
2222
uses: shivammathur/setup-php@v2
@@ -31,7 +31,7 @@ jobs:
3131
run: echo "::add-matcher::${{ runner.tool_cache }}/phpunit.json"
3232

3333
- name: Install Dependencies
34-
uses: nick-invision/retry@v1
34+
uses: nick-invision/retry@v2
3535
with:
3636
timeout_minutes: 5
3737
max_attempts: 5

composer.json

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -48,13 +48,15 @@
4848
"DOCKER_BUILDKIT=1 docker build -t cloudevents/sdk-php:7.4-tests -f hack/7.4.Dockerfile hack",
4949
"DOCKER_BUILDKIT=1 docker build -t cloudevents/sdk-php:8.0-tests -f hack/8.0.Dockerfile hack",
5050
"DOCKER_BUILDKIT=1 docker build -t cloudevents/sdk-php:8.1-tests -f hack/8.1.Dockerfile hack",
51-
"DOCKER_BUILDKIT=1 docker build -t cloudevents/sdk-php:8.2-tests -f hack/8.1.Dockerfile hack"
51+
"DOCKER_BUILDKIT=1 docker build -t cloudevents/sdk-php:8.2-tests -f hack/8.1.Dockerfile hack",
52+
"DOCKER_BUILDKIT=1 docker build -t cloudevents/sdk-php:8.3-tests -f hack/8.1.Dockerfile hack"
5253
],
5354
"tests-docker": [
5455
"docker run -it -v $(pwd):/var/www cloudevents/sdk-php:7.4-tests --coverage-html=coverage",
5556
"docker run -it -v $(pwd):/var/www cloudevents/sdk-php:8.0-tests",
5657
"docker run -it -v $(pwd):/var/www cloudevents/sdk-php:8.1-tests",
57-
"docker run -it -v $(pwd):/var/www cloudevents/sdk-php:8.2-tests"
58+
"docker run -it -v $(pwd):/var/www cloudevents/sdk-php:8.2-tests",
59+
"docker run -it -v $(pwd):/var/www cloudevents/sdk-php:8.3-tests"
5860
]
5961
},
6062
"scripts-descriptions": {

hack/8.3.Dockerfile

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
FROM php:8.3-rc-alpine
2+
3+
LABEL org.opencontainers.image.url="https://github.com/cloudevents/sdk-php/tree/main/hack/8.3.Dockerfile" \
4+
org.opencontainers.image.documentation="https://github.com/cloudevents/sdk-php/tree/main/hack/README.md" \
5+
org.opencontainers.image.source="https://github.com/cloudevents/sdk-php" \
6+
org.opencontainers.image.vendor="CloudEvent" \
7+
org.opencontainers.image.title="PHP 8.3" \
8+
org.opencontainers.image.description="PHP 8.3 test environment for cloudevents/sdk-php"
9+
10+
COPY --chown=www-data:www-data install-composer /usr/local/bin/install-composer
11+
RUN chmod +x /usr/local/bin/install-composer \
12+
&& /usr/local/bin/install-composer \
13+
&& rm /usr/local/bin/install-composer
14+
15+
RUN apk update \
16+
&& apk --no-cache upgrade \
17+
&& apk add --no-cache bash ca-certificates git libzip-dev \
18+
&& rm -rf /var/www/html /tmp/pear \
19+
&& chown -R www-data:www-data /var/www
20+
21+
WORKDIR /var/www
22+
ENTRYPOINT ["/var/www/vendor/bin/phpunit"]

phpunit.xml.dist

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,13 @@
11
<?xml version="1.0" encoding="UTF-8"?>
2-
<phpunit xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="https://schema.phpunit.de/10.1/phpunit.xsd" beStrictAboutOutputDuringTests="true" bootstrap="vendor/autoload.php" executionOrder="depends,defects" failOnRisky="true" failOnWarning="true">
2+
<phpunit xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="https://schema.phpunit.de/10.0/phpunit.xsd" beStrictAboutOutputDuringTests="true" bootstrap="vendor/autoload.php" executionOrder="depends,defects" failOnRisky="true" failOnWarning="true">
33
<testsuites>
44
<testsuite name="Unit Test Suite">
55
<directory suffix="Test.php">tests/Unit</directory>
66
</testsuite>
77
</testsuites>
8-
<coverage/>
9-
<source>
8+
<coverage>
109
<include>
1110
<directory suffix=".php">src</directory>
1211
</include>
13-
</source>
12+
</coverage>
1413
</phpunit>

0 commit comments

Comments
 (0)