Skip to content

Commit

Permalink
Raised minimum PHP version to 8.1 (#19879)
Browse files Browse the repository at this point in the history
  • Loading branch information
terabytesoftw authored Jul 10, 2023
1 parent b9e5a87 commit 2e37b5c
Show file tree
Hide file tree
Showing 226 changed files with 2,359 additions and 2,120 deletions.
6 changes: 3 additions & 3 deletions .appveyor.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ clone_folder: C:\projects\yii2

environment:
matrix:
- php_ver: 7.2.4
- php_ver: 8.1.20

cache:
- '%APPDATA%\Composer'
Expand All @@ -30,12 +30,12 @@ install:
- echo extension=php_mbstring.dll >> php.ini
- echo extension=php_openssl.dll >> php.ini
- echo extension=php_pdo_sqlite.dll >> php.ini
- IF NOT EXIST C:\tools\composer.phar (cd C:\tools && appveyor DownloadFile https://getcomposer.org/download/1.4.1/composer.phar)
- IF NOT EXIST C:\tools\composer.phar (cd C:\tools && appveyor DownloadFile https://getcomposer.org/download/2.5.8/composer.phar)

before_test:
- cd C:\projects\yii2
- php C:\tools\composer.phar update --no-interaction --no-progress --prefer-stable --no-ansi

test_script:
- cd C:\projects\yii2
- vendor\bin\phpunit --exclude-group mssql,mysql,pgsql,sqlite,db,oci,wincache,xcache,zenddata,cubrid
- vendor\bin\phpunit --exclude-group db,wincache,xcache,zenddata
68 changes: 11 additions & 57 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ on: [push, pull_request]

env:
DEFAULT_COMPOSER_FLAGS: "--prefer-dist --no-interaction --no-progress --optimize-autoloader --ansi"
EXTENSIONS: apcu, curl, dom, imagick, intl, mbstring, mcrypt, memcached, pdo, pdo_sqlite, sqlite
PHPUNIT_EXCLUDE_GROUP: db,wincache,xcache,zenddata
XDEBUG_MODE: coverage, develop

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
Expand All @@ -20,51 +20,8 @@ jobs:
strategy:
fail-fast: false
matrix:
include:
- php: 5.4
coverage: none
extensions: apc, curl, dom, imagick, intl, mbstring, mcrypt, memcached
os: ubuntu-latest
- php: 5.5
coverage: none
extensions: apc, curl, dom, imagick, intl, mbstring, mcrypt, memcached
os: ubuntu-latest
- php: 5.6
coverage: none
extensions: apc, curl, dom, imagick, intl, mbstring, mcrypt, memcached
os: ubuntu-latest
- php: 7.0
coverage: none
extensions: apc, curl, dom, imagick, intl, mbstring, mcrypt, memcached
os: ubuntu-latest
- php: 7.1
coverage: none
extensions: apc, curl, dom, imagick, intl, mbstring, mcrypt, memcached
os: ubuntu-latest
- php: 7.2
coverage: none
extensions: apc, curl, dom, imagick, intl, mbstring, mcrypt, memcached
os: ubuntu-latest
- php: 7.3
coverage: none
extensions: apc, curl, dom, imagick, intl, mbstring, mcrypt, memcached
os: ubuntu-latest
- php: 7.4
coverage: xdebug
extensions: apc, curl, dom, imagick, intl, mbstring, mcrypt, memcached
os: ubuntu-latest
- php: 8.0
coverage: none
extensions: apcu, curl, dom, imagick, intl, mbstring, mcrypt, memcached
os: ubuntu-latest
- php: 8.1
coverage: none
extensions: apcu, curl, dom, imagick, intl, mbstring, mcrypt, memcached
os: ubuntu-latest
- php: 8.2
extensions: apcu, curl, dom, imagick, intl, mbstring, mcrypt, memcached
coverage: none
os: ubuntu-latest
os: [ubuntu-latest]
php: [8.1, 8.2]

steps:
- name: Generate french locale.
Expand All @@ -76,8 +33,8 @@ jobs:
- name: Install PHP.
uses: shivammathur/setup-php@v2
with:
coverage: ${{ matrix.coverage }}
extensions: ${{ matrix.extensions }}
coverage: pcov
extensions: ${{ env.EXTENSIONS }}
ini-values: apc.enabled=1,apc.shm_size=32M,apc.enable_cli=1, date.timezone='UTC', session.save_path="${{ runner.temp }}"
php-version: ${{ matrix.php }}
tools: pecl
Expand All @@ -88,20 +45,17 @@ jobs:
- name: Install dependencies.
run: composer update $DEFAULT_COMPOSER_FLAGS

- name: Run tests with PHPUnit.
if: matrix.php < '7.4' || matrix.php >= '8.1'
run: vendor/bin/phpunit --verbose --exclude-group $PHPUNIT_EXCLUDE_GROUP --colors=always
- 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 --verbose

- name: Run tests with PHPUnit.
if: matrix.php == '8.0'
run: vendor/bin/phpunit --verbose --exclude-group $PHPUNIT_EXCLUDE_GROUP --colors=always
if: matrix.php != '8.1'
run: vendor/bin/phpunit --exclude-group $PHPUNIT_EXCLUDE_GROUP --colors=always --verbose

- name: Run tests with PHPUnit and generate coverage.
if: matrix.php == '7.4'
run: vendor/bin/phpunit --verbose --exclude-group $PHPUNIT_EXCLUDE_GROUP --coverage-clover=coverage.xml --colors=always

- name: Upload coverage to Codecov.
if: matrix.php == '7.4'
if: matrix.php == '8.1'
uses: codecov/codecov-action@v3
with:
file: ./coverage.xml
43 changes: 22 additions & 21 deletions .github/workflows/ci-mssql.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,22 +13,23 @@ jobs:
name: PHP ${{ matrix.php }}-mssql-${{ matrix.mssql }}

env:
EXTENSIONS: pdo, pdo_sqlsrv
XDEBUG_MODE: coverage, develop
EXTENSIONS: pdo, pdo_sqlsrv-5.10.1

runs-on: ubuntu-latest

strategy:
matrix:
include:
- php: 7.4
mssql: server:2017-latest
- php: 8.0
mssql: server:2019-latest
- php: 8.1
mssql: server:2019-latest
- php: 8.2
mssql: server:2022-latest
matrix:
os:
- ubuntu-latest

php:
- 8.1
- 8.2

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

services:
mssql:
Expand All @@ -42,37 +43,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:
coverage: xdebug
coverage: pcov
extensions: ${{ env.EXTENSIONS }}
ini-values: date.timezone='UTC'
php-version: ${{ matrix.php }}
tools: composer:v2, pecl

- 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: Run MSSQL tests with PHPUnit and generate coverage.
if: matrix.php == '7.4'
if: matrix.php == '8.1'
run: vendor/bin/phpunit --group mssql --coverage-clover=coverage.xml --colors=always

- name: Run MSSQL tests with PHPUnit.
if: matrix.php > '7.4'
if: matrix.php != '8.1'
run: vendor/bin/phpunit --group mssql --colors=always

- name: Upload coverage to Codecov.
if: matrix.php == '7.4'
if: matrix.php == '8.1'
uses: codecov/codecov-action@v3
with:
file: ./coverage.xml
14 changes: 6 additions & 8 deletions .github/workflows/ci-mysql.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,7 @@ jobs:
tests:
name: PHP ${{ matrix.php }}-mysql-${{ matrix.mysql }}
env:
extensions: curl, intl, pdo, pdo_mysql
XDEBUG_MODE: coverage, develop
EXTENSIONS: curl, intl, pdo, pdo_mysql

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

Expand All @@ -23,8 +22,6 @@ jobs:
- ubuntu-latest

php:
- 7.4
- 8.0
- 8.1
- 8.2

Expand All @@ -49,7 +46,7 @@ jobs:
- name: Install PHP with extensions.
uses: shivammathur/setup-php@v2
with:
coverage: xdebug
coverage: pcov
extensions: ${{ env.EXTENSIONS }}
ini-values: date.timezone='UTC'
php-version: ${{ matrix.php }}
Expand All @@ -59,15 +56,16 @@ jobs:
run: composer update --prefer-dist --no-interaction --no-progress --optimize-autoloader --ansi

- name: Run MySQL tests with PHPUnit and generate coverage.
if: matrix.php == '7.4'
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 > '7.4'
if: matrix.php != '8.1'
run: vendor/bin/phpunit --group mysql --colors=always

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

23 changes: 11 additions & 12 deletions .github/workflows/ci-oracle.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,10 @@ concurrency:

jobs:
tests:
name: PHP ${{ matrix.php }}-${{ matrix.os }}
name: PHP ${{ matrix.php }}-oracle-11g-r2

env:
extensions: oci8, pdo, pdo_oci
XDEBUG_MODE: coverage, develop
EXTENSIONS: oci8, pdo, pdo_oci

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

Expand All @@ -24,14 +23,17 @@ jobs:
- ubuntu-latest

php:
- 7.4
- 8.1

oracle:
- 11

services:
oci:
image: wnameless/oracle-xe-11g-r2:latest
ports:
- 1521:1521
options: --name=oci
image: wnameless/oracle-xe-11g-r2:latest
ports:
- 1521:1521
options: --name=oci

steps:
- name: Checkout.
Expand All @@ -40,15 +42,12 @@ jobs:
- name: Install PHP with extensions.
uses: shivammathur/setup-php@v2
with:
coverage: xdebug
coverage: pcov
extensions: ${{ env.EXTENSIONS }}
ini-values: date.timezone='UTC'
php-version: ${{ matrix.php }}
tools: composer:v2, pecl

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

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

Expand Down
21 changes: 8 additions & 13 deletions .github/workflows/ci-pgsql.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,7 @@ jobs:
tests:
name: PHP ${{ matrix.php }}-pgsql-${{ matrix.pgsql }}
env:
extensions: curl, intl, pdo, pdo_pgsql
XDEBUG_MODE: coverage, develop
EXTENSIONS: curl, intl, pdo, pdo_pgsql

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

Expand All @@ -23,9 +22,8 @@ jobs:
- ubuntu-latest

php:
- 7.4
- 8.0
- 8.1
- 8.2

pgsql:
- 10
Expand All @@ -50,31 +48,28 @@ jobs:
- name: Checkout.
uses: actions/checkout@v3

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

- 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: Run Pgsql tests with PHPUnit and generate coverage.
if: matrix.php == '7.4'
if: matrix.php == '8.1'
run: vendor/bin/phpunit --group pgsql --coverage-clover=coverage.xml --colors=always

- name: Run Pgsql tests with PHPUnit.
if: matrix.php > '7.4'
if: matrix.php != '8.1'
run: vendor/bin/phpunit --group pgsql --colors=always

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

0 comments on commit 2e37b5c

Please sign in to comment.