From 9999b78dd6bc707c71f536aca4b4440a8b8dde11 Mon Sep 17 00:00:00 2001 From: Graham Campbell Date: Thu, 12 Oct 2023 17:49:54 +0100 Subject: [PATCH 1/2] PHP 8.3 support Signed-off-by: Graham Campbell --- .github/workflows/static.yml | 10 +++++----- .github/workflows/tests.yml | 6 +++--- composer.json | 6 ++++-- hack/8.3.Dockerfile | 22 ++++++++++++++++++++++ 4 files changed, 34 insertions(+), 10 deletions(-) create mode 100644 hack/8.3.Dockerfile diff --git a/.github/workflows/static.yml b/.github/workflows/static.yml index cb5e2d0..4f22379 100644 --- a/.github/workflows/static.yml +++ b/.github/workflows/static.yml @@ -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 @@ -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 @@ -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 @@ -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 diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 38b1a4e..5e2e15f 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -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 @@ -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 diff --git a/composer.json b/composer.json index dbcd84b..a417955 100644 --- a/composer.json +++ b/composer.json @@ -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": { diff --git a/hack/8.3.Dockerfile b/hack/8.3.Dockerfile new file mode 100644 index 0000000..f32111f --- /dev/null +++ b/hack/8.3.Dockerfile @@ -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"] From 127991bf9c1f20faff78c5c4083e7392b401601d Mon Sep 17 00:00:00 2001 From: Graham Campbell Date: Thu, 12 Oct 2023 17:54:43 +0100 Subject: [PATCH 2/2] Reverted bad phpunit config file change Signed-off-by: Graham Campbell --- phpunit.xml.dist | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/phpunit.xml.dist b/phpunit.xml.dist index 0f08581..39df3df 100644 --- a/phpunit.xml.dist +++ b/phpunit.xml.dist @@ -1,14 +1,13 @@ - + tests/Unit - - + src - +