-
Notifications
You must be signed in to change notification settings - Fork 2
69 lines (57 loc) · 1.86 KB
/
php.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
name: PHPUnit
on:
push:
branches: [ master ]
pull_request:
branches: [ master ]
jobs:
build:
runs-on: ubuntu-latest
services:
mysql:
image: mysql:latest
env:
MYSQL_ALLOW_EMPTY_PASSWORD: true
MYSQL_DATABASE: mp_test
ports:
- 3306/tcp
options: --health-cmd="mysqladmin ping" --health-interval=5s --health-timeout=2s --health-retries=3
env:
extensions: intl,memcached,apcu,mysql
strategy:
matrix:
php: ['7.4', '8.0', '8.1', '8.2', '8.3']
db: ['mysql', 'sqlite']
fail-fast: false
steps:
- uses: actions/checkout@v2
- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
coverage: "none"
ini-values: date.timezone=Europe/Berlin
php-version: "${{ matrix.php }}"
extensions: "${{ env.extensions }}"
- name: Start MySQL service
if: "${{ matrix.db == 'mysql' }}"
run: |
mysql --host=localhost --port=${{ job.services.mysql.ports[3306] }} --protocol=TCP -u root -e 'create database IF NOT EXISTS mp_test;'
- name: Cache Composer packages
id: composer-cache
uses: actions/cache@v2
with:
path: vendor
key: ${{ runner.os }}-php-${{ hashFiles('**/composer.lock') }}
restore-keys: |
${{ runner.os }}-php-${{ matrix.php }}
- name: Install dependencies
run: composer install --prefer-dist --no-progress
- name: Run test suite
# PHP 7.3 mysql ext complains about unknown MySQL authentication method,
# and older MySQL does not work with current GH 7.4 and 8.0 images,
# so for now, we skip one of the 7.3 tasks
if: "${{ matrix.db != 'mysql' || matrix.php != '7.3'}}"
run: vendor/bin/phpunit
env:
DB: travis/${{ matrix.db }}
MYSQL_PORT: ${{ job.services.mysql.ports[3306] }}