This repository was archived by the owner on May 14, 2020. It is now read-only.
forked from B-Galati/gh-archive-keyword
-
Notifications
You must be signed in to change notification settings - Fork 0
48 lines (46 loc) · 1.62 KB
/
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
name: Run tests
on: [push]
jobs:
test-unit:
name: Run unit tests
runs-on: ubuntu-latest
services:
mysql:
image: mysql:5.7
env:
MYSQL_DATABASE: api_db
MYSQL_ROOT_PASSWORD: testbench
MYSQL_USER: sys
MYSQL_PASSWORD: password
options: --health-cmd="mysqladmin ping" --health-interval=10s --health-timeout=5s --health-retries=3
ports:
- "3308:3306"
steps:
- name: Checkout repository
uses: actions/checkout@v2
- name: Use php 7.3
uses: shivammathur/setup-php@v2
with:
php-version: 7.3
extensions: fileinfo, dom, tokenizer, simplexml, curl
coverage: none
- name: Cache module
uses: actions/[email protected]
with:
path: ~/.composer/cache/
key: composer-cache
- name: Install dependencies
run: |
php -v && composer --version
composer install --no-suggest --no-interaction --optimize-autoloader
- name: Run unit tests
env:
DB_HOST: 127.0.0.1
DB_PORT: ${{ job.services.mysql.ports['3306'] }}
DB_DATABASE: api_db
DB_USERNAME: sys
DB_PASSWORD: password
APP_ENV: testing
run: |
php artisan migrate
composer run phpunit