-
Notifications
You must be signed in to change notification settings - Fork 97
50 lines (41 loc) · 1.47 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
name: build
on:
push:
branches: [ 2.x ]
pull_request:
branches: [ 2.x ]
jobs:
run:
runs-on: ${{ matrix.operating-system }}
strategy:
matrix:
operating-system: [ubuntu-latest]
php-versions: ['7.4', '8.0', '8.1', '8.2']
name: PHP ${{ matrix.php-versions }}
steps:
- uses: actions/checkout@v2
- name: "Setup MySQL"
run: |
sudo service mysql start
sudo mysql -uroot -proot -h 127.0.0.1 -e "CREATE DATABASE shieldon_unittest;"
sudo mysql -uroot -proot -h 127.0.0.1 -e "GRANT ALL ON shieldon_unittest.* TO 'shieldon'@'localhost' IDENTIFIED WITH mysql_native_password BY 'taiwan';"
- name: "Setup Redis"
run: |
sudo apt-get install -y redis-server
sudo service redis-server start
- name: "Setup PHP with Xdebug"
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php-versions }}
extensions: mbstring, pdo, pdo_mysql, intl, zip, redis, ctype, json, gd
coverage: xdebug
- name: "Setup test directory"
run: |
sudo mkdir /home/runner/work/shieldon/shieldon/tmp
sudo chmod 0777 /home/runner/work/shieldon/shieldon/tmp
- name: "Install dependencies"
run: |
composer update --prefer-dist --no-interaction --no-suggest
- name: "Run tests"
run: |
composer test