Proje Kurulumu #4
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Laravel | |
on: | |
push: | |
branches: [ "master" ] | |
pull_request: | |
branches: [ "master" ] | |
jobs: | |
laravel-tests: | |
runs-on: ubuntu-22.04 | |
steps: | |
- uses: shivammathur/setup-php@15c43e89cdef867065b0213be354c2841860869e | |
with: | |
php-version: '8.1' | |
- uses: actions/checkout@v4 | |
- name: Copy .env if not exists | |
run: php -r "file_exists('project/.env') || copy('project/.env.example', 'project/.env');" | |
- name: Clear Composer Cache | |
run: composer clear-cache | |
- name: Install Dependencies | |
run: composer install -q --no-ansi --no-interaction --no-scripts --no-progress --prefer-dist -d project | |
- name: Install Dependencies | |
run: npm install -q --no-ansi --no-interaction --no-scripts --no-progress --prefer-dist -d project | |
- name: Generate key if not exists | |
run: | | |
if ! grep -q "APP_KEY=" project/.env; then | |
php -r "echo 'APP_KEY=' . bin2hex(random_bytes(32)) . PHP_EOL;" >> project/.env | |
fi | |
- name: Directory Permissions | |
run: chmod -R 777 project/storage project/bootstrap/cache | |
- name: Create Database | |
run: | | |
mkdir -p database | |
touch database/database.sql | |
- name: Execute tests (Unit and Feature tests) via PHPUnit/Pest | |
run: php artisan test |