-
Notifications
You must be signed in to change notification settings - Fork 0
61 lines (51 loc) · 1.54 KB
/
main.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
name: API Base Push Test
on:
push:
branches: [master, db-pgsql]
pull_request:
branches: [master, db-pgsql]
jobs:
lumen-api-tests:
runs-on: ubuntu-latest
services:
mysql:
image: mysql
ports:
- 3306:3306
env:
MYSQL_USER: user
MYSQL_PASSWORD: password
MYSQL_DATABASE: test
MYSQL_ROOT_PASSWORD: password
options: --health-cmd="mysqladmin ping" --health-interval=5s --health-timeout=2s --health-retries=3
steps:
- uses: actions/checkout@v2
- name: Cache composer dependencies
uses: actions/cache@v2
with:
path: vendor
key: composer-${{ hashFiles('composer.lock') }}
- name: Run composer install
run: |
composer install -n --prefer-dist --no-interaction --no-suggest
composer dump-autoload
- name: Prepare Laravel application
run: |
cp .env.ci .env
php artisan key:generate
php artisan cache:clear
- name: Run Migrations
run: |
php artisan migrate:fresh
env:
PORT: ${{ job.services.mysql.ports[3306] }}
- name: Execute tests (Unit and Feature tests) via PHPUnit (PEST)
run: ./vendor/bin/pest
env:
PORT: ${{ job.services.mysql.ports[3306] }}
- name: Upload artifacts
uses: actions/upload-artifact@v2
if: failure()
with:
name: Logs
path: ./storage/logs