diff --git a/.github/workflows/active-record.yml b/.github/workflows/active-record.yml index 4bd96e3aa..37e266d9c 100644 --- a/.github/workflows/active-record.yml +++ b/.github/workflows/active-record.yml @@ -1,16 +1,13 @@ on: pull_request: - paths: + paths: &paths - 'src/**' - '.github/workflows/active-record.yml' - 'composer.json' push: branches: ['master'] - paths: - - 'src/**' - - '.github/workflows/active-record.yml' - - 'composer.json' + paths: *paths name: active-record @@ -23,7 +20,6 @@ jobs: name: ActiveRecord env: - COMPOSER_ROOT_VERSION: 2.0.1 PHP_VERSION: 8.5 EXTENSIONS: pdo_mysql, pdo_oci, pdo_pgsql, pdo_sqlite, pdo_sqlsrv @@ -86,7 +82,7 @@ jobs: run: docker exec -i mssql /opt/mssql-tools18/bin/sqlcmd -C -S localhost -U SA -P 'YourStrong!Passw0rd' -Q 'CREATE DATABASE [ar-test]' - name: Checkout. - uses: actions/checkout@v4 + uses: actions/checkout@v6 - name: Install PHP with extensions. uses: shivammathur/setup-php@v2 @@ -99,26 +95,11 @@ jobs: - name: Install AR dependencies run: composer require yiisoft/cache yiisoft/factory yiisoft/middleware-dispatcher yiisoft/test-support - - name: Install db-sqlite, db-mysql, db-mssql and db-oracle. - uses: yiisoft/actions/install-packages@master - with: - composer-root-version: 2.0.0 - packages: >- - ['db-sqlite', 'db-mysql', 'db-mssql', 'db-oracle'] - - - name: Install db-pgsql. - uses: yiisoft/actions/install-packages@master - with: - composer-root-version: 2.0.1 - packages: >- - ['db-pgsql'] - - - name: Install active-record. + - name: Install db-sqlite, db-mysql, db-pgsql, db-mssql, db-oracle and active-record. uses: yiisoft/actions/install-packages@master with: - composer-root-version: 1.0.0 packages: >- - ['active-record'] + ['db-sqlite', 'db-mysql', 'db-pgsql', 'db-mssql', 'db-oracle', 'active-record'] - name: Run tests with phpunit with code coverage. run: vendor/bin/phpunit --testsuite ActiveRecord --coverage-clover=coverage.xml --colors=always --display-warnings --display-deprecations diff --git a/.github/workflows/bc.yml b/.github/workflows/bc.yml index ffbd2ed12..0ea2e96bb 100644 --- a/.github/workflows/bc.yml +++ b/.github/workflows/bc.yml @@ -1,15 +1,12 @@ on: pull_request: - paths: + paths: &paths - 'src/**' - '.github/workflows/bc.yml' - 'composer.json' push: branches: ['master'] - paths: - - 'src/**' - - '.github/workflows/bc.yml' - - 'composer.json' + paths: *paths name: backwards compatibility @@ -21,7 +18,5 @@ jobs: roave_bc_check: uses: yiisoft/actions/.github/workflows/bc.yml@master with: - os: >- - ['ubuntu-latest'] php: >- ['8.5'] diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 4a1eb1d7e..e944a3503 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -1,6 +1,6 @@ on: pull_request: - paths: + paths: &paths - 'src/**' - 'tests/**' - '.github/workflows/build.yml' @@ -9,12 +9,7 @@ on: push: branches: ['master'] - paths: - - 'src/**' - - 'tests/**' - - '.github/workflows/build.yml' - - 'composer.json' - - 'phpunit.xml.dist' + paths: *paths name: build @@ -46,7 +41,7 @@ jobs: steps: - name: Checkout. - uses: actions/checkout@v4 + uses: actions/checkout@v6 - name: Install PHP with extensions. uses: shivammathur/setup-php@v2 diff --git a/.github/workflows/composer-require-checker.yml b/.github/workflows/composer-require-checker.yml index 3cc6fe542..01a546d68 100644 --- a/.github/workflows/composer-require-checker.yml +++ b/.github/workflows/composer-require-checker.yml @@ -1,6 +1,6 @@ on: pull_request: - paths: + paths: &paths - 'src/**' - 'config/**' - '.github/workflows/composer-require-checker.yml' @@ -9,12 +9,7 @@ on: push: branches: ['master'] - paths: - - 'src/**' - - 'config/**' - - '.github/workflows/composer-require-checker.yml' - - 'composer.json' - - 'composer-require-checker.json' + paths: *paths name: Composer require checker diff --git a/.github/workflows/db-mariadb.yml b/.github/workflows/db-mariadb.yml index b45f0cc5b..68a7491b8 100644 --- a/.github/workflows/db-mariadb.yml +++ b/.github/workflows/db-mariadb.yml @@ -1,6 +1,6 @@ on: pull_request: - paths: + paths: &paths - 'src/**' - 'tests/**' - '.github/workflows/db-mariadb.yml' @@ -9,29 +9,20 @@ on: push: branches: ['master'] - paths: - - 'src/**' - - 'tests/**' - - '.github/workflows/db-mariadb.yml' - - 'composer.json' - - 'phpunit.xml.dist' + paths: *paths name: db-mariadb +permissions: + contents: read + concurrency: group: ${{ github.workflow }}-${{ github.ref }} cancel-in-progress: true jobs: tests: - name: PHP ${{ matrix.php }}-mariadb-${{ matrix.mariadb }} - - env: - COMPOSER_ROOT_VERSION: 2.0.0 - EXTENSIONS: pdo_mysql - YII_MYSQL_TYPE: 'mariadb' - - runs-on: ubuntu-latest + name: MariaDB ${{ matrix.mariadb }} strategy: matrix: @@ -39,60 +30,29 @@ jobs: - 8.5 mariadb: - - mariadb:10.4 - - mariadb:10.5 - - mariadb:10.6 - - mariadb:10.7 - - mariadb:10.8 - - mariadb:10.9 - - mariadb:latest + - 10.4 + - 10.5 + - 10.6 + - 10.7 + - 10.8 + - 10.9 + - latest include: - php: 8.1 - mariadb: mariadb:latest + mariadb: latest - php: 8.2 - mariadb: mariadb:latest + mariadb: latest - php: 8.3 - mariadb: mariadb:latest + mariadb: latest - php: 8.4 - mariadb: mariadb:latest - - services: - mysql: - image: ${{ matrix.mariadb }} - env: - MARIADB_ALLOW_EMPTY_ROOT_PASSWORD: true - MARIADB_ROOT_PASSWORD: '' - 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: - php-version: ${{ matrix.php }} - extensions: ${{ env.EXTENSIONS }} - ini-values: date.timezone='UTC' - coverage: pcov - - - name: Install db-mysql. - uses: yiisoft/actions/install-packages@master - with: - composer-root-version: 2.0.0 - packages: >- - ['db-mysql'] + mariadb: latest - - name: Run Mysql tests with phpunit and code coverage. - run: vendor/bin/phpunit --testsuite Mysql --coverage-clover=coverage.xml --colors=always --display-warnings --display-deprecations + uses: yiisoft/actions/.github/workflows/db-mariadb.yml@master + secrets: + CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }} + with: + mariadb: ${{ matrix.mariadb }} + php: >- + [${{ matrix.php }}] - - name: Upload coverage to Codecov. - if: matrix.php == '8.5' - uses: codecov/codecov-action@v5 - with: - token: ${{ secrets.CODECOV_TOKEN }} - files: ./coverage.xml diff --git a/.github/workflows/db-migration.yml b/.github/workflows/db-migration.yml index 7ce5008dc..50318770c 100644 --- a/.github/workflows/db-migration.yml +++ b/.github/workflows/db-migration.yml @@ -23,7 +23,6 @@ jobs: name: DbMigration env: - COMPOSER_ROOT_VERSION: 2.0.1 PHP_VERSION: 8.5 EXTENSIONS: pdo_mysql, pdo_oci, pdo_pgsql, pdo_sqlite, pdo_sqlsrv @@ -83,7 +82,7 @@ jobs: run: docker exec -i mssql /opt/mssql-tools18/bin/sqlcmd -C -S localhost -U SA -P 'YourStrong!Passw0rd' -Q 'CREATE DATABASE yiitest' - name: Checkout. - uses: actions/checkout@v4 + uses: actions/checkout@v6 - name: Install PHP with extensions. uses: shivammathur/setup-php@v2 @@ -96,19 +95,11 @@ jobs: - name: Install yiisoft/test-support and yiisoft/yii-console run: composer require yiisoft/test-support yiisoft/yii-console - - name: Install db-sqlite, db-mysql, db-mssql and db-oracle and db-migration. + - name: Install db-sqlite, db-mysql, db-pgsql, db-mssql and db-oracle and db-migration. uses: yiisoft/actions/install-packages@master with: - composer-root-version: 2.0.0 packages: >- - ['db-sqlite', 'db-mysql', 'db-mssql', 'db-oracle', 'db-migration'] - - - name: Install db-pgsql. - uses: yiisoft/actions/install-packages@master - with: - composer-root-version: 2.0.1 - packages: >- - ['db-pgsql'] + ['db-sqlite', 'db-mysql', 'db-pgsql', 'db-mssql', 'db-oracle', 'db-migration'] - name: Run tests with phpunit with code coverage. run: vendor/bin/phpunit --testsuite=DbMigration --coverage-clover=coverage.xml --colors=always --display-warnings --display-deprecations diff --git a/.github/workflows/db-mssql-2017.yml b/.github/workflows/db-mssql-2017.yml index 574ef6251..38a3b5233 100644 --- a/.github/workflows/db-mssql-2017.yml +++ b/.github/workflows/db-mssql-2017.yml @@ -1,6 +1,6 @@ on: pull_request: - paths: + paths: &paths - 'src/**' - 'tests/**' - '.github/workflows/db-mssql-2017.yml' @@ -9,15 +9,13 @@ on: push: branches: ['master'] - paths: - - 'src/**' - - 'tests/**' - - '.github/workflows/db-mssql-2017.yml' - - 'composer.json' - - 'phpunit.xml.dist' + paths: *paths name: db-mssql-2017 +permissions: + contents: read + concurrency: group: ${{ github.workflow }}-${{ github.ref }} cancel-in-progress: true @@ -26,40 +24,4 @@ jobs: tests: name: MSSQL 2017 (Windows) - env: - COMPOSER_ROOT_VERSION: 2.0.0 - PHP_VERSION: 8.5 - EXTENSIONS: pdo_sqlsrv - - runs-on: windows-latest - - steps: - - name: Install SQL Server on Windows. - run: choco install sql-server-express --version=2017.20190916 -y --no-progress --ia="'/Q /SUPPRESSPRIVACYSTATEMENTNOTICE /IACCEPTSQLSERVERLICENSETERMS /ACTION=install /INSTANCEID=MSSQLSERVER /INSTANCENAME=MSSQLSERVER /UPDATEENABLED=FALSE /SECURITYMODE=SQL /TCPENABLED=1 /SAPWD=YourStrong!Passw0rd'" - - - name: Create database. - run: sqlcmd -S localhost -U SA -P 'YourStrong!Passw0rd' -Q 'CREATE DATABASE yiitest' - - - name: Checkout. - uses: actions/checkout@v4 - - - name: Install PHP with extensions. - uses: shivammathur/setup-php@v2 - with: - php-version: ${{ env.PHP_VERSION }} - extensions: ${{ env.EXTENSIONS }} - ini-values: date.timezone='UTC' - coverage: pcov - env: - update: true - - - name: Install db-mssql. - uses: yiisoft/actions/install-packages@master - with: - composer-root-version: 2.0.0 - packages: >- - ['db-mssql'] - - - name: Run mssql tests with phpunit and code coverage. - run: vendor/bin/phpunit --testsuite Mssql --coverage-clover=coverage.xml --colors=always --display-warnings --display-deprecations - + uses: yiisoft/actions/.github/workflows/db-mssql-2017.yml@master diff --git a/.github/workflows/db-mssql.yml b/.github/workflows/db-mssql.yml index 5f54332e6..e010f40ed 100644 --- a/.github/workflows/db-mssql.yml +++ b/.github/workflows/db-mssql.yml @@ -1,6 +1,6 @@ on: pull_request: - paths: + paths: &paths - 'src/**' - 'tests/**' - '.github/workflows/db-mssql.yml' @@ -9,28 +9,20 @@ on: push: branches: ['master'] - paths: - - 'src/**' - - 'tests/**' - - '.github/workflows/db-mssql.yml' - - 'composer.json' - - 'phpunit.xml.dist' + paths: *paths name: db-mssql +permissions: + contents: read + concurrency: group: ${{ github.workflow }}-${{ github.ref }} cancel-in-progress: true jobs: tests: - name: PHP ${{ matrix.php }}-mssql-${{ matrix.mssql }} - - env: - COMPOSER_ROOT_VERSION: 2.0.0 - EXTENSIONS: pdo_sqlsrv - - runs-on: ubuntu-latest + name: MSSQL ${{ matrix.mssql }} strategy: matrix: @@ -48,54 +40,10 @@ jobs: - php: 8.5 mssql: 2019-latest - services: - mssql: - image: mcr.microsoft.com/mssql/server:${{ matrix.mssql }} - env: - SA_PASSWORD: YourStrong!Passw0rd - ACCEPT_EULA: Y - MSSQL_PID: Developer - ports: - - 1433:1433 - 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: Install ODBC driver. - run: | - sudo curl https://packages.microsoft.com/config/ubuntu/$(lsb_release -rs)/prod.list | sudo tee /etc/apt/sources.list.d/mssql-release.list - sudo apt-get clean - sudo apt-get update - sudo ACCEPT_EULA=Y apt-get install -y msodbcsql18 - - - name: Create database. - run: docker exec -i mssql /opt/mssql-tools18/bin/sqlcmd -C -S localhost -U SA -P 'YourStrong!Passw0rd' -Q 'CREATE DATABASE yiitest' - - - name: Checkout. - uses: actions/checkout@v4 - - - name: Install PHP with extensions. - uses: shivammathur/setup-php@v2 - with: - php-version: ${{ matrix.php }} - extensions: ${{ env.EXTENSIONS }} - ini-values: date.timezone='UTC' - coverage: pcov - env: - update: true - - - name: Install db-mssql. - uses: yiisoft/actions/install-packages@master - with: - composer-root-version: 2.0.0 - packages: >- - ['db-mssql'] - - - name: Run mssql tests with phpunit and code coverage. - run: vendor/bin/phpunit --testsuite Mssql --coverage-clover=coverage.xml --colors=always --display-warnings --display-deprecations - - - name: Upload coverage to Codecov. - if: matrix.php == '8.5' - uses: codecov/codecov-action@v5 - with: - token: ${{ secrets.CODECOV_TOKEN }} - files: ./coverage.xml + uses: yiisoft/actions/.github/workflows/db-mssql.yml@master + secrets: + CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }} + with: + mssql: ${{ matrix.mssql }} + php: >- + [${{ matrix.php }}] diff --git a/.github/workflows/db-mysql.yml b/.github/workflows/db-mysql.yml index 8991ed988..560c4e9f2 100644 --- a/.github/workflows/db-mysql.yml +++ b/.github/workflows/db-mysql.yml @@ -1,6 +1,6 @@ on: pull_request: - paths: + paths: &paths - 'src/**' - 'tests/**' - '.github/workflows/db-mysql.yml' @@ -9,84 +9,42 @@ on: push: branches: ['master'] - paths: - - 'src/**' - - 'tests/**' - - '.github/workflows/db-mysql.yml' - - 'composer.json' - - 'phpunit.xml.dist' + paths: *paths name: db-mysql +permissions: + contents: read + concurrency: group: ${{ github.workflow }}-${{ github.ref }} cancel-in-progress: true jobs: tests: - name: PHP ${{ matrix.php }}-mysql-${{ matrix.mysql }} - - env: - COMPOSER_ROOT_VERSION: 2.0.0 - EXTENSIONS: pdo_mysql - - runs-on: ubuntu-latest + name: MySQL ${{ matrix.mysql }} strategy: matrix: php: - 8.5 - mysql: - - mysql:5.7 - - mysql:latest - + - 5.7 + - latest include: - php: 8.1 - mysql: mysql:latest + mysql: latest - php: 8.2 - mysql: mysql:latest + mysql: latest - php: 8.3 - mysql: mysql:latest + mysql: latest - php: 8.4 - mysql: mysql:latest - - services: - mysql: - image: ${{ matrix.mysql }} - env: - MYSQL_ALLOW_EMPTY_PASSWORD: true - MYSQL_PASSWORD: '' - MYSQL_DATABASE: yiitest - ports: - - 3306:3306 - options: --health-cmd="mysqladmin 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: - php-version: ${{ matrix.php }} - extensions: ${{ env.EXTENSIONS }} - ini-values: date.timezone='UTC' - coverage: pcov - - - name: Install db-mysql. - uses: yiisoft/actions/install-packages@master - with: - composer-root-version: 2.0.0 - packages: >- - ['db-mysql'] - - - name: Run Mysql tests with phpunit and code coverage. - run: vendor/bin/phpunit --testsuite Mysql --coverage-clover=coverage.xml --colors=always --display-warnings --display-deprecations - - - name: Upload coverage to Codecov. - if: matrix.php == '8.5' - uses: codecov/codecov-action@v5 - with: - token: ${{ secrets.CODECOV_TOKEN }} - files: ./coverage.xml + mysql: latest + + uses: yiisoft/actions/.github/workflows/db-mysql.yml@master + secrets: + CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }} + with: + mysql: ${{ matrix.mysql }} + php: >- + [${{ matrix.php }}] diff --git a/.github/workflows/db-oracle.yml b/.github/workflows/db-oracle.yml index 47541a3e0..586bcc598 100644 --- a/.github/workflows/db-oracle.yml +++ b/.github/workflows/db-oracle.yml @@ -1,6 +1,6 @@ on: pull_request: - paths: + paths: &paths - 'src/**' - 'tests/**' - '.github/workflows/db-oracle.yml' @@ -9,28 +9,20 @@ on: push: branches: ['master'] - paths: - - 'src/**' - - 'tests/**' - - '.github/workflows/db-oracle.yml' - - 'composer.json' - - 'phpunit.xml.dist' + paths: *paths name: db-oracle +permissions: + contents: read + concurrency: group: ${{ github.workflow }}-${{ github.ref }} cancel-in-progress: true jobs: tests: - name: PHP ${{ matrix.php }}-${{ matrix.oracle }} - - env: - COMPOSER_ROOT_VERSION: 2.0.0 - EXTENSIONS: pdo_oci - - runs-on: ubuntu-latest + name: Oracle ${{ matrix.oracle }} strategy: matrix: @@ -51,49 +43,10 @@ jobs: - php: 8.4 oracle: 21 - services: - oci: - image: gvenzl/oracle-xe:${{ matrix.oracle }} - ports: - - 1521:1521 - env: - ORACLE_DATABASE : yiitest - ORACLE_PASSWORD : root - options: >- - --name=oci - --health-cmd healthcheck.sh - --health-interval 10s - --health-timeout 5s - --health-retries 10 - - steps: - - name: Configure Database. - run: docker exec -i oci bash -c "sqlplus -s system/root@XE <<< 'ALTER USER system DEFAULT TABLESPACE USERS;'" - - - name: Checkout. - uses: actions/checkout@v4 - - - name: Install PHP with extensions. - uses: shivammathur/setup-php@v2 - with: - php-version: ${{ matrix.php }} - extensions: ${{ env.EXTENSIONS }} - ini-values: date.timezone='UTC' - coverage: pcov - - - name: Install db-oracle. - uses: yiisoft/actions/install-packages@master - with: - composer-root-version: 2.0.0 - packages: >- - ['db-oracle'] - - - name: Run oracle tests with phpunit and code coverage. - run: vendor/bin/phpunit --testsuite Oracle --coverage-clover=coverage.xml --colors=always --display-warnings --display-deprecations - - - name: Upload coverage to Codecov. - if: matrix.php == '8.5' - uses: codecov/codecov-action@v5 - with: - token: ${{ secrets.CODECOV_TOKEN }} - files: ./coverage.xml + uses: yiisoft/actions/.github/workflows/db-oracle.yml@master + secrets: + CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }} + with: + oracle: ${{ matrix.oracle }} + php: >- + [${{ matrix.php }}] diff --git a/.github/workflows/db-pgsql.yml b/.github/workflows/db-pgsql.yml index 5a30be88c..d3c711f00 100644 --- a/.github/workflows/db-pgsql.yml +++ b/.github/workflows/db-pgsql.yml @@ -1,6 +1,6 @@ on: pull_request: - paths: + paths: &paths - 'src/**' - 'tests/**' - '.github/workflows/db-pgsql.yml' @@ -9,28 +9,20 @@ on: push: branches: ['master'] - paths: - - 'src/**' - - 'tests/**' - - '.github/workflows/db-pgsql.yml' - - 'composer.json' - - 'phpunit.xml.dist' + paths: *paths name: db-pgsql +permissions: + contents: read + concurrency: group: ${{ github.workflow }}-${{ github.ref }} cancel-in-progress: true jobs: tests: - name: PHP ${{ matrix.php }}-pgsql-${{ matrix.pgsql }} - - env: - COMPOSER_ROOT_VERSION: 2.0.1 - EXTENSIONS: pdo_pgsql - - runs-on: ubuntu-latest + name: Postgres ${{ matrix.pgsql }} strategy: matrix: @@ -59,42 +51,10 @@ jobs: - php: 8.4 pgsql: 18 - services: - postgres: - image: postgres:${{ matrix.pgsql }} - env: - POSTGRES_USER: root - POSTGRES_PASSWORD: root - POSTGRES_DB: yiitest - ports: - - 5432:5432 - options: --name=postgres --health-cmd="pg_isready" --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: - php-version: ${{ matrix.php }} - extensions: ${{ env.EXTENSIONS }} - ini-values: date.timezone='UTC' - coverage: pcov - - - name: Install db-pgsql. - uses: yiisoft/actions/install-packages@master - with: - composer-root-version: 2.0.1 - packages: >- - ['db-pgsql'] - - - name: Run pgsql tests with phpunit and code coverage. - run: vendor/bin/phpunit --testsuite Pgsql --coverage-clover=coverage.xml --colors=always --display-warnings --display-deprecations - - - name: Upload coverage to Codecov. - if: matrix.php == '8.5' - uses: codecov/codecov-action@v5 - with: - token: ${{ secrets.CODECOV_TOKEN }} - files: ./coverage.xml + uses: yiisoft/actions/.github/workflows/db-pgsql.yml@master + secrets: + CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }} + with: + pgsql: ${{ matrix.pgsql }} + php: >- + [${{ matrix.php }}] diff --git a/.github/workflows/db-sqlite.yml b/.github/workflows/db-sqlite.yml index 02edf7187..cc16af9ff 100644 --- a/.github/workflows/db-sqlite.yml +++ b/.github/workflows/db-sqlite.yml @@ -1,6 +1,6 @@ on: pull_request: - paths: + paths: &paths - 'src/**' - 'tests/**' - '.github/workflows/db-sqlite.yml' @@ -9,67 +9,21 @@ on: push: branches: ['master'] - paths: - - 'src/**' - - 'tests/**' - - '.github/workflows/db-sqlite.yml' - - 'composer.json' - - 'phpunit.xml.dist' + paths: *paths name: db-sqlite +permissions: + contents: read + concurrency: group: ${{ github.workflow }}-${{ github.ref }} cancel-in-progress: true jobs: tests: - name: PHP ${{ matrix.php }}-sqlite-${{ matrix.os }} - - env: - COMPOSER_ROOT_VERSION: 2.0.0 - EXTENSIONS: pdo_sqlite - - runs-on: ${{ matrix.os }} - - strategy: - matrix: - os: - - ubuntu-latest - - windows-latest - - php: - - 8.1 - - 8.2 - - 8.3 - - 8.4 - - 8.5 - - steps: - - name: Checkout. - uses: actions/checkout@v4 - - - name: Install PHP with extensions. - uses: shivammathur/setup-php@v2 - with: - php-version: ${{ matrix.php }} - extensions: ${{ env.EXTENSIONS }} - ini-values: date.timezone='UTC' - coverage: pcov - - - name: Install db-sqlite. - uses: yiisoft/actions/install-packages@master - with: - composer-root-version: 2.0.0 - packages: >- - ['db-sqlite'] - - - name: Run sqlite tests with phpunit and code coverage. - run: vendor/bin/phpunit --testsuite Sqlite --coverage-clover=coverage.xml --colors=always --display-warnings --display-deprecations + name: SQLite latest - - name: Upload coverage to Codecov. - if: matrix.os == 'ubuntu-latest' && matrix.php == '8.5' - uses: codecov/codecov-action@v5 - with: - token: ${{ secrets.CODECOV_TOKEN }} - files: ./coverage.xml + uses: yiisoft/actions/.github/workflows/db-sqlite.yml@master + secrets: + CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }} diff --git a/.github/workflows/mutation.yml b/.github/workflows/mutation.yml index 50311f4a6..4ae8b9f85 100644 --- a/.github/workflows/mutation.yml +++ b/.github/workflows/mutation.yml @@ -1,18 +1,17 @@ on: pull_request: - paths: + paths: &paths - 'src/**' + - 'tests/**' - '.github/workflows/mutation.yml' - 'composer.json' + - 'infection.json.dist' push: branches: ['master'] - paths: - - 'src/**' - - '.github/workflows/mutation.yml' - - 'composer.json' + paths: *paths -name: Mutation +name: mutation permissions: contents: read @@ -22,52 +21,5 @@ concurrency: cancel-in-progress: true jobs: - mutation: - name: PHP 8.5 - - env: - COMPOSER_ROOT_VERSION: 2.0.1 - - runs-on: ubuntu-latest - - services: - postgres: - image: postgres:18 - env: - POSTGRES_DB: yiitest - POSTGRES_USER: root - POSTGRES_PASSWORD: root - ports: - - 5432:5432 - options: --name=postgres --health-cmd="pg_isready" --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: - php-version: 8.5 - extensions: pdo_pgsql - ini-values: memory_limit=-1 - coverage: pcov - - - name: Install Composer dependencies - uses: ramsey/composer-install@v3 - - - name: Remove unused dependencies of DB drivers - run: composer remove --dev yiisoft/db-sqlite yiisoft/db-mysql yiisoft/db-mssql yiisoft/db-oracle - - - name: Install PostgreSQL driver - uses: yiisoft/actions/install-packages@master - with: - composer-root-version: 2.0.1 - packages: >- - ['db-pgsql'] - - - name: Run infection - run: | - vendor/bin/infection --threads=2 --ignore-msi-with-no-mutations --test-framework-options="--testsuite=Pgsql" - env: - STRYKER_DASHBOARD_API_KEY: ${{ secrets.STRYKER_DASHBOARD_API_KEY }} + tests: + uses: yiisoft/actions/.github/workflows/db-mutation.yml@master diff --git a/.github/workflows/rector-cs.yml b/.github/workflows/rector-cs.yml index b716dafba..2babf6c03 100644 --- a/.github/workflows/rector-cs.yml +++ b/.github/workflows/rector-cs.yml @@ -25,4 +25,4 @@ jobs: token: ${{ secrets.YIISOFT_GITHUB_TOKEN }} with: repository: ${{ github.event.pull_request.head.repo.full_name }} - php: '8.1' + php: 8.1 diff --git a/.github/workflows/static.yml b/.github/workflows/static.yml index bbe4ab38d..d37ac693d 100644 --- a/.github/workflows/static.yml +++ b/.github/workflows/static.yml @@ -1,6 +1,6 @@ on: pull_request: - paths: + paths: &paths - 'src/**' - 'config/**' - '.github/workflows/static.yml' @@ -9,12 +9,7 @@ on: push: branches: ['master'] - paths: - - 'src/**' - - 'config/**' - - '.github/workflows/static.yml' - - 'psalm*.xml' - - 'composer.json' + paths: *paths name: Static analysis