|
1 | 1 | name: run-tests |
2 | 2 |
|
3 | 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 | + push: |
| 5 | + paths: |
| 6 | + - **.php |
| 7 | + - .github/workflows/run-tests.yml |
| 8 | + - phpunit.xml.dist |
| 9 | + - composer.json |
| 10 | + - composer.lock |
11 | 11 |
|
12 | 12 | jobs: |
13 | | - test: |
14 | | - runs-on: ${{ matrix.os }} |
15 | | - timeout-minutes: 5 |
16 | | - strategy: |
17 | | - fail-fast: true |
18 | | - matrix: |
19 | | - os: [ubuntu-latest] |
20 | | - php: [8.3, 8.2] |
21 | | - laravel: [10.*, 11.*] |
22 | | - stability: [prefer-stable] |
23 | | - include: |
24 | | - - laravel: 11.* |
25 | | - testbench: 9.* |
26 | | - carbon: ^2.63 |
27 | | - - laravel: 10.* |
28 | | - testbench: 8.* |
| 13 | + test: |
| 14 | + runs-on: ${{ matrix.os }} |
29 | 15 |
|
30 | | - name: P${{ matrix.php }} - L${{ matrix.laravel }} - ${{ matrix.stability }} - ${{ matrix.os }} |
| 16 | + timeout-minutes: 5 |
31 | 17 |
|
32 | | - services: |
33 | | - mysql: |
34 | | - image: mysql:8.0 |
35 | | - env: |
36 | | - MYSQL_USER: user |
37 | | - MYSQL_PASSWORD: secret |
38 | | - MYSQL_DATABASE: laravel_query_builder |
39 | | - MYSQL_ROOT_PASSWORD: secretroot |
40 | | - ports: |
41 | | - - 3306 |
42 | | - options: --health-cmd="mysqladmin ping" --health-interval=10s --health-timeout=5s --health-retries=3 |
| 18 | + strategy: |
| 19 | + fail-fast: true |
| 20 | + matrix: |
| 21 | + os: [ubuntu-latest] |
| 22 | + php: [8.3, 8.2] |
| 23 | + laravel: ['10.*', '11.*', '12.*'] |
| 24 | + stability: [prefer-stable] |
| 25 | + include: |
| 26 | + - laravel: 11.* |
| 27 | + testbench: 9.* |
| 28 | + - laravel: 10.* |
| 29 | + testbench: 8.* |
| 30 | + - laravel: 12.* |
| 31 | + testbench: 10.* |
43 | 32 |
|
44 | | - redis: |
45 | | - image: redis |
46 | | - ports: |
47 | | - - 6379:6379 |
48 | | - options: >- |
49 | | - --health-cmd "redis-cli ping" |
50 | | - --health-interval 10s |
51 | | - --health-timeout 5s |
52 | | - --health-retries 5 |
| 33 | + name: P${{ matrix.php }} - L${{ matrix.laravel }} - ${{ matrix.stability }} - ${{ matrix.os }} |
53 | 34 |
|
54 | | - steps: |
55 | | - - name: Checkout code |
56 | | - uses: actions/checkout@v4 |
| 35 | + services: |
| 36 | + mysql: |
| 37 | + image: mysql:8.0 |
| 38 | + env: |
| 39 | + MYSQL_USER: user |
| 40 | + MYSQL_PASSWORD: secret |
| 41 | + MYSQL_DATABASE: laravel_query_builder |
| 42 | + MYSQL_ROOT_PASSWORD: secretroot |
| 43 | + ports: |
| 44 | + - 3306 |
| 45 | + options: --health-cmd="mysqladmin ping" --health-interval=10s --health-timeout=5s --health-retries=3 |
| 46 | + redis: |
| 47 | + image: redis |
| 48 | + ports: |
| 49 | + - 6379:6379 |
| 50 | + options: --health-cmd "redis-cli ping" --health-interval 10s --health-timeout 5s --health-retries 5 |
57 | 51 |
|
58 | | - - name: Setup PHP |
59 | | - uses: shivammathur/setup-php@v2 |
60 | | - with: |
61 | | - php-version: ${{ matrix.php }} |
62 | | - extensions: dom, curl, libxml, mbstring, zip, pcntl, pdo, sqlite, pdo_sqlite, bcmath, soap, intl, gd, exif, iconv, imagick, fileinfo |
63 | | - coverage: none |
| 52 | + steps: |
| 53 | + - name: Checkout code |
| 54 | + uses: actions/checkout@v4 |
64 | 55 |
|
65 | | - - name: Setup problem matchers |
66 | | - run: | |
67 | | - echo "::add-matcher::${{ runner.tool_cache }}/php.json" |
68 | | - echo "::add-matcher::${{ runner.tool_cache }}/phpunit.json" |
| 56 | + - name: Setup PHP |
| 57 | + uses: shivammathur/setup-php@v2 |
| 58 | + with: |
| 59 | + php-version: ${{ matrix.php }} |
| 60 | + extensions: dom, curl, libxml, mbstring, zip, pcntl, pdo, sqlite, pdo_sqlite, bcmath, soap, intl, gd, exif, iconv, imagick, fileinfo |
| 61 | + coverage: none |
69 | 62 |
|
70 | | - - name: Install dependencies |
71 | | - run: | |
72 | | - composer require "laravel/framework:${{ matrix.laravel }}" "orchestra/testbench:${{ matrix.testbench }}" --no-interaction --no-update |
73 | | - composer update --${{ matrix.stability }} --prefer-dist --no-interaction |
| 63 | + - name: Setup problem matchers |
| 64 | + run: | |
| 65 | + echo "::add-matcher::${{ runner.tool_cache }}/php.json" |
| 66 | + echo "::add-matcher::${{ runner.tool_cache }}/phpunit.json" |
74 | 67 |
|
75 | | - - name: Execute tests |
76 | | - run: vendor/bin/pest |
77 | | - env: |
78 | | - DB_USERNAME: user |
79 | | - DB_PASSWORD: secret |
80 | | - DB_PORT: ${{ job.services.mysql.ports[3306] }} |
81 | | - REDIS_PORT: 6379 |
| 68 | + - name: Install dependencies |
| 69 | + run: | |
| 70 | + composer require "laravel/framework:${{ matrix.laravel }}" "orchestra/testbench:${{ matrix.testbench }}" --no-interaction --no-update |
| 71 | + composer update --${{ matrix.stability }} --prefer-dist --no-interaction |
82 | 72 |
|
| 73 | + - name: Execute tests |
| 74 | + run: vendor/bin/pest |
| 75 | + env: |
| 76 | + DB_USERNAME: user |
| 77 | + DB_PASSWORD: secret |
| 78 | + DB_PORT: ${{ job.services.mysql.ports[3306] }} |
| 79 | + REDIS_PORT: 6379 |
0 commit comments