Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Draft PHP 8.1 min. #19879

Merged
merged 27 commits into from
Jul 10, 2023
Merged
Show file tree
Hide file tree
Changes from 8 commits
Commits
Show all changes
27 commits
Select commit Hold shift + click to select a range
10b02a8
Draft `PHP 8.0`.
terabytesoftw Jul 4, 2023
7353d3f
Raise PHP version `8.1`.
terabytesoftw Jul 5, 2023
65d513e
Fix workflow again.
terabytesoftw Jul 5, 2023
6d6ea0b
Fix tests ci-oracle.yml.
terabytesoftw Jul 5, 2023
835e584
Update workflows, `backupGlobals` phpunit `true`, update `composer.lo…
terabytesoftw Jul 5, 2023
c55e66b
Add `dms/phpunit-arraysubset-asserts` for support `assertArraySubset(…
terabytesoftw Jul 5, 2023
c7b9776
More fixed tests.
terabytesoftw Jul 5, 2023
16bfe3f
Separate workflow node and build.
terabytesoftw Jul 5, 2023
aa9d1f0
Fix `ci-node.yml`, `.appveyor.yml`, `.scrutinizer.yml`.
terabytesoftw Jul 5, 2023
4763a4a
Update `.appveyor.yml`.
terabytesoftw Jul 5, 2023
aad740a
Add `apc` tests.
terabytesoftw Jul 5, 2023
10f28a8
Add `--verbose` phpunit test.
terabytesoftw Jul 5, 2023
55d9f85
Fix `apc` caching tests.
terabytesoftw Jul 5, 2023
bb3fa7c
Fix tests again.
terabytesoftw Jul 5, 2023
7551799
Fix `apc` caching tests.
terabytesoftw Jul 5, 2023
a291e10
Remove `Object::class` deprecated.
terabytesoftw Jul 5, 2023
082d5bc
Remove conditional php version.
terabytesoftw Jul 5, 2023
3da77ac
Test build-node with Jquery `3.6.*@stable`.
terabytesoftw Jul 5, 2023
31f6223
Update workflow ci-node.yml.
terabytesoftw Jul 6, 2023
baaa899
Add `mssql` to code coverage.
terabytesoftw Jul 6, 2023
10198f2
No cancel jobs in `refs/heads/master`.
terabytesoftw Jul 6, 2023
7fb7dfb
Apply fixed review.
terabytesoftw Jul 7, 2023
a9157e8
Remove install php in `ci-node.yml`.
terabytesoftw Jul 7, 2023
c9fc0b7
Update workflows.
terabytesoftw Jul 10, 2023
8ddee28
Merge branch '2.2' into draft-php-80-min
terabytesoftw Jul 10, 2023
cbcc070
Remove unnecesary files.
terabytesoftw Jul 10, 2023
43e0fa8
use ExpectExceptionMessageMatches.
terabytesoftw Jul 10, 2023
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
98 changes: 28 additions & 70 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,7 @@ on: [push, pull_request]

env:
DEFAULT_COMPOSER_FLAGS: "--prefer-dist --no-interaction --no-progress --optimize-autoloader --ansi"
PHPUNIT_EXCLUDE_GROUP: mssql,oci,wincache,xcache,zenddata,cubrid
XDEBUG_MODE: coverage, develop
PHPUNIT_EXCLUDE_GROUP: db,wincache,xcache,zenddata

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
Expand All @@ -14,89 +13,48 @@ concurrency:
jobs:
phpunit:
name: PHP ${{ matrix.php }} on ${{ matrix.os }}

runs-on: ${{ matrix.os }}
services:
mysql:
image: mysql:5.7
env:
MYSQL_ROOT_PASSWORD: root
MYSQL_DATABASE: yiitest
ports:
- 3306:3306
options: --health-cmd="mysqladmin ping" --health-interval=10s --health-timeout=5s --health-retries=3
postgres:
image: postgres:9.6
env:
POSTGRES_USER: postgres
POSTGRES_PASSWORD: postgres
POSTGRES_DB: yiitest
ports:
- 5432:5432
options: --name=postgres --health-cmd="pg_isready" --health-interval=10s --health-timeout=5s --health-retries=3

strategy:
fail-fast: false
matrix:
os: [ubuntu-latest]
php: [5.4, 5.5, 5.6, 7.0, 7.1, 7.2, 7.3, 7.4, 8.0, 8.1, 8.2]
php: [8.1, 8.2]

steps:
- name: Generate french locale
- name: Generate french locale.
run: sudo locale-gen fr_FR.UTF-8
- name: Checkout

- name: Checkout.
uses: actions/checkout@v3
- name: Install PHP

- name: Install PHP.
uses: shivammathur/setup-php@v2
with:
coverage: pcov
extensions: apc, curl, dom, imagick, intl, mbstring, mcrypt, memcached, pdo, pdo_sqlite, sqlite
ini-values: date.timezone='UTC', session.save_path="${{ runner.temp }}"
php-version: ${{ matrix.php }}
tools: pecl
extensions: apc, curl, dom, imagick, intl, mbstring, mcrypt, memcached, mysql, pdo, pdo_mysql, pdo_pgsql, pdo_sqlite, pgsql, sqlite
ini-values: date.timezone='UTC', session.save_path="${{ runner.temp }}"
- name: Install Memcached

- name: Install Memcached.
uses: niden/actions-memcached@v7
- name: Get composer cache directory
id: composer-cache
run: echo "dir=$(composer config cache-files-dir)" >> $GITHUB_OUTPUT
- name: Cache composer dependencies
uses: actions/cache@v3
with:
path: ${{ steps.composer-cache.outputs.dir }}
key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.lock') }}
restore-keys: ${{ runner.os }}-composer-
- name: Install dependencies

- name: Install dependencies.
run: composer update $DEFAULT_COMPOSER_FLAGS
- name: PHP Unit tests
run: vendor/bin/phpunit --verbose --exclude-group $PHPUNIT_EXCLUDE_GROUP --colors=always

npm:
name: NPM 6 on ubuntu-latest
runs-on: ubuntu-latest
- name: Run tests with phpunit and generate coverage.
if: matrix.php == '8.1'
run: vendor/bin/phpunit --coverage-clover=coverage.xml --exclude-group $PHPUNIT_EXCLUDE_GROUP --colors=always

steps:
- name: Checkout
uses: actions/checkout@v3
- name: Install PHP
uses: shivammathur/setup-php@v2
with:
php-version: 7.2
ini-values: session.save_path=${{ runner.temp }}
- name: Get composer cache directory
id: composer-cache
run: echo "dir=$(composer config cache-files-dir)" >> $GITHUB_OUTPUT
- name: Cache composer dependencies
uses: actions/cache@v3
with:
path: ${{ steps.composer-cache.outputs.dir }}
key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.lock') }}
restore-keys: ${{ runner.os }}-composer-
- name: Install dependencies
run: composer update $DEFAULT_COMPOSER_FLAGS
- name: Install node.js
uses: actions/setup-node@v1
- name: Run tests with phpunit.
if: matrix.php != '8.1'
run: vendor/bin/phpunit --exclude-group $PHPUNIT_EXCLUDE_GROUP --colors=always


- name: Upload coverage to Codecov.
if: matrix.os == 'ubuntu-latest' && matrix.php == '8.1'
uses: codecov/codecov-action@v3
with:
node-version: 6
- name: Tests
run: |
npm install
npm test
# env:
# CI: true
file: ./coverage.xml
90 changes: 31 additions & 59 deletions .github/workflows/ci-mssql.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,37 +12,23 @@ jobs:
name: PHP ${{ matrix.php }}-mssql-${{ matrix.mssql }}

env:
key: cache
EXTENSIONS: pdo, pdo_sqlsrv-5.10.1

runs-on: ubuntu-latest

strategy:
matrix:
include:
- php: 7.0
extensions: pdo, pdo_sqlsrv-5.8.1
mssql: server:2017-latest
- php: 7.1
extensions: pdo, pdo_sqlsrv-5.8.1
mssql: server:2017-latest
- php: 7.2
extensions: pdo, pdo_sqlsrv-5.8.1
mssql: server:2017-latest
- php: 7.3
extensions: pdo, pdo_sqlsrv-5.8.1
mssql: server:2017-latest
- php: 7.4
extensions: pdo, pdo_sqlsrv
mssql: server:2017-latest
- php: 7.4
extensions: pdo, pdo_sqlsrv
mssql: server:2019-latest
- php: 8.0
extensions: pdo, pdo_sqlsrv
mssql: server:2017-latest
- php: 8.0
extensions: pdo, pdo_sqlsrv
mssql: server:2019-latest
matrix:
os:
- ubuntu-latest

php:
- 8.1
- 8.2

mssql:
- server:2017-latest
- server:2019-latest
- server:2022-latest

services:
mssql:
Expand All @@ -56,51 +42,37 @@ jobs:
options: --name=mssql --health-cmd="/opt/mssql-tools/bin/sqlcmd -S localhost -U SA -P 'YourStrong!Passw0rd' -Q 'SELECT 1'" --health-interval=10s --health-timeout=5s --health-retries=3

steps:
- name: Checkout
- name: Checkout.
uses: actions/checkout@v3

- name: Create MS SQL Database
- name: Create MS SQL Database.
run: docker exec -i mssql /opt/mssql-tools/bin/sqlcmd -S localhost -U SA -P 'YourStrong!Passw0rd' -Q 'CREATE DATABASE yiitest'

- name: Install PHP with extensions
- name: Install PHP with extensions.
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php }}
extensions: ${{ matrix.extensions }}
coverage: pcov
extensions: ${{ env.EXTENSIONS }}
ini-values: date.timezone='UTC'
php-version: ${{ matrix.php }}
tools: composer:v2, pecl

- name: Determine composer cache directory on Linux
run: echo "COMPOSER_CACHE_DIR=$(composer config cache-dir)" >> $GITHUB_ENV

- name: Cache dependencies installed with composer
uses: actions/cache@v3
with:
path: ${{ env.COMPOSER_CACHE_DIR }}
key: php${{ matrix.php }}-composer-${{ hashFiles('**/composer.json') }}
restore-keys: |
php${{ matrix.php }}-composer-

- name: Update composer
- name: Update composer.
run: composer self-update

- name: Install dependencies with composer
- name: Install dependencies with composer.
run: composer update --prefer-dist --no-interaction --no-progress --optimize-autoloader --ansi

- name: Install dependencies with composer php 8.0
if: matrix.php == '8.0'
run: composer update --ignore-platform-reqs --prefer-dist --no-interaction --no-progress --optimize-autoloader --ansi
- name: Run Mssql tests with phpunit and generate coverage.
if: matrix.php == '8.1'
run: vendor/bin/phpunit --group mssql --coverage-clover=coverage.xml --colors=always

- name: PHP Unit tests for PHP 7.1
run: vendor/bin/phpunit --coverage-clover=coverage.clover --group mssql --colors=always
if: matrix.php == '7.1'

- name: Run tests with phpunit without coverage
- name: Run Mssql tests with phpunit.
if: matrix.php != '8.1'
run: vendor/bin/phpunit --group mssql --colors=always

- name: Code coverage
run: |
wget https://scrutinizer-ci.com/ocular.phar
php ocular.phar code-coverage:upload --format=php-clover coverage.clover
if: matrix.php == '7.1'
continue-on-error: true # if is fork
- name: Upload coverage to Codecov.
if: matrix.php == '8.1'
uses: codecov/codecov-action@v3
with:
file: ./coverage.xml
69 changes: 28 additions & 41 deletions .github/workflows/ci-mysql.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,9 @@ concurrency:

jobs:
tests:
name: PHP ${{ matrix.php-version }}-mysql-${{ matrix.mysql-version }}
name: PHP ${{ matrix.php }}-mysql-${{ matrix.mysql }}
env:
extensions: curl, intl, pdo, pdo_mysql
key: cache-v1
EXTENSIONS: curl, intl, pdo, pdo_mysql

runs-on: ${{ matrix.os }}

Expand All @@ -21,15 +20,17 @@ jobs:
os:
- ubuntu-latest

php-version:
- 7.4
php:
- 8.1
- 8.2

mysql-version:
mysql:
- 5.7
- latest

services:
mysql:
image: mysql:${{ matrix.mysql-version }}
image: mysql:${{ matrix.mysql }}
env:
MYSQL_ROOT_PASSWORD: root
MYSQL_DATABASE: yiitest
Expand All @@ -38,46 +39,32 @@ jobs:
options: --health-cmd="mysqladmin ping" --health-interval=10s --health-timeout=5s --health-retries=3

steps:
- name: Checkout
- name: Checkout.
uses: actions/checkout@v3

- name: Setup cache environment
id: cache-env
uses: shivammathur/cache-extensions@v1
with:
php-version: ${{ matrix.php-version }}
extensions: ${{ env.extensions }}
key: ${{ env.key }}

- name: Cache extensions
uses: actions/cache@v3
with:
path: ${{ steps.cache-env.outputs.dir }}
key: ${{ steps.cache-env.outputs.key }}
restore-keys: ${{ steps.cache-env.outputs.key }}

- name: Install PHP with extensions
- name: Install PHP with extensions.
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php-version }}
extensions: ${{ env.extensions }}
ini-values: date.timezone='UTC'
coverage: pcov
extensions: ${{ env.EXTENSIONS }}
ini-values: date.timezone='UTC'
php-version: ${{ matrix.php }}
tools: composer:v2, pecl

- name: Determine composer cache directory
if: matrix.os == 'ubuntu-latest'
run: echo "COMPOSER_CACHE_DIR=$(composer config cache-dir)" >> $GITHUB_ENV

- name: Cache dependencies installed with composer
uses: actions/cache@v1
with:
path: ${{ env.COMPOSER_CACHE_DIR }}
key: php${{ matrix.php-version }}-composer-${{ matrix.dependencies }}-${{ hashFiles('**/composer.json') }}
restore-keys: |
php${{ matrix.php-version }}-composer-${{ matrix.dependencies }}-

- name: Install dependencies with composer
- name: Install dependencies with composer.
run: composer update --prefer-dist --no-interaction --no-progress --optimize-autoloader --ansi

- name: Run mysql tests with phpunit
- name: Run Mysql tests with phpunit and generate coverage.
if: matrix.php == '8.1'
run: vendor/bin/phpunit --group mysql --coverage-clover=coverage.xml --colors=always

- name: Run Mysql tests with phpunit.
if: matrix.php != '8.1'
run: vendor/bin/phpunit --group mysql --colors=always

- name: Upload coverage to Codecov.
if: matrix.php == '8.1'
uses: codecov/codecov-action@v3
with:
file: ./coverage.xml

40 changes: 40 additions & 0 deletions .github/workflows/ci-node.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
name: node-build

on: [push, pull_request]

env:
DEFAULT_COMPOSER_FLAGS: "--prefer-dist --no-interaction --no-progress --optimize-autoloader --ansi"
PHPUNIT_EXCLUDE_GROUP: db,wincache,xcache,zenddata

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

jobs:
test:
name: NPM 6 on ubuntu-latest

runs-on: ubuntu-latest

steps:
- name: Checkout.
uses: actions/checkout@v3

- name: Install PHP.
terabytesoftw marked this conversation as resolved.
Show resolved Hide resolved
uses: shivammathur/setup-php@v2
with:
php-version: 8.1
ini-values: session.save_path=${{ runner.temp }}

- name: Install dependencies.
run: composer update $DEFAULT_COMPOSER_FLAGS

- name: Install node.js.
uses: actions/setup-node@v1
with:
node-version: 6

- name: Tests.
run: |
npm install
npm test
Loading