From 449888c023abfb737f1cddb0cf5b6766f23b27f8 Mon Sep 17 00:00:00 2001 From: Tigrov Date: Sat, 27 Jul 2024 10:32:30 +0700 Subject: [PATCH 1/3] Update workflows --- .github/workflows/active-record.yml | 8 ++++---- .github/workflows/build.yml | 7 ++++++- .github/workflows/composer-require-checker.yml | 2 +- .github/workflows/db-mariadb.yml | 7 ++++++- .github/workflows/db-mssql.yml | 7 ++++++- .github/workflows/db-mysql.yml | 7 ++++++- .github/workflows/db-oracle.yml | 7 ++++++- .github/workflows/db-pgsql.yml | 8 +++++++- .github/workflows/db-sqlite.yml | 7 ++++++- .github/workflows/rector.yml | 2 +- 10 files changed, 49 insertions(+), 13 deletions(-) diff --git a/.github/workflows/active-record.yml b/.github/workflows/active-record.yml index 55024f848..e385ddfa9 100644 --- a/.github/workflows/active-record.yml +++ b/.github/workflows/active-record.yml @@ -36,7 +36,7 @@ jobs: services: mysql: - image: mysql:8 + image: mysql:latest env: MYSQL_ALLOW_EMPTY_PASSWORD: true MYSQL_PASSWORD: '' @@ -58,7 +58,7 @@ jobs: --health-timeout 5s --health-retries 10 postgres: - image: postgres:14 + image: postgres:16 env: POSTGRES_USER: root POSTGRES_PASSWORD: root @@ -67,7 +67,7 @@ jobs: - 5432:5432 options: --name=postgres --health-cmd="pg_isready" --health-interval=10s --health-timeout=5s --health-retries=3 mssql: - image: mcr.microsoft.com/mssql/server:2019-latest + image: mcr.microsoft.com/mssql/server:2022-latest env: SA_PASSWORD: YourStrong!Passw0rd ACCEPT_EULA: Y @@ -165,7 +165,7 @@ jobs: run: vendor/bin/phpunit --testsuite ActiveRecord --coverage-clover=coverage.xml --colors=always - name: Upload coverage to Codecov. - if: matrix.php == '8.1' + if: matrix.php == '8.3' uses: codecov/codecov-action@v3 with: token: ${{ secrets.CODECOV_TOKEN }} diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 33eb4b837..0da2c5a87 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -2,15 +2,19 @@ on: pull_request: paths: - 'src/**' + - 'tests/**' - '.github/workflows/build.yml' - 'composer.json' + - 'phpunit.xml.dist' push: branches: ['master'] paths: - 'src/**' + - 'tests/**' - '.github/workflows/build.yml' - 'composer.json' + - 'phpunit.xml.dist' name: build @@ -33,6 +37,7 @@ jobs: - 8.0 - 8.1 - 8.2 + - 8.3 steps: - name: Checkout. @@ -57,7 +62,7 @@ jobs: run: vendor/bin/phpunit --testsuite Db --coverage-clover=coverage.xml --colors=always - name: Upload coverage to Codecov. - if: matrix.os == 'ubuntu-latest' && matrix.php == '8.1' + if: matrix.os == 'ubuntu-latest' && matrix.php == '8.3' uses: codecov/codecov-action@v3 with: token: ${{ secrets.CODECOV_TOKEN }} diff --git a/.github/workflows/composer-require-checker.yml b/.github/workflows/composer-require-checker.yml index ee9a02789..15cafd128 100644 --- a/.github/workflows/composer-require-checker.yml +++ b/.github/workflows/composer-require-checker.yml @@ -25,4 +25,4 @@ jobs: os: >- ['ubuntu-latest'] php: >- - ['8.0', '8.1'] + ['8.0', '8.1', '8.2', '8.3'] diff --git a/.github/workflows/db-mariadb.yml b/.github/workflows/db-mariadb.yml index 8cf35ccb9..6a4b7478b 100644 --- a/.github/workflows/db-mariadb.yml +++ b/.github/workflows/db-mariadb.yml @@ -2,15 +2,19 @@ on: pull_request: paths: - 'src/**' + - 'tests/**' - '.github/workflows/db-mariadb.yml' - 'composer.json' + - 'phpunit.xml.dist' push: branches: ['master'] paths: - 'src/**' + - 'tests/**' - '.github/workflows/db-mariadb.yml' - 'composer.json' + - 'phpunit.xml.dist' name: db-mariadb @@ -34,6 +38,7 @@ jobs: - 8.0 - 8.1 - 8.2 + - 8.3 mariadb: - mariadb:10.4 @@ -86,7 +91,7 @@ jobs: run: vendor/bin/phpunit --testsuite Mysql --coverage-clover=coverage.xml --colors=always - name: Upload coverage to Codecov. - if: matrix.php == '8.1' + if: matrix.php == '8.3' uses: codecov/codecov-action@v3 with: token: ${{ secrets.CODECOV_TOKEN }} diff --git a/.github/workflows/db-mssql.yml b/.github/workflows/db-mssql.yml index ea6944b84..d6e5168d3 100644 --- a/.github/workflows/db-mssql.yml +++ b/.github/workflows/db-mssql.yml @@ -2,15 +2,19 @@ on: pull_request: paths: - 'src/**' + - 'tests/**' - '.github/workflows/db-mssql.yml' - 'composer.json' + - 'phpunit.xml.dist' push: branches: ['master'] paths: - 'src/**' + - 'tests/**' - '.github/workflows/db-mssql.yml' - 'composer.json' + - 'phpunit.xml.dist' name: db-mssql @@ -34,6 +38,7 @@ jobs: - 8.0 - 8.1 - 8.2 + - 8.3 mssql: - server:2017-latest @@ -88,7 +93,7 @@ jobs: run: vendor/bin/phpunit --testsuite Mssql --coverage-clover=coverage.xml --colors=always - name: Upload coverage to Codecov. - if: matrix.php == '8.1' + if: matrix.php == '8.3' uses: codecov/codecov-action@v3 with: token: ${{ secrets.CODECOV_TOKEN }} diff --git a/.github/workflows/db-mysql.yml b/.github/workflows/db-mysql.yml index 144f472b0..4ae947eb3 100644 --- a/.github/workflows/db-mysql.yml +++ b/.github/workflows/db-mysql.yml @@ -2,15 +2,19 @@ on: pull_request: paths: - 'src/**' + - 'tests/**' - '.github/workflows/db-mysql.yml' - 'composer.json' + - 'phpunit.xml.dist' push: branches: ['master'] paths: - 'src/**' + - 'tests/**' - '.github/workflows/db-mysql.yml' - 'composer.json' + - 'phpunit.xml.dist' name: db-mysql @@ -34,6 +38,7 @@ jobs: - 8.0 - 8.1 - 8.2 + - 8.3 mysql: - mysql:5.7 @@ -81,7 +86,7 @@ jobs: run: vendor/bin/phpunit --testsuite Mysql --coverage-clover=coverage.xml --colors=always - name: Upload coverage to Codecov. - if: matrix.php == '8.1' + if: matrix.php == '8.3' uses: codecov/codecov-action@v3 with: token: ${{ secrets.CODECOV_TOKEN }} diff --git a/.github/workflows/db-oracle.yml b/.github/workflows/db-oracle.yml index 1d8d1fe01..7197534d7 100644 --- a/.github/workflows/db-oracle.yml +++ b/.github/workflows/db-oracle.yml @@ -2,15 +2,19 @@ on: pull_request: paths: - 'src/**' + - 'tests/**' - '.github/workflows/db-oracle.yml' - 'composer.json' + - 'phpunit.xml.dist' push: branches: ['master'] paths: - 'src/**' + - 'tests/**' - '.github/workflows/db-oracle.yml' - 'composer.json' + - 'phpunit.xml.dist' name: db-oracle @@ -34,6 +38,7 @@ jobs: - 8.0 - 8.1 - 8.2 + - 8.3 oracle: - 18 @@ -86,7 +91,7 @@ jobs: run: vendor/bin/phpunit --testsuite Oracle --coverage-clover=coverage.xml --colors=always - name: Upload coverage to Codecov. - if: matrix.php == '8.1' + if: matrix.php == '8.3' uses: codecov/codecov-action@v3 with: token: ${{ secrets.CODECOV_TOKEN }} diff --git a/.github/workflows/db-pgsql.yml b/.github/workflows/db-pgsql.yml index 30749f111..f181f26f2 100644 --- a/.github/workflows/db-pgsql.yml +++ b/.github/workflows/db-pgsql.yml @@ -2,15 +2,19 @@ on: pull_request: paths: - 'src/**' + - 'tests/**' - '.github/workflows/db-pgsql.yml' - 'composer.json' + - 'phpunit.xml.dist' push: branches: ['master'] paths: - 'src/**' + - 'tests/**' - '.github/workflows/db-pgsql.yml' - 'composer.json' + - 'phpunit.xml.dist' name: db-pgsql @@ -34,6 +38,7 @@ jobs: - 8.0 - 8.1 - 8.2 + - 8.3 pgsql: - 9 @@ -43,6 +48,7 @@ jobs: - 13 - 14 - 15 + - 16 services: postgres: @@ -86,7 +92,7 @@ jobs: run: vendor/bin/phpunit --testsuite Pgsql --coverage-clover=coverage.xml --colors=always - name: Upload coverage to Codecov. - if: matrix.php == '8.1' + if: matrix.php == '8.3' uses: codecov/codecov-action@v3 with: token: ${{ secrets.CODECOV_TOKEN }} diff --git a/.github/workflows/db-sqlite.yml b/.github/workflows/db-sqlite.yml index 7ab288657..af67bbbc3 100644 --- a/.github/workflows/db-sqlite.yml +++ b/.github/workflows/db-sqlite.yml @@ -2,15 +2,19 @@ on: pull_request: paths: - 'src/**' + - 'tests/**' - '.github/workflows/db-sqlite.yml' - 'composer.json' + - 'phpunit.xml.dist' push: branches: ['master'] paths: - 'src/**' + - 'tests/**' - '.github/workflows/db-sqlite.yml' - 'composer.json' + - 'phpunit.xml.dist' name: db-sqlite @@ -35,6 +39,7 @@ jobs: - 8.0 - 8.1 - 8.2 + - 8.3 steps: - name: Checkout. @@ -73,7 +78,7 @@ jobs: run: vendor/bin/phpunit --testsuite Sqlite --coverage-clover=coverage.xml --colors=always - name: Upload coverage to Codecov. - if: matrix.os == 'ubuntu-latest' && matrix.php == '8.1' + if: matrix.os == 'ubuntu-latest' && matrix.php == '8.3' uses: codecov/codecov-action@v3 with: token: ${{ secrets.CODECOV_TOKEN }} diff --git a/.github/workflows/rector.yml b/.github/workflows/rector.yml index 0f4555627..3013bfdd3 100644 --- a/.github/workflows/rector.yml +++ b/.github/workflows/rector.yml @@ -4,8 +4,8 @@ on: - 'src/**' - 'config/**' - '.github/workflows/rector.yml' - - 'rector.php' - 'composer.json' + - 'rector.php' name: rector From 906619e39585f35539813f0fee3af20c7d309763 Mon Sep 17 00:00:00 2001 From: Tigrov Date: Sat, 27 Jul 2024 21:43:33 +0700 Subject: [PATCH 2/3] Exclude old versions for old PHP --- .github/workflows/active-record.yml | 4 ++-- .github/workflows/bc.yml_ | 2 +- .github/workflows/db-mariadb.yml | 16 +++++++++------- .github/workflows/db-mssql.yml | 21 ++++++++++++--------- .github/workflows/db-mysql.yml | 16 +++++++++------- .github/workflows/db-oracle.yml | 16 +++++++++------- .github/workflows/db-pgsql.yml | 16 +++++++++------- 7 files changed, 51 insertions(+), 40 deletions(-) diff --git a/.github/workflows/active-record.yml b/.github/workflows/active-record.yml index e385ddfa9..4d0d4b93a 100644 --- a/.github/workflows/active-record.yml +++ b/.github/workflows/active-record.yml @@ -74,14 +74,14 @@ jobs: MSSQL_PID: Developer ports: - 1433:1433 - 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 + options: --name=mssql --health-cmd="/opt/mssql-tools18/bin/sqlcmd -C -S localhost -U SA -P 'YourStrong!Passw0rd' -Q 'SELECT 1'" --health-interval=10s --health-timeout=5s --health-retries=3 steps: - name: Checkout. uses: actions/checkout@v3 - 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' + run: docker exec -i mssql /opt/mssql-tools18/bin/sqlcmd -C -S localhost -U SA -P 'YourStrong!Passw0rd' -Q 'CREATE DATABASE yiitest' - name: Install PHP with extensions. uses: shivammathur/setup-php@v2 diff --git a/.github/workflows/bc.yml_ b/.github/workflows/bc.yml_ index 5970206c9..902c5d33b 100644 --- a/.github/workflows/bc.yml_ +++ b/.github/workflows/bc.yml_ @@ -20,4 +20,4 @@ jobs: os: >- ['ubuntu-latest'] php: >- - ['8.1'] + ['8.3'] diff --git a/.github/workflows/db-mariadb.yml b/.github/workflows/db-mariadb.yml index 6a4b7478b..074b0d8f7 100644 --- a/.github/workflows/db-mariadb.yml +++ b/.github/workflows/db-mariadb.yml @@ -27,17 +27,11 @@ jobs: CURRENT_PACKAGE: db-mysql EXTENSIONS: pdo, pdo_mysql - runs-on: ${{ matrix.os }} + runs-on: ubuntu-latest strategy: matrix: - os: - - ubuntu-latest - php: - - 8.0 - - 8.1 - - 8.2 - 8.3 mariadb: @@ -49,6 +43,14 @@ jobs: - mariadb:10.9 - mariadb:latest + include: + - php: 8.0 + mariadb: mariadb:latest + - php: 8.1 + mariadb: mariadb:latest + - php: 8.2 + mariadb: mariadb:latest + services: mysql: image: ${{ matrix.mariadb }} diff --git a/.github/workflows/db-mssql.yml b/.github/workflows/db-mssql.yml index d6e5168d3..7a05187f9 100644 --- a/.github/workflows/db-mssql.yml +++ b/.github/workflows/db-mssql.yml @@ -27,13 +27,10 @@ jobs: CURRENT_PACKAGE: db-mssql EXTENSIONS: pdo, pdo_sqlsrv-5.10.1 - runs-on: ${{ matrix.os }} + runs-on: ubuntu-latest strategy: matrix: - os: - - ubuntu-latest - php: - 8.0 - 8.1 @@ -41,9 +38,15 @@ jobs: - 8.3 mssql: - - server:2017-latest - - server:2019-latest - - server:2022-latest + - server: 2022-latest + odbc-version: 18 + flag: "-C" + + include: + - php: 8.3 + mssql: { server: 2017-latest } + - php: 8.3 + mssql: { server: 2019-latest } services: mssql: @@ -54,14 +57,14 @@ jobs: MSSQL_PID: Developer ports: - 1433:1433 - 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 + options: --name=mssql --health-cmd="/opt/mssql-tools${{ matrix.mssql.odbc-version }}/bin/sqlcmd ${{ matrix.mssql.flag }} -S localhost -U SA -P 'YourStrong!Passw0rd' -Q 'SELECT 1'" --health-interval=10s --health-timeout=5s --health-retries=3 steps: - name: Checkout. uses: actions/checkout@v3 - 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' + run: docker exec -i mssql /opt/mssql-tools${{ matrix.mssql.odbc-version }}/bin/sqlcmd ${{ matrix.mssql.flag }} -S localhost -U SA -P 'YourStrong!Passw0rd' -Q 'CREATE DATABASE yiitest' - name: Install PHP with extensions. uses: shivammathur/setup-php@v2 diff --git a/.github/workflows/db-mysql.yml b/.github/workflows/db-mysql.yml index 4ae947eb3..89282d572 100644 --- a/.github/workflows/db-mysql.yml +++ b/.github/workflows/db-mysql.yml @@ -27,23 +27,25 @@ jobs: CURRENT_PACKAGE: db-mysql EXTENSIONS: pdo, pdo_mysql - runs-on: ${{ matrix.os }} + runs-on: ubuntu-latest strategy: matrix: - os: - - ubuntu-latest - php: - - 8.0 - - 8.1 - - 8.2 - 8.3 mysql: - mysql:5.7 - mysql:latest + include: + - php: 8.0 + mysql: mysql:latest + - php: 8.1 + mysql: mysql:latest + - php: 8.2 + mysql: mysql:latest + services: mysql: image: ${{ matrix.mysql }} diff --git a/.github/workflows/db-oracle.yml b/.github/workflows/db-oracle.yml index 7197534d7..6c2d86597 100644 --- a/.github/workflows/db-oracle.yml +++ b/.github/workflows/db-oracle.yml @@ -27,23 +27,25 @@ jobs: COMPOSER_ROOT_VERSION: dev-master EXTENSIONS: pdo, pdo_oci - runs-on: ${{ matrix.os }} + runs-on: ubuntu-latest strategy: matrix: - os: - - ubuntu-latest - php: - - 8.0 - - 8.1 - - 8.2 - 8.3 oracle: - 18 - 21 + include: + - php: 8.0 + oracle: 21 + - php: 8.1 + oracle: 21 + - php: 8.2 + oracle: 21 + services: oci: image: gvenzl/oracle-xe:${{ matrix.oracle }} diff --git a/.github/workflows/db-pgsql.yml b/.github/workflows/db-pgsql.yml index f181f26f2..b881db376 100644 --- a/.github/workflows/db-pgsql.yml +++ b/.github/workflows/db-pgsql.yml @@ -27,17 +27,11 @@ jobs: CURRENT_PACKAGE: db-pgsql EXTENSIONS: pdo, pdo_pgsql - runs-on: ${{ matrix.os }} + runs-on: ubuntu-latest strategy: matrix: - os: - - ubuntu-latest - php: - - 8.0 - - 8.1 - - 8.2 - 8.3 pgsql: @@ -50,6 +44,14 @@ jobs: - 15 - 16 + include: + - php: 8.0 + pgsql: 16 + - php: 8.1 + pgsql: 16 + - php: 8.2 + pgsql: 16 + services: postgres: image: postgres:${{ matrix.pgsql }} From dc404e9069faed881c6efd6472090f4d1c28983c Mon Sep 17 00:00:00 2001 From: Tigrov Date: Sat, 27 Jul 2024 21:49:24 +0700 Subject: [PATCH 3/3] Fix MSSQL tests --- .github/workflows/db-mssql.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/db-mssql.yml b/.github/workflows/db-mssql.yml index 7a05187f9..534cace7e 100644 --- a/.github/workflows/db-mssql.yml +++ b/.github/workflows/db-mssql.yml @@ -20,7 +20,7 @@ name: db-mssql jobs: tests: - name: PHP ${{ matrix.php }}-mssql-${{ matrix.mssql }} + name: PHP ${{ matrix.php }}-mssql-${{ matrix.mssql.server }} env: COMPOSER_ROOT_VERSION: dev-master @@ -50,7 +50,7 @@ jobs: services: mssql: - image: mcr.microsoft.com/mssql/${{ matrix.mssql }} + image: mcr.microsoft.com/mssql/server:${{ matrix.mssql.server }} env: SA_PASSWORD: YourStrong!Passw0rd ACCEPT_EULA: Y