|
14 | 14 | - develop
|
15 | 15 |
|
16 | 16 | jobs:
|
17 |
| - laravel9-tests: |
18 |
| - runs-on: ubuntu-latest |
19 |
| - |
20 |
| - strategy: |
21 |
| - matrix: |
22 |
| - operating-system: [ ubuntu-latest ] |
23 |
| - php: [ '8.1', '8.2' ] |
24 |
| - dependency-stability: [ 'prefer-stable' ] |
25 |
| - |
26 |
| - laravel: [ '9.*' ] |
27 |
| - include: |
28 |
| - - laravel: 9.* |
29 |
| - testbench: 7.* |
30 |
| - |
31 |
| - name: PHP ${{ matrix.php }} - Laravel ${{ matrix.laravel }} - ${{ matrix.dependency-stability }} - ${{ matrix.operating-system}} |
32 |
| - |
33 |
| - steps: |
34 |
| - - name: Checkout code |
35 |
| - uses: actions/checkout@v4 |
36 |
| - |
37 |
| - - name: Setup Node.js |
38 |
| - uses: actions/setup-node@v4 |
39 |
| - with: |
40 |
| - node-version: '20.x' |
41 |
| - |
42 |
| - - name: Cache node_modules directory |
43 |
| - uses: actions/cache@v4 |
44 |
| - id: node_modules-cache |
45 |
| - with: |
46 |
| - path: node_modules |
47 |
| - key: ${{ runner.OS }}-build-${{ hashFiles('**/package.json') }}-${{ hashFiles('**/package-lock.json') }} |
48 |
| - |
49 |
| - - name: Install NPM packages |
50 |
| - if: steps.node_modules-cache.outputs.cache-hit != 'true' |
51 |
| - run: npm ci --include=dev |
52 |
| - |
53 |
| - - name: Install PHP versions |
54 |
| - uses: shivammathur/setup-php@v2 |
55 |
| - with: |
56 |
| - php-version: ${{ matrix.php }} |
57 |
| - |
58 |
| - - name: Get Composer Cache Directory |
59 |
| - id: composer-cache |
60 |
| - run: | |
61 |
| - echo "dir=$(composer config cache-files-dir)" >> $GITHUB_OUTPUT |
62 |
| -
|
63 |
| - - name: Cache Composer dependencies |
64 |
| - uses: actions/cache@v4 |
65 |
| - id: actions-cache |
66 |
| - with: |
67 |
| - path: ${{ steps.composer-cache.outputs.dir }} |
68 |
| - key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.lock') }} |
69 |
| - restore-keys: | |
70 |
| - ${{ runner.os }}-composer- |
71 |
| -
|
72 |
| - - name: Cache PHP dependencies (vendor) |
73 |
| - uses: actions/cache@v4 |
74 |
| - id: vendor-cache |
75 |
| - with: |
76 |
| - path: vendor |
77 |
| - key: ${{ runner.OS }}-build-${{ hashFiles('**/composer.lock') }} |
78 |
| - |
79 |
| - - name: Install Laravel Dependencies |
80 |
| - if: steps.vendor-cache.outputs.cache-hit != 'true' |
81 |
| - run: | |
82 |
| - composer require "laravel/framework:${{ matrix.laravel }}" "orchestra/testbench:${{ matrix.testbench }}" --no-interaction --no-update |
83 |
| - composer update --${{ matrix.dependency-stability }} --prefer-dist --no-interaction --no-suggest |
84 |
| -
|
85 |
| - - name: Update Dependencies with latest stable |
86 |
| - if: matrix.dependency-stability == 'prefer-stable' |
87 |
| - run: composer update --prefer-stable |
88 |
| - |
89 |
| - - name: Update Dependencies with lowest stable |
90 |
| - if: matrix.dependency-stability == 'prefer-lowest' |
91 |
| - run: composer update --prefer-stable --prefer-lowest |
92 |
| - |
93 |
| - - name: Set up Git User |
94 |
| - run: | |
95 |
| - git config --global user.email "github-actions@example.com" |
96 |
| - git config --global user.name "GitHub Actions" |
97 |
| -
|
98 |
| - # Code quality |
99 |
| - - name: Execute tests (Unit and Feature tests) via PestPHP |
100 |
| - shell: 'script -q -e -c "bash {0}"' |
101 |
| - # Set environment |
102 |
| - env: |
103 |
| - SESSION_DRIVER: array |
104 |
| - TTY: true |
105 |
| - |
106 |
| - run: vendor/bin/pest |
107 |
| - |
108 |
| - - name: Execute Code Sniffer via Laravel Pint |
109 |
| - run: vendor/bin/pint --test src config |
110 |
| - |
111 |
| - - name: Execute PHP Stan |
112 |
| - run: vendor/bin/phpstan |
113 |
| - |
114 |
| - - name: Execute Rector |
115 |
| - run: vendor/bin/rector --dry-run |
116 |
| - |
117 |
| - - name: Execute PHP Insights |
118 |
| - run: vendor/bin/phpinsights --no-interaction |
119 |
| - |
120 | 17 | laravel10-tests:
|
121 | 18 | runs-on: ubuntu-latest
|
122 | 19 |
|
|
0 commit comments