Skip to content

Commit 2614b54

Browse files
Modify phpunit.yml file
1 parent 78a6d29 commit 2614b54

File tree

1 file changed

+32
-19
lines changed

1 file changed

+32
-19
lines changed

.github/workflows/phpunit.yml

Lines changed: 32 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1,26 +1,39 @@
1-
name: Run PHPUnit Tests
1+
name: Laravel
22

33
on:
44
push:
5-
branches:
6-
- master
5+
branches: [ master ]
6+
pull_request:
7+
branches: [ master ]
78

89
jobs:
9-
run_tests:
10-
name: Run PHPUnit Tests
11-
runs-on: ubuntu-latest
10+
laravel-tests:
1211

12+
runs-on: ubuntu-latest
13+
1314
steps:
14-
- name: Checkout repository
15-
uses: actions/checkout@v2
16-
17-
- name: Setup PHP
18-
uses: shivammathur/setup-php@v2
19-
with:
20-
php-version: '8.1'
21-
22-
- name: Install dependencies
23-
run: composer update --ignore-platform-req=ext-iconv
24-
25-
- name: Run PHPUnit
26-
run: php artisan test
15+
- uses: actions/checkout@v2
16+
- name: Copy .env
17+
run: php -r "file_exists('.env') || copy('.env.example', '.env');"
18+
- name: Install Dependencies
19+
run: composer install -q --no-ansi --no-interaction --no-scripts --no-progress
20+
- name: Generate key
21+
run: php artisan key:generate
22+
- name: Directory Permissions
23+
run: chmod -R 777 storage bootstrap/cache
24+
- name: Create Database
25+
run: |
26+
mkdir -p database
27+
touch database/database.sqlite
28+
- name: Compile assets
29+
run: |
30+
npm install
31+
npm run development
32+
- name: Execute tests (Unit and Feature tests) via PHPUnit
33+
env:
34+
DB_CONNECTION: sqlite
35+
DB_DATABASE: database/database.sqlite
36+
CACHE_DRIVER: array
37+
SESSION_DRIVER: array
38+
QUEUE_DRIVER: sync
39+
run: vendor/bin/phpunit

0 commit comments

Comments
 (0)