|
1 | | -on: |
2 | | - pull_request: |
| 1 | +--- |
| 2 | + |
| 3 | +on: # yamllint disable-line rule:truthy |
3 | 4 | push: |
4 | 5 | branches: |
5 | 6 | - '*.*' |
| 7 | + - '*.*.*' |
| 8 | + pull_request: null |
6 | 9 |
|
7 | | -name: ci-mysql |
| 10 | +name: MySQL |
8 | 11 |
|
9 | 12 | jobs: |
10 | | - tests: |
11 | | - name: PHP ${{ matrix.php-version }}-mysql-${{ matrix.mysql-version }} |
12 | | - env: |
13 | | - extensions: curl, intl, pdo, pdo_mysql |
14 | | - key: cache-v1 |
15 | | - |
16 | | - runs-on: ${{ matrix.os }} |
17 | | - |
18 | | - strategy: |
19 | | - fail-fast: false |
20 | | - matrix: |
21 | | - os: |
22 | | - - ubuntu-latest |
23 | | - |
24 | | - php-version: |
25 | | - - "8.0" |
26 | | - - "8.1" |
27 | | - - "8.2" |
28 | | - - "8.3" |
29 | | - |
30 | | - mysql-version: |
31 | | - - "5.7" |
32 | | - - "8.0" |
33 | | - |
34 | | - services: |
35 | | - mysql: |
36 | | - image: mysql:${{ matrix.mysql-version }} |
37 | | - env: |
38 | | - MYSQL_ROOT_PASSWORD: root |
39 | | - MYSQL_DATABASE: spiral |
40 | | - MYSQL_AUTHENTICATION_PLUGIN: mysql_native_password |
41 | | - ports: |
42 | | - - 13306:3306 |
43 | | - options: --health-cmd="mysqladmin ping" --health-interval=10s --health-timeout=5s --health-retries=3 |
44 | | - |
45 | | - steps: |
46 | | - - name: Checkout |
47 | | - uses: actions/checkout@v2 |
48 | | - |
49 | | - - name: Setup cache environment |
50 | | - id: cache-env |
51 | | - uses: shivammathur/cache-extensions@v1 |
52 | | - with: |
53 | | - php-version: ${{ matrix.php-version }} |
54 | | - extensions: ${{ env.extensions }} |
55 | | - key: ${{ env.key }} |
56 | | - |
57 | | - - name: Cache extensions |
58 | | - uses: actions/cache@v2 |
59 | | - with: |
60 | | - path: ${{ steps.cache-env.outputs.dir }} |
61 | | - key: ${{ steps.cache-env.outputs.key }} |
62 | | - restore-keys: ${{ steps.cache-env.outputs.key }} |
63 | | - |
64 | | - - name: Install PHP with extensions |
65 | | - uses: shivammathur/setup-php@v2 |
66 | | - with: |
67 | | - php-version: ${{ matrix.php-version }} |
68 | | - extensions: ${{ env.extensions }} |
69 | | - ini-values: date.timezone='UTC' |
70 | | - coverage: pcov |
71 | | - |
72 | | - - name: Determine composer cache directory |
73 | | - if: matrix.os == 'ubuntu-latest' |
74 | | - run: echo "COMPOSER_CACHE_DIR=$(composer config cache-dir)" >> $GITHUB_ENV |
75 | | - |
76 | | - - name: Cache dependencies installed with composer |
77 | | - uses: actions/cache@v2 |
78 | | - with: |
79 | | - path: ${{ env.COMPOSER_CACHE_DIR }} |
80 | | - key: php${{ matrix.php-version }}-composer-${{ matrix.dependencies }}-${{ hashFiles('**/composer.json') }} |
81 | | - restore-keys: | |
82 | | - php${{ matrix.php-version }}-composer-${{ matrix.dependencies }}- |
83 | | -
|
84 | | - - name: Install dependencies with composer |
85 | | - if: matrix.php-version != '8.4' |
86 | | - run: composer update --prefer-dist --no-interaction --no-progress --optimize-autoloader --ansi |
87 | | - |
88 | | - - name: Install dependencies with composer php 8.4 |
89 | | - if: matrix.php-version == '8.4' |
90 | | - run: composer update --ignore-platform-reqs --prefer-dist --no-interaction --no-progress --optimize-autoloader --ansi |
| 13 | + phpunit: |
| 14 | + uses: cycle/gh-actions/.github/workflows/db-mysql.yml@master |
91 | 15 |
|
92 | | - - name: Run mysql tests with phpunit |
93 | | - env: |
94 | | - DB: mysql |
95 | | - MYSQL: ${{ matrix.mysql-version }} |
96 | | - run: vendor/bin/phpunit --group driver-mysql --colors=always |
| 16 | +... |
0 commit comments