-
Notifications
You must be signed in to change notification settings - Fork 0
55 lines (46 loc) · 1.28 KB
/
Copy pathphpunit.yml
File metadata and controls
55 lines (46 loc) · 1.28 KB
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
name: PHP Unit Tests
on:
push:
branches: [ main, master ]
pull_request:
branches: [ main, master ]
jobs:
test:
runs-on: ubuntu-latest
services:
mysql:
image: mysql:8.0
env:
MYSQL_ROOT_PASSWORD: rootpass
MYSQL_DATABASE: anne_chat
ports:
- 3306:3306
options: >-
--health-cmd="mysqladmin ping --silent"
--health-interval=10s
--health-timeout=5s
--health-retries=3
env:
DB_HOST: 127.0.0.1
DB_PORT: 3306
DB_NAME: anne_chat
DB_USER: root
DB_PASSWORD: rootpass
steps:
- uses: actions/checkout@v4
- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: '8.1'
extensions: mbstring, pdo_mysql
- name: Install Composer dependencies
run: composer install --no-interaction --prefer-dist
- name: Wait for MySQL
run: |
for i in {1..30}; do
mysql -h 127.0.0.1 -P 3306 -u root -prootpass -e "SELECT 1" && break || sleep 1
done
- name: Import schema
run: mysql -h 127.0.0.1 -P 3306 -u root -prootpass anne_chat < database/schema.sql
- name: Run tests
run: vendor/bin/phpunit -c phpunit.xml --testdox