Skip to content
This repository was archived by the owner on Mar 15, 2023. It is now read-only.

Commit 7f51494

Browse files
committed
Use matrix & migrations
1 parent 8130e45 commit 7f51494

File tree

1 file changed

+46
-6
lines changed

1 file changed

+46
-6
lines changed

.github/workflows/test.yml

+46-6
Original file line numberDiff line numberDiff line change
@@ -3,15 +3,55 @@ name: Run Codeception test cases
33
on: [push]
44

55
jobs:
6-
build:
6+
tests:
7+
name: PHP ${{ matrix.php }} on ${{ matrix.os }}
8+
runs-on: ${{ matrix.os }}
79

8-
runs-on: ubuntu-latest
10+
strategy:
11+
fail-fast: false
12+
matrix:
13+
os: [ubuntu-latest]
14+
php: ['7.3']
15+
16+
services:
17+
mysql:
18+
image: mysql:5.7
19+
env:
20+
MYSQL_ROOT_PASSWORD: root
21+
MYSQL_DATABASE: password
22+
ports:
23+
- 3306:3306
24+
options: --health-cmd="mysqladmin ping" --health-interval=10s --health-timeout=5s --health-retries=3
925

1026
steps:
11-
- uses: actions/checkout@v2
27+
- name: Checkout
28+
uses: actions/checkout@v2
29+
30+
- name: Install PHP
31+
uses: shivammathur/setup-php@v2
32+
with:
33+
php-version: ${{ matrix.php }}
34+
tools: pecl
35+
extensions: curl
36+
37+
- name: Get composer cache directory
38+
id: composer-cache
39+
run: echo "::set-output name=dir::$(composer config cache-files-dir)"
40+
41+
- name: Cache composer dependencies
42+
uses: actions/cache@v1
43+
with:
44+
path: ${{ steps.composer-cache.outputs.dir }}
45+
key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.lock') }}
46+
restore-keys: ${{ runner.os }}-composer-
1247

1348
- name: Install dependencies
14-
run: composer install
15-
49+
run: composer update $DEFAULT_COMPOSER_FLAGS
50+
51+
- name: DB migrations
52+
run: ./yii_test migrate --migrationPath=src/migrations/ --interactive=0
53+
1654
- name: Run test cases
17-
run: php vendor/bin/codecept run
55+
run: php vendor/bin/codecept run
56+
57+

0 commit comments

Comments
 (0)