|
1 | 1 | name: run-tests
|
2 | 2 |
|
3 |
| -on: [push, pull_request] |
| 3 | +on: |
| 4 | + push: |
| 5 | + paths: |
| 6 | + - '**.php' |
| 7 | + - '.github/workflows/run-tests.yml' |
| 8 | + - 'phpunit.xml.dist' |
| 9 | + - 'composer.json' |
| 10 | + - 'composer.lock' |
4 | 11 |
|
5 | 12 | jobs:
|
6 | 13 | test:
|
7 | 14 | runs-on: ${{ matrix.os }}
|
| 15 | + timeout-minutes: 5 |
8 | 16 | strategy:
|
9 |
| - fail-fast: false |
| 17 | + fail-fast: true |
10 | 18 | matrix:
|
11 |
| - php: [8.2, 8.3] |
12 |
| - laravel: [10.*, 11.*] |
13 |
| - dependency-version: [prefer-stable] |
14 | 19 | os: [ubuntu-latest]
|
| 20 | + php: [8.3, 8.2] |
| 21 | + laravel: [10.*] |
| 22 | + stability: [prefer-lowest, prefer-stable] |
15 | 23 | include:
|
16 | 24 | - laravel: 10.*
|
17 | 25 | testbench: 8.*
|
18 |
| - - laravel: 11.* |
19 |
| - testbench: 9.* |
20 | 26 |
|
21 |
| - name: P${{ matrix.php }} - L${{ matrix.laravel }} - ${{ matrix.dependency-version }} - ${{ matrix.os }} |
| 27 | + name: P${{ matrix.php }} - L${{ matrix.laravel }} - ${{ matrix.stability }} - ${{ matrix.os }} |
22 | 28 |
|
23 | 29 | steps:
|
24 | 30 | - name: Checkout code
|
25 | 31 | uses: actions/checkout@v4
|
26 | 32 |
|
27 |
| - - name: Install and start test server |
28 |
| - run: | |
29 |
| - cd tests/server |
30 |
| - npm install |
31 |
| - (node server.js &) || /bin/true |
32 |
| -
|
33 |
| - - name: Wait for server bootup |
34 |
| - run: sleep 5 |
35 |
| - |
36 |
| - - name: Cache dependencies |
37 |
| - uses: actions/cache@v4 |
38 |
| - with: |
39 |
| - path: ~/.composer/cache/files |
40 |
| - key: dependencies-laravel-${{ matrix.laravel }}-php-${{ matrix.php }}-composer-${{ hashFiles('composer.json') }} |
41 |
| - |
42 | 33 | - name: Setup PHP
|
43 | 34 | uses: shivammathur/setup-php@v2
|
44 | 35 | with:
|
45 | 36 | php-version: ${{ matrix.php }}
|
46 |
| - extensions: dom, curl, libxml, mbstring, zip, pcntl, pdo, sqlite, pdo_sqlite, mysql, mysqli, pdo_mysql, bcmath, soap, intl, gd, exif, iconv, imagick |
| 37 | + extensions: dom, curl, libxml, mbstring, zip, pcntl, pdo, sqlite, pdo_sqlite, bcmath, soap, intl, gd, exif, iconv, imagick, fileinfo |
47 | 38 | coverage: none
|
48 | 39 |
|
| 40 | + - name: Setup problem matchers |
| 41 | + run: | |
| 42 | + echo "::add-matcher::${{ runner.tool_cache }}/php.json" |
| 43 | + echo "::add-matcher::${{ runner.tool_cache }}/phpunit.json" |
| 44 | +
|
49 | 45 | - name: Install dependencies
|
50 | 46 | run: |
|
51 | 47 | composer require "laravel/framework:${{ matrix.laravel }}" "orchestra/testbench:${{ matrix.testbench }}" --no-interaction --no-update
|
52 |
| - composer update --${{ matrix.dependency-version }} --prefer-dist --no-interaction --no-suggest |
| 48 | + composer update --${{ matrix.stability }} --prefer-dist --no-interaction |
| 49 | +
|
| 50 | + - name: List Installed Dependencies |
| 51 | + run: composer show -D |
53 | 52 |
|
54 | 53 | - name: Execute tests
|
55 |
| - run: vendor/bin/pest |
| 54 | + run: vendor/bin/pest --ci |
0 commit comments