Skip to content

Commit

Permalink
PHP 8.3 support (#52)
Browse files Browse the repository at this point in the history
* PHP 8.3 support

Signed-off-by: Graham Campbell <hello@gjcampbell.co.uk>

* Reverted bad phpunit config file change

Signed-off-by: Graham Campbell <hello@gjcampbell.co.uk>

---------

Signed-off-by: Graham Campbell <hello@gjcampbell.co.uk>
  • Loading branch information
GrahamCampbell committed Oct 12, 2023
1 parent 1d8c77e commit c788eeb
Show file tree
Hide file tree
Showing 5 changed files with 37 additions and 14 deletions.
10 changes: 5 additions & 5 deletions .github/workflows/static.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,11 @@ on:
jobs:
codesniffer:
name: PHP CodeSniffer
runs-on: ubuntu-20.04
runs-on: ubuntu-22.04

steps:
- name: Checkout code
uses: actions/checkout@v2
uses: actions/checkout@v4

- name: Setup PHP
uses: shivammathur/setup-php@v2
Expand All @@ -24,7 +24,7 @@ jobs:
update: true

- name: Install Dependencies
uses: nick-invision/retry@v1
uses: nick-invision/retry@v2
with:
timeout_minutes: 5
max_attempts: 5
Expand All @@ -39,7 +39,7 @@ jobs:

steps:
- name: Checkout code
uses: actions/checkout@v2
uses: actions/checkout@v4

- name: Setup PHP
uses: shivammathur/setup-php@v2
Expand All @@ -51,7 +51,7 @@ jobs:
update: true

- name: Install Dependencies
uses: nick-invision/retry@v1
uses: nick-invision/retry@v2
with:
timeout_minutes: 5
max_attempts: 5
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,11 @@ jobs:

strategy:
matrix:
php: ['7.4', '8.0', '8.1', '8.2']
php: ['7.4', '8.0', '8.1', '8.2', '8.3']

steps:
- name: Checkout Code
uses: actions/checkout@v2
uses: actions/checkout@v3

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

- name: Install Dependencies
uses: nick-invision/retry@v1
uses: nick-invision/retry@v2
with:
timeout_minutes: 5
max_attempts: 5
Expand Down
6 changes: 4 additions & 2 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -48,13 +48,15 @@
"DOCKER_BUILDKIT=1 docker build -t cloudevents/sdk-php:7.4-tests -f hack/7.4.Dockerfile hack",
"DOCKER_BUILDKIT=1 docker build -t cloudevents/sdk-php:8.0-tests -f hack/8.0.Dockerfile hack",
"DOCKER_BUILDKIT=1 docker build -t cloudevents/sdk-php:8.1-tests -f hack/8.1.Dockerfile hack",
"DOCKER_BUILDKIT=1 docker build -t cloudevents/sdk-php:8.2-tests -f hack/8.1.Dockerfile hack"
"DOCKER_BUILDKIT=1 docker build -t cloudevents/sdk-php:8.2-tests -f hack/8.1.Dockerfile hack",
"DOCKER_BUILDKIT=1 docker build -t cloudevents/sdk-php:8.3-tests -f hack/8.1.Dockerfile hack"
],
"tests-docker": [
"docker run -it -v $(pwd):/var/www cloudevents/sdk-php:7.4-tests --coverage-html=coverage",
"docker run -it -v $(pwd):/var/www cloudevents/sdk-php:8.0-tests",
"docker run -it -v $(pwd):/var/www cloudevents/sdk-php:8.1-tests",
"docker run -it -v $(pwd):/var/www cloudevents/sdk-php:8.2-tests"
"docker run -it -v $(pwd):/var/www cloudevents/sdk-php:8.2-tests",
"docker run -it -v $(pwd):/var/www cloudevents/sdk-php:8.3-tests"
]
},
"scripts-descriptions": {
Expand Down
22 changes: 22 additions & 0 deletions hack/8.3.Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
FROM php:8.3-rc-alpine

LABEL org.opencontainers.image.url="https://github.com/cloudevents/sdk-php/tree/main/hack/8.3.Dockerfile" \
org.opencontainers.image.documentation="https://github.com/cloudevents/sdk-php/tree/main/hack/README.md" \
org.opencontainers.image.source="https://github.com/cloudevents/sdk-php" \
org.opencontainers.image.vendor="CloudEvent" \
org.opencontainers.image.title="PHP 8.3" \
org.opencontainers.image.description="PHP 8.3 test environment for cloudevents/sdk-php"

COPY --chown=www-data:www-data install-composer /usr/local/bin/install-composer
RUN chmod +x /usr/local/bin/install-composer \
&& /usr/local/bin/install-composer \
&& rm /usr/local/bin/install-composer

RUN apk update \
&& apk --no-cache upgrade \
&& apk add --no-cache bash ca-certificates git libzip-dev \
&& rm -rf /var/www/html /tmp/pear \
&& chown -R www-data:www-data /var/www

WORKDIR /var/www
ENTRYPOINT ["/var/www/vendor/bin/phpunit"]
7 changes: 3 additions & 4 deletions phpunit.xml.dist
Original file line number Diff line number Diff line change
@@ -1,14 +1,13 @@
<?xml version="1.0" encoding="UTF-8"?>
<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">
<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">
<testsuites>
<testsuite name="Unit Test Suite">
<directory suffix="Test.php">tests/Unit</directory>
</testsuite>
</testsuites>
<coverage/>
<source>
<coverage>
<include>
<directory suffix=".php">src</directory>
</include>
</source>
</coverage>
</phpunit>

0 comments on commit c788eeb

Please sign in to comment.