fix: worflow (#132) #365
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 | |
| strategy: | |
| matrix: | |
| php-version: ['8.4'] | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v4 | |
| - name: Setup PHP | |
| uses: shivammathur/setup-php@v2 | |
| with: | |
| php-version: ${{ matrix.php-version }} | |
| extensions: dom, curl, libxml, mbstring, zip, pcntl, pdo, sqlite, pdo_sqlite, bcmath, soap, intl, gd, exif, iconv | |
| coverage: none | |
| - name: Setup Node.js | |
| uses: actions/setup-node@v4 | |
| with: | |
| node-version: '20' | |
| cache: 'npm' | |
| - name: Cache Composer packages | |
| uses: actions/cache@v3 | |
| with: | |
| path: vendor | |
| key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.lock') }} | |
| restore-keys: | | |
| ${{ runner.os }}-composer- | |
| - name: Copy .env | |
| run: php -r "file_exists('.env') || copy('.env.example', '.env');" | |
| - name: Install Composer Dependencies | |
| run: composer install -q --no-ansi --no-interaction --no-scripts --no-progress --prefer-dist --optimize-autoloader | |
| - name: Install NPM Dependencies | |
| run: npm ci | |
| - name: Build Assets | |
| run: npm run build | |
| - name: Generate Application Key | |
| run: php artisan key:generate | |
| - name: Set Directory Permissions | |
| run: chmod -R 777 storage bootstrap/cache | |
| - name: Execute Tests | |
| run: vendor/bin/pest --parallel |