-
Notifications
You must be signed in to change notification settings - Fork 65
56 lines (48 loc) · 1.43 KB
/
run-tests.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
on:
push:
branches: [master]
pull_request:
branches: [master]
jobs:
run-tests:
runs-on: ubuntu-latest
strategy:
matrix:
php-versions: ['8.0']
services:
mysql-service:
image: mysql:5.7
env:
MYSQL_ROOT_PASSWORD: password
MYSQL_DATABASE: test
ports:
- 32574:3306
options: --health-cmd="mysqladmin ping" --health-interval=10s --health-timeout=5s --health-retries=3
steps:
- uses: actions/checkout@v2
- uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php-versions }}
extensions: mbstring, intl
tools: composer:v2
coverage: none
- name: Get composer cache directory
id: composer-cache
run: echo "::set-output name=dir::$(composer config cache-files-dir)"
- name: Cache dependencies
uses: actions/cache@v2
with:
path: ${{ steps.composer-cache.outputs.dir }}
key: ${{ runner.os }}-${{ matrix.php-versions }}-composer-${{ hashFiles('**/composer.json') }}
restore-keys: ${{ runner.os }}-composer-
- name: Install dependencies
run: composer install --prefer-dist
- name: Run tests
env:
TEST_DB_HOST: 127.0.0.1
TEST_DB_PORT: 32574
TEST_DB_USER: root
TEST_DB_PASS: password
TEST_DB_NAME: test
run: |
composer run test