|
| 1 | +name: tests |
| 2 | + |
| 3 | +on: |
| 4 | + push: |
| 5 | + branches: [ "**" ] |
| 6 | + pull_request: |
| 7 | + |
| 8 | +concurrency: |
| 9 | + group: ${{ github.workflow }}-${{ github.ref }} |
| 10 | + cancel-in-progress: true |
| 11 | + |
| 12 | +jobs: |
| 13 | + test: |
| 14 | + name: PHP ${{ matrix.php }} / Laravel ${{ matrix.laravel }} / Testbench ${{ matrix.testbench }} |
| 15 | + runs-on: ubuntu-latest |
| 16 | + strategy: |
| 17 | + fail-fast: false |
| 18 | + matrix: |
| 19 | + include: |
| 20 | + - laravel: "10.*" |
| 21 | + testbench: "^8.0" |
| 22 | + php: "8.2" |
| 23 | + - laravel: "11.*" |
| 24 | + testbench: "^9.0" |
| 25 | + php: "8.2" |
| 26 | + - laravel: "12.*" |
| 27 | + testbench: "^10.0" |
| 28 | + php: "8.3" |
| 29 | + - laravel: "12.*" |
| 30 | + testbench: "^10.0" |
| 31 | + php: "8.4" |
| 32 | + |
| 33 | + steps: |
| 34 | + - name: Checkout |
| 35 | + uses: actions/checkout@v4 |
| 36 | + |
| 37 | + - name: Setup PHP |
| 38 | + uses: shivammathur/setup-php@v2 |
| 39 | + with: |
| 40 | + php-version: ${{ matrix.php }} |
| 41 | + coverage: none |
| 42 | + tools: composer:v2 |
| 43 | + extensions: mbstring, dom |
| 44 | + |
| 45 | + - name: Get Composer cache directory |
| 46 | + id: composer-cache |
| 47 | + run: echo "dir=$(composer config cache-dir)" >> $GITHUB_OUTPUT |
| 48 | + |
| 49 | + - name: Cache Composer dependencies |
| 50 | + uses: actions/cache@v4 |
| 51 | + with: |
| 52 | + path: ${{ steps.composer-cache.outputs.dir }} |
| 53 | + key: ${{ runner.os }}-php-${{ matrix.php }}-laravel-${{ matrix.laravel }}-testbench-${{ matrix.testbench }}-composer-${{ hashFiles('**/composer.json') }} |
| 54 | + restore-keys: | |
| 55 | + ${{ runner.os }}-php-${{ matrix.php }}-laravel-${{ matrix.laravel }}-testbench-${{ matrix.testbench }}-composer- |
| 56 | +
|
| 57 | + - name: Validate composer.json |
| 58 | + run: composer validate --strict |
| 59 | + |
| 60 | + - name: Install dependencies (Laravel ${{ matrix.laravel }}) |
| 61 | + run: | |
| 62 | + composer update "illuminate/support:${{ matrix.laravel }}" "orchestra/testbench:${{ matrix.testbench }}" \ |
| 63 | + --with-all-dependencies --no-interaction --prefer-dist |
| 64 | +
|
| 65 | + - name: Run tests |
| 66 | + run: vendor/bin/phpunit |
| 67 | + |
| 68 | + analysis: |
| 69 | + name: PHPStan (PHP 8.4 / Laravel 12) |
| 70 | + runs-on: ubuntu-latest |
| 71 | + steps: |
| 72 | + - name: Checkout |
| 73 | + uses: actions/checkout@v4 |
| 74 | + |
| 75 | + - name: Setup PHP |
| 76 | + uses: shivammathur/setup-php@v2 |
| 77 | + with: |
| 78 | + php-version: 8.4 |
| 79 | + coverage: none |
| 80 | + tools: composer:v2 |
| 81 | + extensions: mbstring, dom |
| 82 | + |
| 83 | + - name: Get Composer cache directory |
| 84 | + id: composer-cache |
| 85 | + run: echo "dir=$(composer config cache-dir)" >> $GITHUB_OUTPUT |
| 86 | + |
| 87 | + - name: Cache Composer dependencies |
| 88 | + uses: actions/cache@v4 |
| 89 | + with: |
| 90 | + path: ${{ steps.composer-cache.outputs.dir }} |
| 91 | + key: ${{ runner.os }}-php-8.4-laravel-12-testbench-10-composer-${{ hashFiles('**/composer.json') }} |
| 92 | + restore-keys: | |
| 93 | + ${{ runner.os }}-php-8.4-laravel-12-testbench-10-composer- |
| 94 | +
|
| 95 | + - name: Validate composer.json |
| 96 | + run: composer validate --strict |
| 97 | + |
| 98 | + - name: Install dependencies (Laravel 12) |
| 99 | + run: | |
| 100 | + composer update "illuminate/support:12.*" "orchestra/testbench:^10.0" \ |
| 101 | + --with-all-dependencies --no-interaction --prefer-dist |
| 102 | +
|
| 103 | + - name: Run PHPStan |
| 104 | + run: vendor/bin/phpstan analyse --no-progress --memory-limit=1G |
| 105 | + |
| 106 | + style: |
| 107 | + name: Pint (PHP 8.4 / Laravel 12) |
| 108 | + runs-on: ubuntu-latest |
| 109 | + steps: |
| 110 | + - name: Checkout |
| 111 | + uses: actions/checkout@v4 |
| 112 | + |
| 113 | + - name: Setup PHP |
| 114 | + uses: shivammathur/setup-php@v2 |
| 115 | + with: |
| 116 | + php-version: 8.4 |
| 117 | + coverage: none |
| 118 | + tools: composer:v2 |
| 119 | + extensions: mbstring, dom |
| 120 | + |
| 121 | + - name: Get Composer cache directory |
| 122 | + id: composer-cache |
| 123 | + run: echo "dir=$(composer config cache-dir)" >> $GITHUB_OUTPUT |
| 124 | + |
| 125 | + - name: Cache Composer dependencies |
| 126 | + uses: actions/cache@v4 |
| 127 | + with: |
| 128 | + path: ${{ steps.composer-cache.outputs.dir }} |
| 129 | + key: ${{ runner.os }}-php-8.4-laravel-12-testbench-10-composer-${{ hashFiles('**/composer.json') }} |
| 130 | + restore-keys: | |
| 131 | + ${{ runner.os }}-php-8.4-laravel-12-testbench-10-composer- |
| 132 | +
|
| 133 | + - name: Validate composer.json |
| 134 | + run: composer validate --strict |
| 135 | + |
| 136 | + - name: Install dependencies (Laravel 12) |
| 137 | + run: | |
| 138 | + composer update "illuminate/support:12.*" "orchestra/testbench:^10.0" \ |
| 139 | + --with-all-dependencies --no-interaction --prefer-dist |
| 140 | +
|
| 141 | + - name: Run Pint (dry-run) |
| 142 | + run: vendor/bin/pint --test |
0 commit comments