feat: Advanced PWA Hardening & Offline Resilience #79
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 | |
| on: | |
| push: | |
| branches: [ "main" ] | |
| pull_request: | |
| branches: [ "main" ] | |
| jobs: | |
| laravel-tests: | |
| runs-on: ubuntu-latest | |
| env: | |
| DB_CONNECTION: sqlite | |
| DB_DATABASE: database/database.sqlite | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: shivammathur/setup-php@v2 | |
| with: | |
| php-version: '8.4' | |
| extensions: mb, dom, curl, libxml, sqlite3, pdo_sqlite | |
| - name: Copy .env | |
| run: php -r "file_exists('.env') || copy('.env.example', '.env');" | |
| - name: Create Database | |
| run: | | |
| mkdir -p database | |
| touch database/database.sqlite | |
| - name: Get Composer Cache Directory | |
| id: composer-cache | |
| run: | | |
| echo "dir=$(composer config cache-files-dir)" >> $GITHUB_OUTPUT | |
| - name: Cache Composer Dependencies | |
| uses: actions/cache@v4 | |
| with: | |
| path: ${{ steps.composer-cache.outputs.dir }} | |
| key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.lock') }} | |
| restore-keys: | | |
| ${{ runner.os }}-composer- | |
| - name: Install Dependencies | |
| run: composer install -q --no-ansi --no-interaction --no-progress --prefer-dist | |
| - name: Generate key | |
| run: php artisan key:generate | |
| - name: Directory Permissions | |
| run: chmod -R ug+rwx storage bootstrap/cache | |
| - name: Set up Node.js | |
| uses: actions/setup-node@v4 | |
| with: | |
| node-version: '20' | |
| cache: 'npm' | |
| - name: Install Node Dependencies & Build Assets | |
| run: | | |
| npm ci | |
| npm run build | |
| - name: Execute tests | |
| run: php artisan test |