mirror of
https://github.com/yiisoft/yii2.git
synced 2026-02-20 00:32:19 +01:00
73 lines
1.9 KiB
YAML
73 lines
1.9 KiB
YAML
---
|
|
name: ci-mysql
|
|
|
|
permissions:
|
|
contents: read
|
|
pull-requests: write
|
|
|
|
on:
|
|
- pull_request
|
|
- push
|
|
|
|
concurrency:
|
|
group: ${{ github.workflow }}-${{ github.ref }}
|
|
cancel-in-progress: true
|
|
|
|
jobs:
|
|
tests:
|
|
name: PHP ${{ matrix.php }}-mysql-${{ matrix.mysql }}
|
|
|
|
env:
|
|
COVERAGE_DRIVER: ${{ matrix.php == 7.4 && 'xdebug' || 'none' }}
|
|
PHP_EXTENSIONS: curl, intl, pdo, pdo_mysql
|
|
PHP_INI_VALUES: apc.enabled=1,apc.shm_size=32M,apc.enable_cli=1, date.timezone='UTC'
|
|
PHPUNIT_GROUP: mysql
|
|
XDEBUG_MODE: coverage
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
strategy:
|
|
fail-fast: false
|
|
matrix:
|
|
php: [7.4, 8.0, 8.1, 8.2, 8.3, 8.4]
|
|
mysql: [5.7, latest]
|
|
|
|
services:
|
|
mysql:
|
|
image: mysql:${{ matrix.mysql }}
|
|
env:
|
|
MYSQL_ROOT_PASSWORD: root
|
|
MYSQL_DATABASE: yiitest
|
|
ports:
|
|
- 3306:3306
|
|
options: >-
|
|
--name=mysql
|
|
--health-cmd="mysqladmin ping"
|
|
--health-interval=10s
|
|
--health-retries=3
|
|
--health-timeout=5s
|
|
--mount type=tmpfs,destination=/var/lib/mysql
|
|
|
|
steps:
|
|
- name: Monitor action permissions.
|
|
if: runner.os != 'Windows'
|
|
uses: GitHubSecurityLab/actions-permissions/monitor@v1
|
|
|
|
- name: Checkout.
|
|
uses: actions/checkout@v5
|
|
|
|
- name: Setup PHP with Composer.
|
|
uses: ./.github/actions/php-setup
|
|
with:
|
|
coverage-driver: ${{ env.COVERAGE_DRIVER }}
|
|
extensions: ${{ matrix.php < 8.0 && 'apc' || 'apcu' }}, ${{ env.PHP_EXTENSIONS }}
|
|
ini-values: ${{ env.PHP_INI_VALUES }}, session.save_path="${{ runner.temp }}"
|
|
php-version: ${{ matrix.php }}
|
|
|
|
- name: Run PHPUnit tests.
|
|
uses: ./.github/actions/phpunit
|
|
with:
|
|
coverage-driver: ${{ env.COVERAGE_DRIVER }}
|
|
coverage-token: ${{ secrets.CODECOV_TOKEN }}
|
|
group: ${{ env.PHPUNIT_GROUP }}
|