Skip to content

Commit

Permalink
Support PHP 8.2 (#43)
Browse files Browse the repository at this point in the history
  • Loading branch information
GrahamCampbell authored Feb 25, 2023
1 parent d13515e commit f2e22c6
Show file tree
Hide file tree
Showing 4 changed files with 34 additions and 10 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/static.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ jobs:

psalm:
name: Psalm
runs-on: ubuntu-20.04
runs-on: ubuntu-22.04

steps:
- name: Checkout code
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,11 @@ on:
jobs:
tests:
name: PHP ${{ matrix.php }}
runs-on: ubuntu-20.04
runs-on: ubuntu-22.04

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

steps:
- name: Checkout Code
Expand Down
16 changes: 9 additions & 7 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,15 +18,15 @@
}
},
"require": {
"php": "^7.4 || ^8.0",
"php": "^7.4.15 || ^8.0.2",
"ext-json": "*",
"ext-pcre": "*",
"symfony/polyfill-php80": "^1.17"
"symfony/polyfill-php80": "^1.26"
},
"require-dev": {
"guzzlehttp/psr7": "^2.0",
"php-http/discovery": "^1.14",
"phpunit/phpunit": "^9.5 || ^10.0",
"guzzlehttp/psr7": "^2.4.3",
"php-http/discovery": "^1.15.2",
"phpunit/phpunit": "^9.6.3 || ^10.0.12",
"psalm/phar": "5.7.6",
"psr/http-factory": "^1.0.1",
"psr/http-message": "^1.0.1",
Expand All @@ -47,12 +47,14 @@
"tests-build": [
"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.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"
],
"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.1-tests",
"docker run -it -v $(pwd):/var/www cloudevents/sdk-php:8.2-tests"
]
},
"scripts-descriptions": {
Expand Down
22 changes: 22 additions & 0 deletions hack/8.2.Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
FROM php:8.2-alpine

LABEL org.opencontainers.image.url="https://github.com/cloudevents/sdk-php/tree/main/hack/8.2.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.2" \
org.opencontainers.image.description="PHP 8.2 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"]

0 comments on commit f2e22c6

Please sign in to comment.