From e105ab7b919634ff007a1a553bd9fcd4743ddcb6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C5=82=20Pysiak?= Date: Wed, 8 Jan 2025 12:12:20 +0100 Subject: [PATCH 1/4] Add php 8.4 --- .github/workflows/sylius-php.yml | 6 +- php/testdata/php8.4_amd64.yaml | 118 +++++++++++++++++++++++++++++++ php/testdata/php8.4_arm64.yaml | 118 +++++++++++++++++++++++++++++++ 3 files changed, 239 insertions(+), 3 deletions(-) create mode 100644 php/testdata/php8.4_amd64.yaml create mode 100644 php/testdata/php8.4_arm64.yaml diff --git a/.github/workflows/sylius-php.yml b/.github/workflows/sylius-php.yml index 246d73d..7550d82 100644 --- a/.github/workflows/sylius-php.yml +++ b/.github/workflows/sylius-php.yml @@ -25,7 +25,7 @@ jobs: strategy: fail-fast: false matrix: - php: [ "7.3", "7.4", "8.0", "8.1", "8.2", "8.3" ] + php: [ "7.3", "7.4", "8.0", "8.1", "8.2", "8.3", "8.4" ] distro: [ "alpine" ] steps: @@ -164,7 +164,7 @@ jobs: strategy: fail-fast: false matrix: - php: [ "7.3", "7.4", "8.0", "8.1", "8.2", "8.3" ] + php: [ "7.3", "7.4", "8.0", "8.1", "8.2", "8.3", "8.4" ] distro: [ "alpine" ] steps: @@ -250,7 +250,7 @@ jobs: strategy: fail-fast: false matrix: - php: [ "7.3", "7.4", "8.0", "8.1", "8.2", "8.3" ] + php: [ "7.3", "7.4", "8.0", "8.1", "8.2", "8.3", "8.4" ] version: [ "alpine", "xdebug-alpine" ] steps: diff --git a/php/testdata/php8.4_amd64.yaml b/php/testdata/php8.4_amd64.yaml new file mode 100644 index 0000000..3116af8 --- /dev/null +++ b/php/testdata/php8.4_amd64.yaml @@ -0,0 +1,118 @@ +schemaVersion: "1.0.0" +fileExistenceTests: + - name: php-fpm executable + path: '/usr/local/sbin/php-fpm' + shouldExist: true + - name: php executable + path: '/usr/local/bin/php' + shouldExist: true + - name: 'Composer 755' + path: '/usr/bin/composer' + shouldExist: true + permissions: '-rwxr-xr-x' + - name: 'PHP Entry point 775' + path: '/usr/local/bin/docker-php-entrypoint' + shouldExist: true + permissions: '-rwxrwxr-x' +commandTests: + - name: arch + command: [ "uname", "-m" ] + expectedOutput: [ "x86_64" ] + - name: php-fpm version + command: [ "/usr/local/sbin/php-fpm", "--version" ] + expectedOutput: [ "PHP 8.4" ] + - name: php-fpm-modules + command: [ "/usr/local/sbin/php-fpm", "-m" ] + expectedOutput: + - 'apcu' + - 'cgi-fcgi' + - 'Core' + - 'ctype' + - 'curl' + - 'date' + - 'dom' + - 'exif' + - 'fileinfo' + - 'filter' + - 'gd' + - 'hash' + - 'iconv' + - 'intl' + - 'json' + - 'libxml' + - 'mbstring' + - 'mysqlnd' + - 'openssl' + - 'pcre' + - 'PDO' + - 'pdo_mysql' + - 'Phar' + - 'posix' + - 'readline' + - 'Reflection' + - 'session' + - 'SimpleXML' + - 'sodium' + - 'SPL' + - 'standard' + - 'tokenizer' + - 'xml' + - 'xmlreader' + - 'xmlwriter' + - 'Zend OPcache' + - 'zip' + - 'zlib' + - name: php-cli version + command: [ "/usr/local/bin/php", "--version" ] + expectedOutput: [ "PHP 8.4" ] + - name: config-files + command: [ "/usr/local/bin/php", "--ini" ] + expectedOutput: + - '/usr/local/etc/php/conf.d/docker-php-ext-apcu.ini' + - '/usr/local/etc/php/conf.d/docker-php-ext-exif.ini' + - '/usr/local/etc/php/conf.d/docker-php-ext-gd.ini' + - '/usr/local/etc/php/conf.d/docker-php-ext-intl.ini' + - '/usr/local/etc/php/conf.d/docker-php-ext-opcache.ini' + - '/usr/local/etc/php/conf.d/docker-php-ext-pdo_mysql.ini' + - '/usr/local/etc/php/conf.d/docker-php-ext-sodium.ini' + - '/usr/local/etc/php/conf.d/docker-php-ext-zip.ini' + - name: php-cli extensions + command: [ "/usr/local/bin/php", "-m" ] + expectedOutput: + - 'apcu' + - 'Core' + - 'ctype' + - 'curl' + - 'date' + - 'dom' + - 'exif' + - 'fileinfo' + - 'filter' + - 'gd' + - 'hash' + - 'iconv' + - 'intl' + - 'json' + - 'libxml' + - 'mbstring' + - 'mysqlnd' + - 'openssl' + - 'pcre' + - 'PDO' + - 'pdo_mysql' + - 'Phar' + - 'posix' + - 'readline' + - 'Reflection' + - 'session' + - 'SimpleXML' + - 'sodium' + - 'SPL' + - 'standard' + - 'tokenizer' + - 'xml' + - 'xmlreader' + - 'xmlwriter' + - 'Zend OPcache' + - 'zip' + - 'zlib' diff --git a/php/testdata/php8.4_arm64.yaml b/php/testdata/php8.4_arm64.yaml new file mode 100644 index 0000000..f987716 --- /dev/null +++ b/php/testdata/php8.4_arm64.yaml @@ -0,0 +1,118 @@ +schemaVersion: "1.0.0" +fileExistenceTests: + - name: php-fpm executable + path: '/usr/local/sbin/php-fpm' + shouldExist: true + - name: php executable + path: '/usr/local/bin/php' + shouldExist: true + - name: 'Composer 755' + path: '/usr/bin/composer' + shouldExist: true + permissions: '-rwxr-xr-x' + - name: 'PHP Entry point 775' + path: '/usr/local/bin/docker-php-entrypoint' + shouldExist: true + permissions: '-rwxrwxr-x' +commandTests: + - name: arch + command: [ "uname", "-m" ] + expectedOutput: [ "aarch64" ] + - name: php-fpm version + command: [ "/usr/local/sbin/php-fpm", "--version" ] + expectedOutput: [ "PHP 8.4" ] + - name: php-fpm-modules + command: [ "/usr/local/sbin/php-fpm", "-m" ] + expectedOutput: + - 'apcu' + - 'cgi-fcgi' + - 'Core' + - 'ctype' + - 'curl' + - 'date' + - 'dom' + - 'exif' + - 'fileinfo' + - 'filter' + - 'gd' + - 'hash' + - 'iconv' + - 'intl' + - 'json' + - 'libxml' + - 'mbstring' + - 'mysqlnd' + - 'openssl' + - 'pcre' + - 'PDO' + - 'pdo_mysql' + - 'Phar' + - 'posix' + - 'readline' + - 'Reflection' + - 'session' + - 'SimpleXML' + - 'sodium' + - 'SPL' + - 'standard' + - 'tokenizer' + - 'xml' + - 'xmlreader' + - 'xmlwriter' + - 'Zend OPcache' + - 'zip' + - 'zlib' + - name: php-cli version + command: [ "/usr/local/bin/php", "--version" ] + expectedOutput: [ "PHP 8.4" ] + - name: config-files + command: [ "/usr/local/bin/php", "--ini" ] + expectedOutput: + - '/usr/local/etc/php/conf.d/docker-php-ext-apcu.ini' + - '/usr/local/etc/php/conf.d/docker-php-ext-exif.ini' + - '/usr/local/etc/php/conf.d/docker-php-ext-gd.ini' + - '/usr/local/etc/php/conf.d/docker-php-ext-intl.ini' + - '/usr/local/etc/php/conf.d/docker-php-ext-opcache.ini' + - '/usr/local/etc/php/conf.d/docker-php-ext-pdo_mysql.ini' + - '/usr/local/etc/php/conf.d/docker-php-ext-sodium.ini' + - '/usr/local/etc/php/conf.d/docker-php-ext-zip.ini' + - name: php-cli extensions + command: [ "/usr/local/bin/php", "-m" ] + expectedOutput: + - 'apcu' + - 'Core' + - 'ctype' + - 'curl' + - 'date' + - 'dom' + - 'exif' + - 'fileinfo' + - 'filter' + - 'gd' + - 'hash' + - 'iconv' + - 'intl' + - 'json' + - 'libxml' + - 'mbstring' + - 'mysqlnd' + - 'openssl' + - 'pcre' + - 'PDO' + - 'pdo_mysql' + - 'Phar' + - 'posix' + - 'readline' + - 'Reflection' + - 'session' + - 'SimpleXML' + - 'sodium' + - 'SPL' + - 'standard' + - 'tokenizer' + - 'xml' + - 'xmlreader' + - 'xmlwriter' + - 'Zend OPcache' + - 'zip' + - 'zlib' From ad48cce03342a449b2e4c2b81c01828d7709b183 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C5=82=20Pysiak?= Date: Wed, 8 Jan 2025 12:21:06 +0100 Subject: [PATCH 2/4] fix build --- .github/workflows/hadolint.yaml | 3 ++- WORKSPACE | 3 +-- php/BUILD | 6 +++--- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/.github/workflows/hadolint.yaml b/.github/workflows/hadolint.yaml index b3d5987..241c073 100644 --- a/.github/workflows/hadolint.yaml +++ b/.github/workflows/hadolint.yaml @@ -14,4 +14,5 @@ jobs: - uses: hadolint/hadolint-action@v3.1.0 with: dockerfile: Dockerfile - failure-threshold: warning + failure-threshold: error + recursive: true diff --git a/WORKSPACE b/WORKSPACE index 7a2ce48..fd9f8f9 100644 --- a/WORKSPACE +++ b/WORKSPACE @@ -1,7 +1,6 @@ workspace(name = "sylius-php") -load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive") -load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_file") +load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive", "http_file") http_archive( name = "io_bazel_rules_docker", diff --git a/php/BUILD b/php/BUILD index 34495b4..62ce14d 100644 --- a/php/BUILD +++ b/php/BUILD @@ -1,10 +1,10 @@ -package(default_visibility = ["//visibility:public"]) - -load("@io_bazel_rules_docker//contrib:test.bzl", "container_test") load("@io_bazel_rules_docker//container:import.bzl", "container_import") +load("@io_bazel_rules_docker//contrib:test.bzl", "container_test") load(":php-arch.bzl", "ARCHITECTURES") load(":php-version.bzl", "PHP_VERSION") +package(default_visibility = ["//visibility:public"]) + [ container_test( name = "php" + PHP_VERSION + "_" + arch + "_test", From 9eeb2615ff6814f805d1df303a1f72cea58e74d2 Mon Sep 17 00:00:00 2001 From: Piotr Kardasz Date: Sun, 19 Jan 2025 21:23:09 +0100 Subject: [PATCH 3/4] Bump APCU_VERSION to version 5.1.24 to allow successful build for PHP 8.4 --- php/Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/php/Dockerfile b/php/Dockerfile index feffdf4..1bbae1c 100644 --- a/php/Dockerfile +++ b/php/Dockerfile @@ -1,5 +1,5 @@ ARG PHP_SHORT_VERSION=7.4 -ARG APCU_VERSION=5.1.21 +ARG APCU_VERSION=5.1.24 FROM php:${PHP_SHORT_VERSION}-fpm-alpine From 76d49e6e5972872ae8e1c61e1bafa74efecbf282 Mon Sep 17 00:00:00 2001 From: Piotr Kardasz Date: Sun, 19 Jan 2025 21:25:22 +0100 Subject: [PATCH 4/4] Fix Bazel tests As of the PHP 8.4 release, the chmod of the /usr/local/bin/docker-php-entrypoint file has been changed to 755. --- php/testdata/php8.1_amd64.yaml | 4 ++-- php/testdata/php8.1_arm64.yaml | 4 ++-- php/testdata/php8.2_amd64.yaml | 4 ++-- php/testdata/php8.2_arm64.yaml | 4 ++-- php/testdata/php8.3_amd64.yaml | 4 ++-- php/testdata/php8.3_arm64.yaml | 4 ++-- php/testdata/php8.4_amd64.yaml | 4 ++-- php/testdata/php8.4_arm64.yaml | 4 ++-- 8 files changed, 16 insertions(+), 16 deletions(-) diff --git a/php/testdata/php8.1_amd64.yaml b/php/testdata/php8.1_amd64.yaml index fd55c19..9e3faeb 100644 --- a/php/testdata/php8.1_amd64.yaml +++ b/php/testdata/php8.1_amd64.yaml @@ -10,10 +10,10 @@ fileExistenceTests: path: '/usr/bin/composer' shouldExist: true permissions: '-rwxr-xr-x' - - name: 'PHP Entry point 775' + - name: 'PHP Entry point 755' path: '/usr/local/bin/docker-php-entrypoint' shouldExist: true - permissions: '-rwxrwxr-x' + permissions: '-rwxr-xr-x' commandTests: - name: arch command: [ "uname", "-m" ] diff --git a/php/testdata/php8.1_arm64.yaml b/php/testdata/php8.1_arm64.yaml index e9f48ab..99fda77 100644 --- a/php/testdata/php8.1_arm64.yaml +++ b/php/testdata/php8.1_arm64.yaml @@ -10,10 +10,10 @@ fileExistenceTests: path: '/usr/bin/composer' shouldExist: true permissions: '-rwxr-xr-x' - - name: 'PHP Entry point 775' + - name: 'PHP Entry point 755' path: '/usr/local/bin/docker-php-entrypoint' shouldExist: true - permissions: '-rwxrwxr-x' + permissions: '-rwxr-xr-x' commandTests: - name: arch command: [ "uname", "-m" ] diff --git a/php/testdata/php8.2_amd64.yaml b/php/testdata/php8.2_amd64.yaml index 4d21319..3e96462 100644 --- a/php/testdata/php8.2_amd64.yaml +++ b/php/testdata/php8.2_amd64.yaml @@ -10,10 +10,10 @@ fileExistenceTests: path: '/usr/bin/composer' shouldExist: true permissions: '-rwxr-xr-x' - - name: 'PHP Entry point 775' + - name: 'PHP Entry point 755' path: '/usr/local/bin/docker-php-entrypoint' shouldExist: true - permissions: '-rwxrwxr-x' + permissions: '-rwxr-xr-x' commandTests: - name: arch command: [ "uname", "-m" ] diff --git a/php/testdata/php8.2_arm64.yaml b/php/testdata/php8.2_arm64.yaml index d99db36..0eb7a34 100644 --- a/php/testdata/php8.2_arm64.yaml +++ b/php/testdata/php8.2_arm64.yaml @@ -10,10 +10,10 @@ fileExistenceTests: path: '/usr/bin/composer' shouldExist: true permissions: '-rwxr-xr-x' - - name: 'PHP Entry point 775' + - name: 'PHP Entry point 755' path: '/usr/local/bin/docker-php-entrypoint' shouldExist: true - permissions: '-rwxrwxr-x' + permissions: '-rwxr-xr-x' commandTests: - name: arch command: [ "uname", "-m" ] diff --git a/php/testdata/php8.3_amd64.yaml b/php/testdata/php8.3_amd64.yaml index 585db84..123f20d 100644 --- a/php/testdata/php8.3_amd64.yaml +++ b/php/testdata/php8.3_amd64.yaml @@ -10,10 +10,10 @@ fileExistenceTests: path: '/usr/bin/composer' shouldExist: true permissions: '-rwxr-xr-x' - - name: 'PHP Entry point 775' + - name: 'PHP Entry point 755' path: '/usr/local/bin/docker-php-entrypoint' shouldExist: true - permissions: '-rwxrwxr-x' + permissions: '-rwxr-xr-x' commandTests: - name: arch command: [ "uname", "-m" ] diff --git a/php/testdata/php8.3_arm64.yaml b/php/testdata/php8.3_arm64.yaml index 21a5e94..ef4091e 100644 --- a/php/testdata/php8.3_arm64.yaml +++ b/php/testdata/php8.3_arm64.yaml @@ -10,10 +10,10 @@ fileExistenceTests: path: '/usr/bin/composer' shouldExist: true permissions: '-rwxr-xr-x' - - name: 'PHP Entry point 775' + - name: 'PHP Entry point 755' path: '/usr/local/bin/docker-php-entrypoint' shouldExist: true - permissions: '-rwxrwxr-x' + permissions: '-rwxr-xr-x' commandTests: - name: arch command: [ "uname", "-m" ] diff --git a/php/testdata/php8.4_amd64.yaml b/php/testdata/php8.4_amd64.yaml index 3116af8..e7eccb5 100644 --- a/php/testdata/php8.4_amd64.yaml +++ b/php/testdata/php8.4_amd64.yaml @@ -10,10 +10,10 @@ fileExistenceTests: path: '/usr/bin/composer' shouldExist: true permissions: '-rwxr-xr-x' - - name: 'PHP Entry point 775' + - name: 'PHP Entry point 755' path: '/usr/local/bin/docker-php-entrypoint' shouldExist: true - permissions: '-rwxrwxr-x' + permissions: '-rwxr-xr-x' commandTests: - name: arch command: [ "uname", "-m" ] diff --git a/php/testdata/php8.4_arm64.yaml b/php/testdata/php8.4_arm64.yaml index f987716..9c4b469 100644 --- a/php/testdata/php8.4_arm64.yaml +++ b/php/testdata/php8.4_arm64.yaml @@ -10,10 +10,10 @@ fileExistenceTests: path: '/usr/bin/composer' shouldExist: true permissions: '-rwxr-xr-x' - - name: 'PHP Entry point 775' + - name: 'PHP Entry point 755' path: '/usr/local/bin/docker-php-entrypoint' shouldExist: true - permissions: '-rwxrwxr-x' + permissions: '-rwxr-xr-x' commandTests: - name: arch command: [ "uname", "-m" ]