Skip to content

Commit 5e7cf57

Browse files
author
Sarah Subert
committed
Merge branch 'DEV-68018_php8.2' into 'master'
DEV-68018 update php8.2 See merge request ext/zf1-future!1
2 parents bd3a401 + 6c24c82 commit 5e7cf57

1,618 files changed

Lines changed: 8372 additions & 6352 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.github/workflows/lint.yml

Lines changed: 0 additions & 59 deletions
This file was deleted.

.github/workflows/phpunit.yml

Lines changed: 183 additions & 42 deletions
Original file line numberDiff line numberDiff line change
@@ -1,53 +1,194 @@
1-
name: PHPUnit-9
1+
name: PHPUnit
22

33
on: [push, pull_request]
44

55
jobs:
6-
phpunit-php82:
7-
runs-on: ubuntu-latest
6+
phpunit:
7+
name: Tests on PHP ${{ matrix.php-version }}
8+
9+
runs-on: ubuntu-22.04
10+
11+
env:
12+
PHP_INI_VALUES: memory_limit=-1, assert.exception=1, zend.assertions=1, error_reporting=-1, log_errors_max_len=0, display_errors=On
13+
14+
TESTS_ZEND_DB_ADAPTER_PDO_MYSQL_ENABLED: true
15+
TESTS_ZEND_DB_ADAPTER_MYSQL_USERNAME: github
16+
TESTS_ZEND_DB_ADAPTER_MYSQL_PASSWORD: github
17+
TESTS_ZEND_DB_ADAPTER_MYSQL_DATABASE: zftest
18+
TESTS_ZEND_DB_ADAPTER_MYSQL_HOSTNAME: 127.0.0.1
19+
20+
TESTS_ZEND_DB_ADAPTER_PDO_PGSQL_ENABLED: true
21+
TESTS_ZEND_DB_ADAPTER_PDO_PGSQL_USERNAME: github
22+
TESTS_ZEND_DB_ADAPTER_PDO_PGSQL_PASSWORD: github
23+
TESTS_ZEND_DB_ADAPTER_PDO_PGSQL_DATABASE: zftest
24+
25+
TESTS_ZEND_CACHE_SQLITE_ENABLED: true
26+
TESTS_ZEND_DB_ADAPTER_PDO_SQLITE_ENABLED: true
27+
28+
TESTS_ZEND_CACHE_MEMCACHED_ENABLED: true
29+
TESTS_ZEND_CACHE_MEMCACHED_HOST: 127.0.0.1
30+
TESTS_ZEND_CACHE_MEMCACHED_PORT: 11211
31+
32+
TESTS_ZEND_CACHE_LIBMEMCACHED_ENABLED: true
33+
TESTS_ZEND_CACHE_LIBMEMCACHED_HOST: 127.0.0.1
34+
TESTS_ZEND_CACHE_LIBMEMCACHED_PORT: 11211
35+
36+
TESTS_ZEND_CACHE_APC_ENABLED: true
37+
38+
# https://hub.docker.com/r/bitnami/openldap
39+
LDAP_ROOT: "dc=example,dc=com"
40+
LDAP_ALLOW_ANON_BINDING: false
41+
LDAP_SKIP_DEFAULT_TREE: "yes"
42+
LDAP_ADMIN_USERNAME: "admin"
43+
LDAP_ADMIN_PASSWORD: "insecure"
44+
LDAP_CONFIG_ADMIN_USERNAME: "admin"
45+
LDAP_CONFIG_ADMIN_PASSWORD: "configpassword"
46+
TESTS_ZEND_LDAP_ONLINE_ENABLED: true
47+
TESTS_ZEND_AUTH_ADAPTER_LDAP_ONLINE_ENABLED: true
48+
49+
LOCALES: "fr_FR@euro fr_FR fr_BE.UTF-8 de en_US"
50+
OPENSSL_CONF: "./tests/openssl.conf"
51+
services:
52+
memcache:
53+
image: memcached:1.6.17-alpine
54+
ports:
55+
- 11211:11211
56+
57+
mysql:
58+
image: bitnami/mysql:8.0.31
59+
env:
60+
MYSQL_ROOT_USER: ${{ env.TESTS_ZEND_DB_ADAPTER_MYSQL_USERNAME }}
61+
MYSQL_ROOT_PASSWORD: ${{ env.TESTS_ZEND_DB_ADAPTER_MYSQL_PASSWORD }}
62+
MYSQL_DATABASE: ${{ env.TESTS_ZEND_DB_ADAPTER_MYSQL_DATABASE }}
63+
MYSQL_AUTHENTICATION_PLUGIN: mysql_native_password
64+
ports:
65+
- 3306:3306
66+
options: >-
67+
--health-cmd "mysqladmin ping"
68+
--health-interval 10s
69+
--health-timeout 5s
70+
--health-retries 10
71+
72+
postgres:
73+
image: postgres:15.1-alpine
74+
ports:
75+
- 5432:5432
76+
env:
77+
POSTGRES_USER: ${{ env.TESTS_ZEND_DB_ADAPTER_PDO_PGSQL_USERNAME }}
78+
POSTGRES_PASSWORD: ${{ env.TESTS_ZEND_DB_ADAPTER_PDO_PGSQL_PASSWORD }}
79+
POSTGRES_DB: ${{ env.TESTS_ZEND_DB_ADAPTER_PDO_PGSQL_DATABASE }}
80+
options: >-
81+
--health-cmd pg_isready
82+
--health-interval 10s
83+
--health-timeout 5s
84+
--health-retries 5
85+
86+
openldap:
87+
image: bitnami/openldap:2.5
88+
ports:
89+
- 1389:1389
90+
env:
91+
LDAP_ROOT: ${{ env.LDAP_ROOT }}
92+
LDAP_ALLOW_ANON_BINDING: ${{ env.LDAP_ALLOW_ANON_BINDING }}
93+
LDAP_SKIP_DEFAULT_TREE: ${{ env.LDAP_SKIP_DEFAULT_TREE }}
94+
LDAP_ADMIN_USERNAME: ${{ env.LDAP_ADMIN_USERNAME }}
95+
LDAP_ADMIN_PASSWORD: ${{ env.LDAP_ADMIN_PASSWORD }}
96+
LDAP_CONFIG_ADMIN_ENABLED: "yes"
97+
LDAP_CONFIG_ADMIN_USERNAME: ${{ env.LDAP_CONFIG_ADMIN_USERNAME }}
98+
LDAP_CONFIG_ADMIN_PASSWORD: ${{ env.LDAP_CONFIG_ADMIN_PASSWORD }}
99+
100+
strategy:
101+
fail-fast: false
102+
matrix:
103+
php-version:
104+
- "7.1"
105+
- "7.2"
106+
- "7.3"
107+
- "7.4"
108+
- "8.0"
109+
- "8.1"
110+
- "8.2"
111+
experimental:
112+
- false
113+
include:
114+
#bare for PHP >=7.2
115+
- php-extensions-bare: "none, iconv, json, libxml, xml, dom, simplexml, xmlwriter, tokenizer, mbstring"
116+
#full for PHP <= 8.0
117+
- php-extensions-full: "none, iconv, json, libxml, xml, dom, simplexml, xmlwriter, tokenizer, mbstring, apcu, ctype, openssl, curl, gd, posix, pdo_sqlite, pdo_mysql, fileinfo, zip, sqlite, soap, bcmath, igbinary, bz2, lzf, memcached, memcache, ldap, sqlite, mcrypt, rar"
118+
- php-version: "7.1"
119+
php-extensions-bare: "none, iconv, json, libxml, xml, dom, simplexml, xmlwriter, tokenizer"
120+
- php-version: "8.1"
121+
php-extensions-full: "none, iconv, json, libxml, xml, dom, simplexml, xmlwriter, tokenizer, mbstring, apcu, ctype, openssl, curl, gd, posix, pdo_sqlite, pdo_mysql, fileinfo, zip, sqlite, soap, bcmath, igbinary, bz2, lzf, memcached, memcache, ldap, sqlite, mcrypt"
122+
- php-version: "8.2"
123+
php-extensions-full: "none, iconv, json, libxml, xml, dom, simplexml, xmlwriter, tokenizer, mbstring, apcu, ctype, openssl, curl, gd, posix, pdo_sqlite, pdo_mysql, fileinfo, zip, sqlite, soap, bcmath, igbinary, bz2, lzf, memcached, memcache, ldap, sqlite, mcrypt"
124+
- php-version: "8.3"
125+
php-extensions-full: "none, iconv, json, libxml, xml, dom, simplexml, xmlwriter, tokenizer, mbstring, apcu, ctype, openssl, curl, gd, posix, pdo_sqlite, pdo_mysql, fileinfo, zip, sqlite, soap, bcmath, igbinary, bz2, lzf, memcached, memcache, ldap, sqlite"
126+
experimental: true
127+
8128
steps:
9129
- name: Checkout
10130
uses: actions/checkout@v3
11-
- name: Download phpunit
131+
132+
- name: Setup Locale
12133
run: |
13-
wget -O phpunit https://phar.phpunit.de/phpunit-9.5.26.phar
14-
chmod +x phpunit
15-
shell: bash
16-
- name: PHPUnit 9 on php 8.2
17-
uses: docker://php:8.2-rc-cli-alpine
18-
with:
19-
args: -d memory_limit=-1 ./phpunit --bootstrap tests/TestHelper.php tests/Zend/AllTests.php
20-
phpunit-php81:
21-
runs-on: ubuntu-latest
22-
steps:
23-
- name: Checkout
24-
uses: actions/checkout@v3
25-
- name: Prevent entrypoint issue on load docker image jakzal/phpqa:php
26-
run: mv composer.json composer.json.bk
27-
- name: PHPUnit 9 on php 8.1
28-
uses: docker://jakzal/phpqa:php8.1-alpine
134+
sudo apt-get update && sudo apt-get install tzdata locales -y && sudo locale-gen $LOCALES
135+
echo "All languages..."
136+
locale -a
137+
138+
- name: Provider config base on env for integrate test
139+
run: cp tests/TestConfiguration.env.php tests/TestConfiguration.php
140+
141+
- name: Install PHP with minimal extensions
142+
uses: shivammathur/setup-php@v2
29143
with:
30-
args: /tools/phpunit --bootstrap tests/TestHelper.php tests/Zend/AllTests.php
31-
phpunit-php80:
32-
runs-on: ubuntu-latest
33-
steps:
34-
- name: Checkout
35-
uses: actions/checkout@v3
36-
- name: Prevent entrypoint issue on load docker image jakzal/phpqa:php
37-
run: mv composer.json composer.json.bk
38-
- name: PHPUnit 9 on php 8.0
39-
uses: docker://jakzal/phpqa:php8.0-alpine
144+
php-version: ${{ matrix.php-version }}
145+
tools: cs2pr
146+
extensions: ${{ matrix.php-extensions-bare }}
147+
ini-values: ${{ env.PHP_INI_VALUES }}
148+
env:
149+
# https://github.com/shivammathur/setup-php/issues/407#issuecomment-773675741
150+
fail-fast: true
151+
152+
- name: Get composer cache directory
153+
id: composer-cache
154+
run: echo "dir=$(composer config cache-files-dir)" >> $GITHUB_OUTPUT
155+
156+
- name: Cache dependencies
157+
uses: actions/cache@v3
40158
with:
41-
args: /tools/phpunit --bootstrap tests/TestHelper.php tests/Zend/AllTests.php
42-
phpunit-php74:
43-
runs-on: ubuntu-latest
44-
steps:
45-
- name: Checkout
46-
uses: actions/checkout@v3
47-
- name: Prevent entrypoint issue on load docker image jakzal/phpqa:php
48-
run: mv composer.json composer.json.bk
49-
- name: PHPUnit 9 on php 7.4
50-
uses: docker://jakzal/phpqa:php7.4-alpine
159+
path: ${{ steps.composer-cache.outputs.dir }}
160+
key: ${{ runner.os }}-${{ matrix.php-version }}-composer-${{ hashFiles('**/composer.json') }}
161+
restore-keys: ${{ runner.os }}-${{ matrix.php-version }}-composer-
162+
163+
- name: Install dependencies
164+
run: composer install --prefer-dist --no-progress --no-interaction
165+
166+
- name: Lint PHP source files
167+
run: |
168+
bin/parallel-lint --exclude vendor --exclude tests/Zend/Loader/_files/ParseError.php . --checkstyle | cs2pr
169+
170+
- name: "Run tests on PHP ${{ matrix.php-version }} (Experimental: ${{ matrix.experimental }}) with minimal extensions"
171+
run: |
172+
bin/phpunit -c tests/phpunit.xml
173+
continue-on-error: ${{ matrix.experimental }}
174+
175+
- name: Setup LDAP
176+
run: |
177+
sudo apt-get install -y libnss-ldap libpam-ldap ldap-utils
178+
tests/resources/openldap/docker-entrypoint-initdb.d/init.sh
179+
180+
- name: Install PHP with extensions
181+
uses: shivammathur/setup-php@v2
51182
with:
52-
args: /tools/phpunit --bootstrap tests/TestHelper.php tests/Zend/AllTests.php
53-
183+
php-version: ${{ matrix.php-version }}
184+
tools: cs2pr
185+
extensions: ${{ matrix.php-extensions-full }}
186+
ini-values: ${{ env.PHP_INI_VALUES }}, apc.enable_cli=1
187+
env:
188+
# https://github.com/shivammathur/setup-php/issues/407#issuecomment-773675741
189+
fail-fast: true
190+
191+
- name: "Run tests on PHP ${{ matrix.php-version }} (Experimental: ${{ matrix.experimental }}) with extensions"
192+
run: |
193+
bin/phpunit -c tests/phpunit.xml
194+
continue-on-error: ${{ matrix.experimental }}

.gitlab-ci.yml

Lines changed: 10 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -1,28 +1,19 @@
11
include:
22
- template: Composer.gitlab-ci.yml
33

4-
build:
5-
stage: build
6-
image:
7-
name: gcr.io/kaniko-project/executor:debug
8-
entrypoint: [""]
9-
script:
10-
- mkdir -p /kaniko/.docker
11-
- echo "{\"auths\":{\"$CI_REGISTRY\":{\"username\":\"$CI_REGISTRY_USER\",\"password\":\"$CI_REGISTRY_PASSWORD\"}}}" > /kaniko/.docker/config.json
12-
- /kaniko/executor --context $CI_PROJECT_DIR --dockerfile $CI_PROJECT_DIR/Dockerfile --destination $CI_REGISTRY_IMAGE:$CI_COMMIT_SHORT_SHA --cache=true
4+
cache:
5+
paths:
6+
- vendor/
7+
- bin/
8+
- /composer
9+
- /composer-cache
1310

1411
test:
15-
image: $CI_REGISTRY_IMAGE:$CI_COMMIT_SHORT_SHA
12+
image: $CONTAINER_REGISTRY/devops/php:$PHP_VERSION
13+
parallel:
14+
matrix:
15+
- PHP_VERSION: ['8.1','8.2']
1616
stage: test
17-
needs:
18-
- build
19-
cache:
20-
key: ${CI_BUILD_REF_NAME}
21-
paths:
22-
- vendor/
23-
- bin/
24-
- /composer
25-
- /composer-cache
2617
variables:
2718
MYSQL_ROOT_PASSWORD: ''
2819
MYSQL_ALLOW_EMPTY_PASSWORD: 'yes'
@@ -35,11 +26,8 @@ test:
3526
command: ["mysqld", '--character-set-server=utf8', '--collation-server=utf8_unicode_ci']
3627
- name: memcached:1
3728
before_script:
38-
# prepare tests
3929
- composer install --no-interaction --prefer-source
4030
- cp ./tests/TestConfiguration.gitlab.php ./tests/TestConfiguration.php
41-
- echo "waiting for database is up and running ..."
42-
- until echo "SELECT 'OK';" | mysql -h mysql --user=root; do sleep 1; done;
4331
script:
4432
- composer test
4533

0 commit comments

Comments
 (0)