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