Merge pull request #2 from momcilovicluka/dependabot/composer/symfony… #31
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 Test & Format | |
on: | |
workflow_dispatch: | |
push: | |
branches: [ "master" ] | |
pull_request: | |
branches: [ "master" ] | |
jobs: | |
laravel-tests-format: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Cache dependencies | |
uses: actions/cache@v4 | |
with: | |
path: ~/.cache | |
key: ${{ runner.os }}-laraveltest | |
- name: Setup PHP | |
uses: shivammathur/setup-php@15c43e89cdef867065b0213be354c2841860869e | |
with: | |
php-version: '8.2' | |
- name: Checkout | |
uses: actions/checkout@v4 | |
- name: Copy .env | |
run: php -r "file_exists('.env') || copy('.env.example', '.env');" | |
- name: Install Dependencies | |
run: | | |
composer install -q --no-ansi --no-interaction --no-scripts --no-progress --prefer-dist | |
npm install | |
npm run build | |
- name: Generate key | |
run: php artisan key:generate | |
- name: Directory Permissions | |
run: chmod -R 777 storage bootstrap/cache | |
- name: Create Database | |
run: | | |
mkdir -p database | |
touch database/database.sqlite | |
php artisan migrate:fresh | |
php artisan db:seed | |
- name: Execute tests (Unit and Feature tests) via PHPUnit/Pest | |
run: | | |
touch database/testing.sqlite | |
php artisan test | |
- name: Run Pint | |
run: composer exec pint | |
- name: Push Changes to Master | |
if: success() | |
run: | | |
git config --local user.email "41898282+github-actions[bot]@users.noreply.github.com" | |
git config --local user.name "github-actions[bot]" | |
git add . | |
git commit -m "⚡ Fix code style via Pint" || echo "No changes to commit" | |
git push origin master | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |