Merge pull request #2 from yatharth-vataliya/code-cleanup #47
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: Vue App Tests | |
| on: | |
| push: | |
| branches: | |
| - main | |
| pull_request: | |
| types: [ opened, synchronize, reopened ] | |
| jobs: | |
| test: | |
| runs-on: ubuntu-latest | |
| env: | |
| APP_URL: "http://127.0.0.1:8000" | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| php: [ 8.3 ] | |
| laravel: [ 11.* ] | |
| dependency-version: [ prefer-stable ] | |
| name: "P:${{ matrix.php }}, L:${{ matrix.laravel }}, V: ${{ matrix.dependency-version }}" | |
| steps: | |
| - name: Checkout Code | |
| uses: actions/checkout@v4 | |
| - name: Cache Composer Dependencies | |
| uses: actions/cache@v4 | |
| with: | |
| path: ~/.cache/composer | |
| key: composer-app-vue-${{ matrix.laravel }}-${{ matrix.php }}-${{ hashFiles('apps/vue/composer.json') }} | |
| - name: Setup PHP | |
| uses: shivammathur/setup-php@v2 | |
| with: | |
| php-version: ${{ matrix.php }} | |
| extensions: dom, curl, libxml, mbstring, zip, pcntl, pdo, sqlite, pdo_sqlite, bcmath, soap, intl, gd, exif, iconv, imagick | |
| - name: Setup Node.js | |
| uses: actions/setup-node@v4 | |
| with: | |
| node-version: '20' | |
| cache: 'npm' | |
| cache-dependency-path: 'apps/vue/package-lock.json' | |
| - name: Install PHP Dependencies | |
| working-directory: apps/vue | |
| run: | | |
| composer self-update | |
| composer update --${{ matrix.dependency-version }} --prefer-dist --no-interaction | |
| php artisan --version | |
| - name: Copy Environment File | |
| working-directory: apps/vue | |
| run: | | |
| cp .env.example .env | |
| php artisan key:generate | |
| - name: Install Node Dependencies | |
| working-directory: apps/vue | |
| run: npm ci | |
| # Install Rollup's Linux-specific optional dependency explicitly | |
| # This is needed due to an npm bug with optional dependencies: | |
| # https://github.com/npm/cli/issues/4828 | |
| - name: Install Rollup Linux Dependencies | |
| working-directory: packages/vue | |
| run: npm install @rollup/rollup-linux-x64-gnu | |
| - name: Install Rollup Linux Dependencies | |
| working-directory: apps/vue | |
| run: npm install @rollup/rollup-linux-x64-gnu | |
| - name: Build Assets | |
| working-directory: apps/vue | |
| run: npm run build | |
| - name: Install Playwright Browsers | |
| working-directory: apps/vue | |
| run: npx playwright install --with-deps | |
| - name: Run Laravel Server | |
| working-directory: apps/vue | |
| run: php artisan serve --no-reload & | |
| - name: Run Playwright tests | |
| working-directory: apps/vue | |
| run: npx playwright test | |
| - uses: actions/upload-artifact@v4 | |
| if: ${{ !cancelled() }} | |
| with: | |
| name: playwright-report | |
| path: apps/vue/playwright/reports/ | |
| retention-days: 30 |