|
8 | 8 |
|
9 | 9 | jobs: |
10 | 10 | test: |
11 | | - runs-on: ${{ matrix.os }} |
| 11 | + runs-on: ubuntu-latest |
12 | 12 | strategy: |
13 | 13 | fail-fast: true |
14 | 14 | matrix: |
15 | | - os: [ubuntu-latest] |
16 | | - php: [8.1, 8.2] |
17 | | - laravel: [10.*, 11.*, 12.*] |
18 | | - stability: [prefer-stable] |
19 | 15 | include: |
20 | | - - laravel: 10.* |
21 | | - testbench: 8.* |
22 | | - php: 8.1 |
23 | | - - laravel: 11.* |
| 16 | + - php: 8.2 |
| 17 | + laravel: 11.* |
| 18 | + filament: 4.* |
24 | 19 | testbench: 9.* |
25 | | - php: 8.2 |
26 | | - - laravel: 12.* |
| 20 | + livewire: ^3.0 |
| 21 | + pest: ^3.8 |
| 22 | + pest_plugin_laravel: ^3.1 |
| 23 | + pest_plugin_livewire: ^3.1 |
| 24 | + - php: 8.2 |
| 25 | + laravel: 12.* |
| 26 | + filament: 4.* |
27 | 27 | testbench: 10.* |
28 | | - php: 8.2 |
| 28 | + livewire: ^3.0 |
| 29 | + pest: ^3.8 |
| 30 | + pest_plugin_laravel: ^3.1 |
| 31 | + pest_plugin_livewire: ^3.1 |
| 32 | + - php: 8.3 |
| 33 | + laravel: 12.* |
| 34 | + filament: 5.* |
| 35 | + testbench: 10.* |
| 36 | + livewire: ^4.0 |
| 37 | + pest: ^4.0 |
| 38 | + pest_plugin_laravel: ^4.0 |
| 39 | + pest_plugin_livewire: ^4.0 |
| 40 | + - php: 8.4 |
| 41 | + laravel: 12.* |
| 42 | + filament: 5.* |
| 43 | + testbench: 10.* |
| 44 | + livewire: ^4.0 |
| 45 | + pest: ^4.0 |
| 46 | + pest_plugin_laravel: ^4.0 |
| 47 | + pest_plugin_livewire: ^4.0 |
| 48 | + - php: 8.5 |
| 49 | + laravel: 12.* |
| 50 | + filament: 5.* |
| 51 | + testbench: 10.* |
| 52 | + livewire: ^4.0 |
| 53 | + pest: ^4.0 |
| 54 | + pest_plugin_laravel: ^4.0 |
| 55 | + pest_plugin_livewire: ^4.0 |
29 | 56 |
|
30 | | - name: P${{ matrix.php }} - L${{ matrix.laravel }} - ${{ matrix.stability }} - ${{ matrix.os }} |
| 57 | + name: P${{ matrix.php }} - L${{ matrix.laravel }} |
31 | 58 |
|
32 | 59 | steps: |
33 | 60 | - name: Checkout code |
34 | 61 | uses: actions/checkout@v4 |
35 | 62 |
|
| 63 | + - name: Validate composer.json and composer.lock |
| 64 | + run: composer validate --strict |
| 65 | + |
| 66 | + - name: Cache Composer dependencies |
| 67 | + uses: actions/cache@v4 |
| 68 | + with: |
| 69 | + path: vendor |
| 70 | + key: ${{ runner.os }}-composer-${{ matrix.php }}-${{ matrix.laravel }}-${{ matrix.filament }}-${{ matrix.testbench }}-${{ matrix.livewire }}-${{ hashFiles('**/composer.lock') }} |
| 71 | + restore-keys: | |
| 72 | + ${{ runner.os }}-composer-${{ matrix.php }}-${{ matrix.laravel }}-${{ matrix.filament }}-${{ matrix.testbench }}-${{ matrix.livewire }}- |
| 73 | + ${{ runner.os }}-composer- |
| 74 | +
|
36 | 75 | - name: Setup PHP |
37 | 76 | uses: shivammathur/setup-php@v2 |
38 | 77 | with: |
39 | 78 | php-version: ${{ matrix.php }} |
40 | | - extensions: dom, curl, libxml, mbstring, zip, pcntl, pdo, sqlite, pdo_sqlite, bcmath, soap, intl, gd, exif, iconv, imagick, fileinfo |
41 | | - coverage: none |
| 79 | + extensions: dom, curl, libxml, mbstring, zip, pcntl, pdo, sqlite, pdo_sqlite, bcmath, soap, intl, gd, exif, iconv, imagick, fileinfo, pcov |
| 80 | + coverage: pcov |
42 | 81 |
|
43 | 82 | - name: Setup problem matchers |
44 | 83 | run: | |
45 | 84 | echo "::add-matcher::${{ runner.tool_cache }}/php.json" |
46 | 85 | echo "::add-matcher::${{ runner.tool_cache }}/phpunit.json" |
47 | 86 |
|
48 | 87 | - name: Install dependencies |
| 88 | + env: |
| 89 | + XDEBUG_MODE: off |
49 | 90 | run: | |
50 | | - composer require "laravel/framework:${{ matrix.laravel }}" "orchestra/testbench:${{ matrix.testbench }}" --no-interaction --no-update |
51 | | - composer update --${{ matrix.stability }} --prefer-dist --no-interaction |
| 91 | + composer require \ |
| 92 | + "laravel/framework:${{ matrix.laravel }}" \ |
| 93 | + "orchestra/testbench:${{ matrix.testbench }}" \ |
| 94 | + "filament/filament:${{ matrix.filament }}" \ |
| 95 | + "livewire/livewire:${{ matrix.livewire }}" \ |
| 96 | + "pestphp/pest:${{ matrix.pest }}" \ |
| 97 | + "pestphp/pest-plugin-laravel:${{ matrix.pest_plugin_laravel }}" \ |
| 98 | + "pestphp/pest-plugin-livewire:${{ matrix.pest_plugin_livewire }}" \ |
| 99 | + --no-interaction --no-update --no-progress --ansi |
| 100 | + composer update --prefer-stable --prefer-dist --no-interaction --no-progress --ansi |
52 | 101 |
|
53 | | - - name: Execute tests |
54 | | - run: vendor/bin/pest |
| 102 | + - name: Prepare coverage directory |
| 103 | + run: mkdir -p build/logs |
| 104 | + |
| 105 | + - name: Execute tests with coverage |
| 106 | + run: vendor/bin/pest --coverage --coverage-clover build/logs/clover.xml |
| 107 | + |
| 108 | + - name: Sanitize artifact name |
| 109 | + run: | |
| 110 | + LARAVEL_SAFE=$(echo "${{ matrix.laravel }}" | tr '*' 'x') |
| 111 | + FILAMENT_SAFE=$(echo "${{ matrix.filament }}" | tr '*' 'x') |
| 112 | + echo "ARTIFACT_NAME=coverage-${{ matrix.php }}-${LARAVEL_SAFE}-${FILAMENT_SAFE}" >> $GITHUB_ENV |
| 113 | +
|
| 114 | + - name: Upload coverage artifact |
| 115 | + uses: actions/upload-artifact@v4 |
| 116 | + with: |
| 117 | + name: ${{ env.ARTIFACT_NAME }} |
| 118 | + path: build/logs/clover.xml |
| 119 | + if-no-files-found: error |
0 commit comments