-
Notifications
You must be signed in to change notification settings - Fork 40
78 lines (65 loc) · 2.12 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
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
name: Run Tests
on: [push, pull_request]
jobs:
test:
runs-on: ${{ matrix.os }}
services:
mysql:
image: mysql:8.0.25
env:
MYSQL_ROOT_PASSWORD: passw0rd
MYSQL_DATABASE: lh_ehr
ports:
- 33306:3306
options: --health-cmd="mysqladmin ping" --health-interval=10s --health-timeout=5s --health-retries=3
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest]
php: [8.1]
dependency-version: [prefer-stable]
name: P${{ matrix.php }} - ${{ matrix.dependency-version }} - ${{ matrix.os }}
steps:
- name: Checkout code
uses: actions/checkout@v3
- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php }}
extensions: dom, curl, libxml, mbstring, zip, pcntl, pdo, sqlite, pdo_sqlite, bcmath, soap, intl, gd, exif, iconv, imagick, fileinfo
coverage: none
- name: Install dependencies
run: composer install -q --no-ansi --no-interaction --no-scripts --no-suggest --no-progress --prefer-dist
- name: Install NPM dependencies
run: npm install
- name: Compile assets
run: npm run production
- name: Copy .env && Generate keys (Application and Passport)
run: |
cp .env.ci .env
composer clear-all
php artisan key:generate
env:
DB_CONNECTION: mysql
DB_DATABASE: lh_ehr
DB_PORT: ${{ job.services.mysql.ports[3306] }}
DB_USER: root
DB_PASSWORD: passw0rd
- name: Run sample Migrations
run: |
php artisan migrate --force
yes | php artisan db:seed
env:
DB_CONNECTION: mysql
DB_DATABASE: lh_ehr
DB_PORT: ${{ job.services.mysql.ports[3306] }}
DB_USER: root
DB_PASSWORD: passw0rd
- name: Execute & Run tests
run: vendor/bin/phpunit
env:
DB_CONNECTION: mysql
DB_DATABASE: lh_ehr
DB_PORT: ${{ job.services.mysql.ports[3306] }}
DB_USER: root
DB_PASSWORD: passw0rd