-
Notifications
You must be signed in to change notification settings - Fork 57
53 lines (43 loc) · 1.37 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
name: Run tests
on:
pull_request:
push:
branches: [main]
jobs:
test:
name: PHP 8.2, Laravel 10.*
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Set up PHP
uses: shivammathur/setup-php@v2
with:
php-version: 8.2
- name: Cache Composer dependencies
uses: actions/cache@v3
with:
path: ~/.composer/cache/files
key: php-8.2-laravel-10.*-composer-${{ hashFiles('**/composer.lock') }}
restore-keys: php-8.2-laravel-10.*-composer-
- name: Cache npm dependencies
uses: actions/cache@v3
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');"
echo APP_ENV=testing >> $GITHUB_ENV
- name: Install dependencies
run: |
composer config "http-basic.nova.laravel.com" "${{ secrets.NOVA_USERNAME }}" "${{ secrets.NOVA_PASSWORD }}"
composer install --prefer-dist --no-interaction --no-progress
npm install
- name: Build Assets
run: npm run build
- name: Generate key
run: php artisan key:generate
- name: Run PHP tests
run: vendor/bin/phpunit