10000 Create laravel.yml · Rihanrh/laravel-10-crud-cicd@11bea94 · GitHub
[go: up one dir, main page]

Skip to content

Commit 11bea94

Browse files
authored
Create laravel.yml
1 parent ce8177a commit 11bea94

File tree

1 file changed

+47
-0
lines changed

1 file changed

+47
-0
lines changed

.github/workflows/laravel.yml

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

0 commit comments

Comments
 (0)
0