|
8 | 8 |
|
9 | 9 | jobs: |
10 | 10 | laravel-tests: |
11 | | - runs-on: ubuntu-24.04 |
| 11 | + runs-on: ubuntu-latest |
| 12 | + environment: Testing |
12 | 13 |
|
13 | 14 | steps: |
14 | 15 | - name: Checkout |
15 | | - uses: actions/checkout@v3 |
| 16 | + uses: actions/checkout@v4 |
| 17 | + - name: Setup PHP |
| 18 | + uses: shivammathur/setup-php@v2 |
16 | 19 | with: |
17 | | - # Make sure the actual branch is checked out when running on pull requests |
18 | | - ref: ${{ github.head_ref }} |
19 | | - # This is important to fetch the changes to the previous commit |
20 | | - fetch-depth: 0 |
21 | | - - uses: shivammathur/setup-php@v2 |
| 20 | + php-version: '8.4' |
| 21 | + - name: Install pnpm |
| 22 | + uses: pnpm/action-setup@v4 |
| 23 | + - name: Setup Node.js & pnpm |
| 24 | + uses: actions/setup-node@v4 |
22 | 25 | with: |
23 | | - php-version: '8.3' |
24 | | - - name: Use Node.js ${{ matrix.node-version }} |
25 | | - uses: actions/setup-node@v3 |
| 26 | + node-version: lts/* |
| 27 | + cache: 'pnpm' |
| 28 | + - name: Cache Composer dependencies |
| 29 | + uses: actions/cache@v4 |
26 | 30 | with: |
27 | | - node-version: 22.x |
28 | | - - uses: pnpm/action-setup@v2 |
29 | | - name: Install pnpm |
30 | | - with: |
31 | | - version: 10 |
32 | | - run_install: false |
33 | | - - name: Get pnpm store directory |
34 | | - shell: bash |
35 | | - run: | |
36 | | - echo "STORE_PATH=$(pnpm store path --silent)" >> $GITHUB_ENV |
37 | | - - uses: actions/cache@v3 |
38 | | - name: Setup pnpm cache |
39 | | - with: |
40 | | - path: ${{ env.STORE_PATH }} |
41 | | - key: ${{ runner.os }}-pnpm-store-${{ hashFiles('**/pnpm-lock.yaml') }} |
| 31 | + path: vendor |
| 32 | + key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.lock') }} |
42 | 33 | restore-keys: | |
43 | | - ${{ runner.os }}-pnpm-store- |
| 34 | + ${{ runner.os }}-composer- |
44 | 35 | - name: Copy .env |
45 | 36 | run: php -r "file_exists('.env') || copy('.env.example', '.env');" |
46 | | - - name: Install Dependencies |
| 37 | + - name: Install PHP Dependencies |
47 | 38 | run: composer install -q --no-ansi --no-interaction --no-scripts --no-progress --prefer-dist |
48 | | - - name: Generate key |
| 39 | + - name: Generate Laravel key |
49 | 40 | run: php artisan key:generate |
50 | | - - name: Directory Permissions |
| 41 | + - name: Set Directory Permissions |
51 | 42 | run: chmod -R 777 storage bootstrap/cache |
52 | | - - name: Create Database |
53 | | - run: | |
54 | | - mkdir -p database |
55 | | - touch database/database.sqlite |
56 | | - - name: Install JS Dependencies |
57 | | - run: pnpm install |
58 | | - - name: Build JS assets |
59 | | - run: pnpm run build |
60 | | - - name: Execute tests |
61 | | - env: |
62 | | - DB_CONNECTION: sqlite |
63 | | - DB_DATABASE: database/database.sqlite |
64 | | - run: php artisan test |
| 43 | + - name: Install & Build JS |
| 44 | + run: pnpm install && pnpm run build |
| 45 | + - name: Run Tests |
| 46 | + run: ./vendor/bin/pest --parallel |
0 commit comments