-
Notifications
You must be signed in to change notification settings - Fork 5
57 lines (45 loc) · 1.31 KB
/
test.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
name: PHPUnit
on:
push:
pull_request:
schedule:
- cron: '0 0 * * *'
jobs:
test:
runs-on: ubuntu-22.04
strategy:
fail-fast: false
matrix:
php: [ 8.0, 8.1, 8.2 ]
swoole: [ '', swoole ]
name: PHP ${{ matrix.php }} ${{ matrix.swoole }}
steps:
- name: Checkout code
uses: actions/checkout@v3
- name: Start MySQL
run: docker compose up -d mysql mysql1
- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php }}
extensions: pdo, pdo_mysql, ${{ matrix.swoole }}
ini-values: error_reporting=E_ALL
tools: composer:v2
coverage: none
- name: Composer install
run: composer install
- name: Static analysis
run: composer analyse
- name: Wait for MySQL
run: |
while ! docker compose exec mysql mysql --user=root --password=root -e "SELECT 1" >/dev/null 2>&1 || ! docker compose exec mysql1 mysql --user=root --password=root -e "SELECT 1" >/dev/null 2>&1; do
sleep 1
done
- name: Run tests
env:
MYSQL_HOST: 127.0.0.1
MYSQL_PORT: 33060
MYSQL1_PORT: 33061
run: composer test
- name: Close MySQL
run: docker compose down