-
Notifications
You must be signed in to change notification settings - Fork 61
59 lines (49 loc) · 1.49 KB
/
test_build.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: Test Build
on:
pull_request:
push:
branches:
- main
jobs:
test:
name: PHP 8.1, Laravel 9.*
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Set up PHP
uses: shivammathur/setup-php@v2
with:
php-version: 8.1
- name: Cache Composer dependencies
uses: actions/cache@v1
with:
path: ~/.composer/cache/files
key: php-8.1-laravel-9.*-composer-${{ hashFiles('**/composer.lock') }}
restore-keys: php-8.1-laravel-9`.*-composer-
- name: Cache npm dependencies
uses: actions/cache@v1
with:
path: ~/.npm
key: npm-${{ hashFiles('**/package-lock.json') }}
restore-keys: npm-
- name: Copy ENV Laravel Configuration for CI
run: php -r "file_exists('.env') || copy('.env.example', '.env');"
- name: Install dependencies
run: |
composer install --prefer-dist --no-interaction --no-progress --no-suggest
npm install
- name: Build Assets
run: npm run prod
- name: Generate key
run: php artisan key:generate
- name: Create DB and schemas
env:
DB_CONNECTION: sqlite
DB_DATABASE: database/novapackages.sqlite
run: |
mkdir -p database
touch database/novapackages.sqlite
php artisan migrate
- name: Run PHP tests
run: vendor/bin/phpunit --exclude-group integration