Skip to content

Commit

Permalink
Merge branch 'master' into patch-2
Browse files Browse the repository at this point in the history
  • Loading branch information
WinterSilence authored May 30, 2024
2 parents 10d23ed + 6b1591b commit b888e41
Show file tree
Hide file tree
Showing 1,455 changed files with 16,726 additions and 10,001 deletions.
4 changes: 2 additions & 2 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: 7.3.0

cache:
- '%APPDATA%\Composer'
Expand All @@ -30,7 +30,7 @@ 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.6.3/composer.phar)

before_test:
- cd C:\projects\yii2
Expand Down
2 changes: 1 addition & 1 deletion .eslintrc
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ env:
jquery: true
node: true

# http://eslint.org/docs/rules/
# https://eslint.org/docs/latest/rules/
rules:
# Possible Errors
comma-dangle: [2, never]
Expand Down
2 changes: 1 addition & 1 deletion .gitattributes
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# Autodetect text files
* text=auto
* text=auto eol=lf

# ...Unless the name matches the following overriding patterns

Expand Down
2 changes: 1 addition & 1 deletion .github/CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,5 @@ Contributing to Yii 2

- [Report an issue](../docs/internals/report-an-issue.md)
- [Translate documentation or messages](../docs/internals/translation-workflow.md)
- [Give us feedback or start a design discussion](http://www.yiiframework.com/forum/index.php/forum/42-general-discussions-for-yii-20/)
- [Give us feedback or start a design discussion](https://www.yiiframework.com/forum/index.php/forum/42-general-discussions-for-yii-20/)
- [Contribute to the core code or fix bugs](../docs/internals/git-workflow.md)
150 changes: 62 additions & 88 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,110 +4,84 @@ 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
PHPUNIT_EXCLUDE_GROUP: db,wincache,xcache,zenddata
XDEBUG_MODE: coverage, develop

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

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
name: PHP ${{ matrix.php }}

runs-on: ubuntu-latest

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']
include:
- php: 7.3
extensions: apc, curl, dom, imagick, intl, mbstring, mcrypt, memcached
coverage: none
- php: 7.4
extensions: apc, curl, dom, imagick, intl, mbstring, mcrypt, memcached
coverage: xdebug
- php: 8.0
extensions: apcu, curl, dom, imagick, intl, mbstring, mcrypt, memcached
coverage: none
- php: 8.1
extensions: apcu, curl, dom, imagick, intl, mbstring, mcrypt, memcached
coverage: none
- php: 8.2
extensions: apcu, curl, dom, imagick, intl, mbstring, mcrypt, memcached
coverage: none
- php: 8.3
extensions: apcu, curl, dom, imagick, intl, mbstring, mcrypt, memcached
coverage: none
os: ubuntu-latest
- php: 8.4
extensions: apcu, curl, dom, imagick, intl, mbstring, mcrypt, memcached
coverage: none
os: ubuntu-latest

steps:
- name: Generate french locale
- name: Generate french locale.
run: sudo locale-gen fr_FR.UTF-8
- name: Checkout
uses: actions/checkout@v2
- name: Install PHP

- name: Checkout.
uses: actions/checkout@v4

- name: Install PHP.
uses: shivammathur/setup-php@v2
with:
coverage: ${{ matrix.coverage }}
extensions: ${{ matrix.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
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 "::set-output name=dir::$(composer config cache-files-dir)"
- name: Cache composer dependencies
uses: actions/cache@v1
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.
if: matrix.php != '8.4'
run: composer update $DEFAULT_COMPOSER_FLAGS
- name: PHP Unit tests for PHP 7.1
run: vendor/bin/phpunit --verbose --coverage-clover=coverage.clover --exclude-group $PHPUNIT_EXCLUDE_GROUP --colors=always
if: matrix.php == '7.1'
- name: PHP Unit tests for PHP >= 7.2
run: vendor/bin/phpunit --verbose --exclude-group $PHPUNIT_EXCLUDE_GROUP --colors=always
env:
PHPUNIT_EXCLUDE_GROUP: mssql,oci,wincache,xcache,zenddata,cubrid
if: matrix.php >= '7.2'
- name: PHP Unit tests for PHP <= 7.0
run: vendor/bin/phpunit --verbose --exclude-group $PHPUNIT_EXCLUDE_GROUP --colors=always
if: matrix.php <= '7.0'
- 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

npm:
name: NPM 6 on ubuntu-latest
runs-on: ubuntu-latest
- name: Install dependencies with PHP 8.4.
if: matrix.php == '8.4'
run: composer update $DEFAULT_COMPOSER_FLAGS --ignore-platform-reqs

steps:
- name: Checkout
uses: actions/checkout@v2
- 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 "::set-output name=dir::$(composer config cache-files-dir)"
- name: Cache composer dependencies
uses: actions/cache@v1
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 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: Run tests with PHPUnit.
if: matrix.php != '7.4'
run: vendor/bin/phpunit --verbose --exclude-group $PHPUNIT_EXCLUDE_GROUP --colors=always

- name: Upload coverage to Codecov.
if: matrix.php == '7.4'
uses: codecov/codecov-action@v3
with:
node-version: 6
- name: Tests
run: |
npm install
npm test
# env:
# CI: true
file: ./coverage.xml
67 changes: 67 additions & 0 deletions .github/workflows/ci-mariadb.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
on:
- pull_request
- push

name: ci-mariadb

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

jobs:
tests:
name: PHP ${{ matrix.php }}-mariadb-${{ matrix.mariadb }}
env:
extensions: curl, intl, pdo, pdo_mysql
XDEBUG_MODE: coverage, develop

runs-on: ubuntu-latest

strategy:
fail-fast: false
matrix:
os: [ubuntu-latest]
php: [7.4, 8.0, 8.1, 8.2, 8.3, 8.4]
mariadb:
- mariadb:10.4
- mariadb:latest

services:
mysql:
image: ${{ matrix.mariadb }}
env:
MARIADB_ROOT_PASSWORD: root
MARIADB_DATABASE: yiitest
ports:
- 3306:3306
options: --health-cmd="mariadb-admin ping" --health-interval=10s --health-timeout=5s --health-retries=3

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

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

- name: Install dependencies with composer
if: matrix.php != '8.4'
run: composer update --prefer-dist --no-interaction --no-progress --optimize-autoloader --ansi

- name: Install dependencies with PHP 8.4.
if: matrix.php == '8.4'
run: composer update --prefer-dist --no-interaction --no-progress --optimize-autoloader --ignore-platform-reqs --ansi

- name: Run MariaDB tests with PHPUnit and generate coverage.
run: vendor/bin/phpunit --group mysql --coverage-clover=coverage.xml --colors=always

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

0 comments on commit b888e41

Please sign in to comment.