|
1 | 1 | name: tests |
2 | 2 |
|
3 | | -on: [push, pull_request] |
4 | | - |
5 | | -env: |
6 | | - COMPOSER_FLAGS: "--ansi --no-interaction --no-progress --no-suggest --prefer-dist -o -n" |
| 3 | +on: |
| 4 | + push: |
| 5 | + branches: [master] |
| 6 | + pull_request: |
| 7 | + workflow_dispatch: |
7 | 8 |
|
8 | 9 | jobs: |
9 | | - laravel-tests: |
| 10 | + tests: |
10 | 11 | strategy: |
11 | 12 | fail-fast: false |
12 | 13 | matrix: |
13 | | - php-version: [7.4, 8.0] |
14 | | - laravel-version: [6, 7, 8] |
15 | | - os: [ubuntu-latest] |
16 | | - experimental: [false] |
17 | | - dependencies: [locked] |
18 | 14 | include: |
19 | | - - php-version: 7.4 |
20 | | - laravel-version: 8 |
21 | | - dependencies: highest |
22 | | - os: ubuntu-latest |
23 | | - experimental: false |
24 | | - |
25 | | - # - php-version: 7.4 |
26 | | - # laravel-version: 8 |
27 | | - # os: windows-latest |
28 | | - # dependencies: locked |
29 | | - # experimental: false |
30 | | - |
31 | | - - php-version: 7.4 |
32 | | - laravel-version: 8 |
33 | | - os: macos-latest |
34 | | - dependencies: locked |
35 | | - experimental: false |
36 | | - |
37 | | - name: PHP ${{ matrix.php-version }} - L${{ matrix.laravel-version }} - ${{ matrix.os }} - ${{ matrix.dependencies }} |
| 15 | + # Laravel 10 (testbench 8) |
| 16 | + - { php: '8.1', laravel: '10.*', testbench: '8.*', os: ubuntu-latest } |
| 17 | + - { php: '8.2', laravel: '10.*', testbench: '8.*', os: ubuntu-latest } |
| 18 | + - { php: '8.3', laravel: '10.*', testbench: '8.*', os: ubuntu-latest } |
| 19 | + # Laravel 11 (testbench 9) |
| 20 | + - { php: '8.2', laravel: '11.*', testbench: '9.*', os: ubuntu-latest } |
| 21 | + - { php: '8.3', laravel: '11.*', testbench: '9.*', os: ubuntu-latest } |
| 22 | + - { php: '8.4', laravel: '11.*', testbench: '9.*', os: ubuntu-latest } |
| 23 | + # Laravel 12 (testbench 10) |
| 24 | + - { php: '8.2', laravel: '12.*', testbench: '10.*', os: ubuntu-latest } |
| 25 | + - { php: '8.3', laravel: '12.*', testbench: '10.*', os: ubuntu-latest } |
| 26 | + - { php: '8.4', laravel: '12.*', testbench: '10.*', os: ubuntu-latest } |
| 27 | + # Keep an eye on the other host we claim to work on |
| 28 | + - { php: '8.4', laravel: '12.*', testbench: '10.*', os: macos-latest } |
| 29 | + |
| 30 | + name: PHP ${{ matrix.php }} - L${{ matrix.laravel }} - ${{ matrix.os }} |
38 | 31 |
|
39 | 32 | runs-on: ${{ matrix.os }} |
40 | 33 |
|
41 | | - continue-on-error: ${{ matrix.experimental }} |
42 | | - |
43 | 34 | steps: |
44 | 35 | - name: Checkout code |
45 | | - uses: actions/checkout@v2 |
| 36 | + uses: actions/checkout@v4 |
46 | 37 |
|
47 | 38 | - name: Setup PHP |
48 | 39 | uses: shivammathur/setup-php@v2 |
49 | 40 | with: |
50 | | - php-version: ${{ matrix.php-version }} |
| 41 | + php-version: ${{ matrix.php }} |
51 | 42 | extensions: dom, curl, libxml, mbstring, zip, pcntl, pdo, sqlite, pdo_sqlite, gd |
52 | 43 | coverage: none |
53 | | - ini-values: "memory_limit=-1" |
54 | | - tools: composer |
| 44 | + ini-values: memory_limit=-1, error_reporting=E_ALL |
| 45 | + tools: composer:v2 |
55 | 46 |
|
56 | 47 | - name: Determine composer cache directory |
57 | | - id: determine-composer-cache-directory |
58 | | - run: 'echo "::set-output name=directory::$(composer config cache-dir)"' |
| 48 | + id: composer-cache |
| 49 | + run: echo "directory=$(composer config cache-dir)" >> "$GITHUB_OUTPUT" |
59 | 50 |
|
60 | 51 | - name: Cache dependencies |
61 | | - uses: actions/cache@v2 |
| 52 | + uses: actions/cache@v4 |
62 | 53 | with: |
63 | | - path: ${{ steps.determine-composer-cache-directory.outputs.directory }} |
64 | | - key: dependencies-os-${{ matrix.os }}-php-${{ matrix.php-version }}-laravel-${{ matrix.laravel-version }}-composer-${{ hashFiles('**/composer.lock') }} |
65 | | - restore-keys: dependencies-os-${{ matrix.os }}-php-${{ matrix.php-version }}-laravel-${{ matrix.laravel-version }}-composer- |
66 | | - |
67 | | - - name: Setup problem matchers for PHP |
68 | | - run: echo "::add-matcher::${{ runner.tool_cache }}/php.json" |
| 54 | + path: ${{ steps.composer-cache.outputs.directory }} |
| 55 | + key: composer-${{ matrix.os }}-php${{ matrix.php }}-laravel${{ matrix.laravel }}-${{ hashFiles('composer.json') }} |
| 56 | + restore-keys: composer-${{ matrix.os }}-php${{ matrix.php }}-laravel${{ matrix.laravel }}- |
69 | 57 |
|
70 | | - - name: Setup problem matchers for PHPUnit |
71 | | - run: echo "::add-matcher::${{ runner.tool_cache }}/phpunit.json" |
| 58 | + - name: Install dependencies |
| 59 | + run: | |
| 60 | + composer require --dev --no-update --no-interaction \ |
| 61 | + "laravel/framework:${{ matrix.laravel }}" \ |
| 62 | + "orchestra/testbench:${{ matrix.testbench }}" |
| 63 | + composer update --prefer-dist --no-interaction --no-progress |
72 | 64 |
|
73 | | - - name: Install highest dependencies from composer.json |
74 | | - if: matrix.dependencies == 'highest' |
75 | | - uses: nick-invision/retry@v1 |
76 | | - with: |
77 | | - timeout_minutes: 5 |
78 | | - max_attempts: 5 |
79 | | - command: composer config platform --unset && composer update ${{ env.COMPOSER_FLAGS }} |
| 65 | + - name: Run tests |
| 66 | + run: vendor/bin/pest |
80 | 67 |
|
81 | | - - name: Install lowest dependencies from composer.json |
82 | | - if: matrix.dependencies == 'lowest' |
83 | | - uses: nick-invision/retry@v1 |
84 | | - with: |
85 | | - timeout_minutes: 5 |
86 | | - max_attempts: 5 |
87 | | - command: composer install ${{ env.COMPOSER_FLAGS }} --prefer-lowest |
| 68 | + static-analysis: |
| 69 | + name: PHPStan |
| 70 | + runs-on: ubuntu-latest |
| 71 | + steps: |
| 72 | + - uses: actions/checkout@v4 |
88 | 73 |
|
89 | | - - name: Install dependencies from composer.lock |
90 | | - if: matrix.dependencies == 'locked' |
91 | | - uses: nick-invision/retry@v1 |
| 74 | + - uses: shivammathur/setup-php@v2 |
92 | 75 | with: |
93 | | - timeout_minutes: 5 |
94 | | - max_attempts: 5 |
95 | | - command: composer install ${{ env.COMPOSER_FLAGS }} |
| 76 | + php-version: '8.3' |
| 77 | + coverage: none |
| 78 | + tools: composer:v2 |
96 | 79 |
|
97 | | - - name: Select Laravel version |
98 | | - uses: nick-invision/retry@v1 |
99 | | - with: |
100 | | - timeout_minutes: 5 |
101 | | - max_attempts: 5 |
102 | | - command: composer require "laravel/framework:${{ matrix.laravel-version }}.*" --no-update |
| 80 | + - run: composer update --prefer-dist --no-interaction --no-progress |
103 | 81 |
|
104 | | - - name: Run tests |
105 | | - run: vendor/bin/pest --verbose |
| 82 | + - run: vendor/bin/phpstan analyse --no-progress |
0 commit comments