Skip to content

Commit f7e3d96

Browse files
authored
Try out a suggested workflow
1 parent e9adcf4 commit f7e3d96

File tree

1 file changed

+42
-0
lines changed

1 file changed

+42
-0
lines changed

.github/workflows/laravel.yml

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
name: Laravel
2+
3+
on:
4+
push:
5+
branches: [ "main" ]
6+
pull_request:
7+
branches: [ "main" ]
8+
9+
jobs:
10+
laravel-tests:
11+
12+
runs-on: ubuntu-latest
13+
14+
steps:
15+
- uses: shivammathur/setup-php@15c43e89cdef867065b0213be354c2841860869e
16+
with:
17+
php-version: '8.4'
18+
19+
- uses: actions/checkout@v4
20+
21+
- name: Copy .env
22+
run: php -r "file_exists('.env') || copy('.env.example', '.env');"
23+
24+
- name: Install Dependencies
25+
run: composer install -q --no-ansi --no-interaction --no-scripts --no-progress --prefer-dist
26+
27+
- name: Generate key
28+
run: php artisan key:generate
29+
30+
- name: Directory Permissions
31+
run: chmod -R 777 storage bootstrap/cache
32+
33+
- name: Create Database
34+
run: |
35+
mkdir -p database
36+
touch database/database.sqlite
37+
38+
- name: Execute tests (Unit and Feature tests) via PHPUnit/Pest
39+
env:
40+
DB_CONNECTION: sqlite
41+
DB_DATABASE: database/database.sqlite
42+
run: php artisan test

0 commit comments

Comments
 (0)