Merge pull request #98 from hisabi-app/dependabot/npm_and_yarn/multi-… #162
This file contains hidden or 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 12 Tests (SQLite + Frontend) | |
| on: | |
| push: | |
| branches: [ "main" ] | |
| pull_request: | |
| branches: [ "main" ] | |
| jobs: | |
| laravel-tests: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v4 | |
| - name: Set up PHP | |
| uses: shivammathur/setup-php@v2 | |
| with: | |
| php-version: '8.3' | |
| extensions: mbstring, bcmath, sqlite | |
| coverage: none | |
| - name: Set up Node.js | |
| uses: actions/setup-node@v4 | |
| with: | |
| node-version: '22' | |
| cache: 'npm' | |
| - name: Cache Composer packages | |
| uses: actions/cache@v4 | |
| with: | |
| path: vendor | |
| key: composer-${{ hashFiles('**/composer.lock') }} | |
| restore-keys: composer- | |
| - name: Install PHP dependencies | |
| run: composer install --no-progress --prefer-dist --optimize-autoloader | |
| - name: Install Node.js dependencies | |
| run: npm install | |
| - name: Build frontend | |
| run: npm run build | |
| - name: Copy .env | |
| run: cp .env.example .env | |
| - name: Configure SQLite | |
| run: | | |
| php -r " | |
| file_put_contents('.env', preg_replace( | |
| '/DB_CONNECTION=.*/', | |
| 'DB_CONNECTION=sqlite', | |
| file_get_contents('.env') | |
| )); | |
| file_put_contents('.env', \"\nDB_DATABASE=:memory:\n\", FILE_APPEND); | |
| " | |
| - name: Generate application key | |
| run: php artisan key:generate | |
| - name: Run migrations | |
| run: php artisan migrate --force | |
| - name: Run Laravel tests | |
| run: php artisan test | |
| - name: Run frontend tests | |
| run: npm run test |