63 lines (53 loc) · 1.55 KB
/
test-integration.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
name: Test Integration
on:
schedule:
- cron: '0 10 * * *'
jobs:
test:
name: Test on PHP ${{ matrix.php-versions }}
runs-on: ubuntu-20.04
env:
TEST_DATABASE_HOST: '127.0.0.1'
TEST_DATABASE_PORT: '8888'
TEST_DATABASE_NAME: integration_test
TEST_DATABASE_USER: root
TEST_DATABASE_PASSWORD: password
services:
mysql:
image: mysql:8.0
env:
MYSQL_ALLOW_EMPTY_PASSWORD: false
MYSQL_ROOT_PASSWORD: password
MYSQL_DATABASE: integration_test
ports:
- '8888:3306'
options: --health-cmd="mysqladmin ping" --health-interval=10s --health-timeout=5s --health-retries=3
strategy:
fail-fast: false
matrix:
php-versions: ['8.1', '8.3']
branches: ['master']
steps:
- uses: actions/checkout@v2
with:
ref: ${{ matrix.branches }}
- name: Setup Node.js
uses: actions/setup-node@v1
with:
node-version: 16.x
- name: Setup PHP with Composer
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php-versions }}
tools: composer:v2
ini-values: memory_limit=1024M
- name: Start MySQL service
run: sudo systemctl start mysql
- name: Create DB table
run: mysql -h 127.0.0.1 --port 8888 -u root -ppassword -e 'CREATE DATABASE IF NOT EXISTS integration_test;'
- name: NPM install
run: npm install
- name: Build
run: grunt test
- name: Integration testing
run: vendor/bin/phpunit tests/integration