Skip to content

Commit d44f23f

Browse files
committed
Merge remote-tracking branch 'origin/master'
2 parents edd7bc7 + 25bcafc commit d44f23f

File tree

1 file changed

+54
-0
lines changed

1 file changed

+54
-0
lines changed

.github/workflows/tests.yml

+54
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,54 @@
1+
name: PHP Tests
2+
on: [push, pull_request]
3+
jobs:
4+
build:
5+
6+
runs-on: ubuntu-latest
7+
8+
services:
9+
mysql:
10+
image: mysql:5.7
11+
env:
12+
MYSQL_ROOT_PASSWORD: root
13+
MYSQL_DATABASE: mysqlreplication_test
14+
ports:
15+
- 3306/tcp
16+
17+
strategy:
18+
matrix:
19+
php: [ '7.3', '7.4', '8.0' ]
20+
21+
steps:
22+
- name: Checkout
23+
uses: actions/checkout@v2
24+
25+
- name: Start mysql service
26+
run: |
27+
echo -e "\n[mysqld]\nserver-id=1\nbinlog_format=row\nlog_bin=/var/log/mysql/mysql-bin.log" | sudo tee -a /etc/mysql/my.cnf
28+
sudo /etc/init.d/mysql start
29+
mysql_tzinfo_to_sql /usr/share/zoneinfo | mysql -u root mysql -proot
30+
31+
- name: Setup PHP, with composer and extensions
32+
uses: shivammathur/setup-php@v2
33+
with:
34+
php-version: ${{ matrix.php }}
35+
coverage: xdebug
36+
37+
- name: Validate composer.json and composer.lock
38+
run: composer validate
39+
40+
- name: Cache Composer packages
41+
id: composer-cache
42+
uses: actions/cache@v2
43+
with:
44+
path: vendor
45+
key: ${{ runner.os }}-${{ matrix.php }}-${{ hashFiles('**/composer.lock') }}
46+
restore-keys: |
47+
${{ runner.os }}-${{ matrix.php }}-
48+
49+
- name: Install dependencies
50+
if: steps.composer-cache.outputs.cache-hit != 'true'
51+
run: composer install --prefer-dist --no-progress --no-suggest
52+
53+
- name: Run tests
54+
run: vendor/bin/phpunit --coverage-text

0 commit comments

Comments
 (0)