|
1 | 1 | name: Tests |
2 | 2 |
|
3 | | -on: [push, pull_request] |
| 3 | +on: |
| 4 | + workflow_dispatch: |
| 5 | + push: |
| 6 | + branches: |
| 7 | + - master |
| 8 | + paths: |
| 9 | + - "**.json" |
| 10 | + - "**.php" |
| 11 | + - "**.yml" |
| 12 | + pull_request: |
| 13 | + branches: |
| 14 | + - master |
| 15 | + paths: |
| 16 | + - "**.json" |
| 17 | + - "**.php" |
| 18 | + - "**.yml" |
4 | 19 |
|
5 | 20 | jobs: |
6 | 21 | tests: |
7 | | - runs-on: ${{ matrix.os }} |
8 | 22 | strategy: |
9 | 23 | fail-fast: true |
10 | 24 | matrix: |
11 | | - os: [ubuntu-latest] |
12 | | - php: [8.1, 8.0, 7.4] |
13 | | - laravel: [10.*, 9.*, 8.*, 7.*, 6.*, 5.8.*, 5.7.*, 5.6.*] |
14 | | - dependency-version: [prefer-lowest, prefer-stable] |
| 25 | + php: [8.3, 8.2, 8.1] |
| 26 | + testbench: [9.0, 8.0, 7.0] # Laravel 11.x, 10.x, 9.x |
| 27 | + version: [prefer-stable, prefer-lowest] |
15 | 28 | include: |
16 | | - - laravel: 10.* |
17 | | - testbench: ^8.0 |
18 | | - - laravel: 9.* |
19 | | - testbench: ^7.0 |
20 | | - - laravel: 8.* |
21 | | - testbench: ^6.23 |
22 | | - - laravel: 7.* |
23 | | - testbench: ^5.20 |
24 | | - - laravel: 6.* |
25 | | - testbench: ^4.18 |
26 | | - - laravel: 5.8.* |
27 | | - testbench: 3.8.* |
28 | | - - laravel: 5.7.* |
29 | | - testbench: 3.7.* |
30 | | - - laravel: 5.6.* |
31 | | - testbench: 3.6.* |
| 29 | + - testbench: 7.0 |
| 30 | + phpunit: "-c phpunit-9.xml" |
32 | 31 | exclude: |
33 | | - - laravel: 10.* |
34 | | - php: 8.0 |
35 | | - - laravel: 10.* |
36 | | - php: 7.4 |
37 | | - - laravel: 9.* |
38 | | - php: 7.4 |
39 | | - - laravel: 7.* |
40 | | - php: 8.1 |
41 | | - - laravel: 6.* |
42 | | - php: 8.1 |
43 | | - - laravel: 5.8.* |
44 | | - php: 8.1 |
45 | | - - laravel: 5.8.* |
46 | | - php: 8.0 |
47 | | - - laravel: 5.8.* |
48 | | - php: 7.4 |
49 | | - dependency-version: prefer-lowest |
50 | | - - laravel: 5.7.* |
51 | | - php: 8.1 |
52 | | - - laravel: 5.7.* |
53 | | - php: 8.0 |
54 | | - - laravel: 5.7.* |
55 | | - php: 7.4 |
56 | | - dependency-version: prefer-lowest |
57 | | - - laravel: 5.6.* |
58 | | - php: 8.1 |
59 | | - - laravel: 5.6.* |
60 | | - php: 8.0 |
61 | | - - laravel: 5.6.* |
62 | | - php: 7.4 |
63 | | - dependency-version: prefer-lowest |
| 32 | + - php: 8.1 |
| 33 | + testbench: 9.0 |
64 | 34 |
|
65 | | - name: P${{ matrix.php }} - L${{ matrix.laravel }} - ${{ matrix.dependency-version }} |
| 35 | + name: P${{ matrix.php }} - T${{ matrix.testbench }} - ${{ matrix.version }} |
66 | 36 |
|
67 | | - steps: |
68 | | - - name: Checkout code |
69 | | - uses: actions/checkout@v2 |
| 37 | + runs-on: ubuntu-latest |
70 | 38 |
|
71 | | - - name: Install SQLite 3 |
72 | | - run: | |
73 | | - sudo apt-get update |
74 | | - sudo apt-get install sqlite3 |
| 39 | + container: |
| 40 | + image: kirschbaumdevelopment/laravel-test-runner:${{ matrix.php }} |
| 41 | + options: "--user=root" |
75 | 42 |
|
76 | | - - name: Setup PHP |
77 | | - uses: shivammathur/setup-php@v2 |
| 43 | + steps: |
| 44 | + - name: Checkout code |
| 45 | + uses: actions/checkout@v4 |
78 | 46 | with: |
79 | | - php-version: ${{ matrix.php }} |
80 | | - extensions: curl, mbstring, zip, pcntl, pdo, sqlite, pdo_sqlite, iconv |
81 | | - coverage: none |
| 47 | + # Make sure the actual branch is checked out when running on pull requests. |
| 48 | + ref: ${{ github.head_ref }} |
| 49 | + token: ${{ secrets.GITHUB_TOKEN }} |
82 | 50 |
|
83 | 51 | - name: Install dependencies |
84 | 52 | run: | |
85 | | - composer require "laravel/framework:${{ matrix.laravel }}" "orchestra/testbench:${{ matrix.testbench }}" --no-interaction --no-update |
86 | | - composer update --${{ matrix.dependency-version }} --prefer-dist --no-interaction |
87 | | -
|
88 | | - - name: Setup Problem Matches |
89 | | - run: | |
90 | | - echo "::add-matcher::${{ runner.tool_cache }}/php.json" |
91 | | - echo "::add-matcher::${{ runner.tool_cache }}/phpunit.json" |
| 53 | + composer require "orchestra/testbench:^${{ matrix.testbench }}" --no-interaction --no-update |
| 54 | + composer update --${{ matrix.version }} --prefer-dist --no-interaction |
92 | 55 |
|
93 | 56 | - name: Execute tests |
94 | | - run: vendor/bin/phpunit |
| 57 | + run: vendor/bin/phpunit ${{ matrix.phpunit }} |
0 commit comments