-
Notifications
You must be signed in to change notification settings - Fork 0
59 lines (47 loc) · 1.41 KB
/
ci-cd.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
name: ci/cd workflow
on:
push:
branches:
- main
- feature/*
pull_request:
jobs:
tests:
runs-on: ubuntu-latest
strategy:
matrix:
php: [8.1]
name: Test - PHP ${{ matrix.php }}
steps:
- name: Checkout code
uses: actions/checkout@v2
- name: Cache PHP dependencies
uses: actions/cache@v1
with:
path: vendor
key: dependencies-php-${{ matrix.php }}-composer-${{ hashFiles('**/composer.lock') }}
- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php }}
extensions: dom, curl, libxml, mbstring, zip, pcntl, pdo, sqlite, pdo_sqlite, gd
coverage: none
- name: Copy ENV Laravel Configuration for CI
run: php -r "file_exists('.env') || copy('.env.example', '.env');"
- name: Install dependencies
run: composer install --no-ansi --no-interaction --no-scripts --no-progress --prefer-dist
- name: Generate app key
run: php artisan key:generate
- name: Optimize app
run: php artisan optimize
- name: Dump autoload
run: composer dump
- name: Execute tests
run: php artisan test
env:
APP_ENV: local
APP_URL: "http://127.0.0.1:8000"
DB_CONNECTION: mysql
DB_DATABASE: ZIPCODESDB
DB_PORT: ${{ job.services.mysql.ports[3306] }}
DB_USER: root