|
1 |
| -name: Run tests |
2 |
| - |
3 |
| -on: [ push, pull_request ] |
4 |
| - |
5 |
| -jobs: |
6 |
| - php-tests: |
7 |
| - runs-on: ubuntu-latest |
8 |
| - |
9 |
| - strategy: |
10 |
| - fail-fast: false |
11 |
| - matrix: |
12 |
| - php: [ 7.4, '8.0', 8.1, 8.2, 8.3 ] |
13 |
| - laravel: [ 8.*, 9.*, 10.*, 11.* ] |
14 |
| - stability: [ prefer-stable ] |
15 |
| - exclude: |
16 |
| - - laravel: 8.* |
17 |
| - php: 8.2 |
18 |
| - - laravel: 8.* |
19 |
| - php: 8.3 |
20 |
| - - laravel: 9.* |
21 |
| - php: 7.4 |
22 |
| - - laravel: 9.* |
23 |
| - php: 8.3 |
24 |
| - - laravel: 10.* |
25 |
| - php: 7.4 |
26 |
| - - laravel: 10.* |
27 |
| - php: '8.0' |
28 |
| - - laravel: 11.* |
29 |
| - php: 7.4 |
30 |
| - - laravel: 11.* |
31 |
| - php: '8.0' |
32 |
| - - laravel: 11.* |
33 |
| - php: 8.1 |
34 |
| - include: |
35 |
| - - laravel: 8.* |
36 |
| - phpunit: ^9.5 |
37 |
| - - laravel: 9.* |
38 |
| - phpunit: ^9.5 |
39 |
| - - laravel: 10.* |
40 |
| - phpunit: ^10.5 |
41 |
| - - laravel: 11.* |
42 |
| - phpunit: ^10.5 |
43 |
| - |
44 |
| - name: P${{ matrix.php }} - L${{ matrix.laravel }} - ${{ matrix.stability }} |
45 |
| - |
46 |
| - steps: |
47 |
| - - name: Checkout code |
48 |
| - uses: actions/checkout@v4 |
49 |
| - with: |
50 |
| - # Fetch 10 commits or Scrutinizer will throw |
51 |
| - fetch-depth: 10 |
52 |
| - |
53 |
| - - name: Setup PHP |
54 |
| - uses: shivammathur/setup-php@v2 |
55 |
| - with: |
56 |
| - php-version: ${{ matrix.php }} |
57 |
| - coverage: xdebug |
58 |
| - tools: composer:v2 |
59 |
| - |
60 |
| - - name: Get composer cache directory |
61 |
| - id: composer-cache |
62 |
| - run: echo "dir=$(composer config cache-files-dir)" >> $GITHUB_OUTPUT |
63 |
| - |
64 |
| - - name: Cache composer dependencies |
65 |
| - uses: actions/cache@v4 |
66 |
| - with: |
67 |
| - path: ${{ steps.composer-cache.outputs.dir }} |
68 |
| - key: php-${{ matrix.php }}-laravel-${{ matrix.laravel }}-composer-${{ matrix.stability }}-${{ hashFiles('**/composer.json') }} |
69 |
| - restore-keys: php-${{ matrix.php }}-laravel-${{ matrix.laravel }}-composer-${{ matrix.stability }}- |
70 |
| - |
71 |
| - - name: Install dependencies |
72 |
| - run: | |
73 |
| - composer require "illuminate/contracts:${{ matrix.laravel }}" --no-interaction --no-update |
74 |
| - composer require "phpunit/phpunit:${{ matrix.phpunit }}" --dev --no-interaction --no-update |
75 |
| - composer update --${{ matrix.stability }} --prefer-dist --no-interaction |
76 |
| -
|
77 |
| - - name: Execute tests |
78 |
| - run: XDEBUG_MODE=coverage vendor/bin/phpunit --configuration=${{ matrix.phpunit == '^9.5' && 'phpunit-9.xml' || 'phpunit.xml' }} --coverage-text --coverage-clover=coverage.clover |
79 |
| - |
80 |
| - - name: Upload Scrutinizer coverage |
81 |
| - uses: sudo-bot/action-scrutinizer@latest |
82 |
| - # Do not run this step on forked versions of the main repository (example: contributor forks) |
83 |
| - if: matrix.laravel == '9.*' && github.repository == 'swisnl/json-api-client-laravel' |
84 |
| - with: |
85 |
| - cli-args: "--format=php-clover coverage.clover --revision=${{ github.event.pull_request.head.sha || github.sha }}" |
| 1 | +name: Run tests |
| 2 | + |
| 3 | +on: |
| 4 | + - push |
| 5 | + - pull_request |
| 6 | + |
| 7 | +jobs: |
| 8 | + php-tests: |
| 9 | + runs-on: ubuntu-latest |
| 10 | + |
| 11 | + strategy: |
| 12 | + fail-fast: false |
| 13 | + matrix: |
| 14 | + php: [7.4, '8.0', 8.1, 8.2, 8.3] |
| 15 | + laravel: ['8.*', '9.*', '10.*', '11.*', '12.*'] |
| 16 | + stability: [prefer-stable] |
| 17 | + exclude: |
| 18 | + - laravel: 8.* |
| 19 | + php: 8.2 |
| 20 | + - laravel: 8.* |
| 21 | + php: 8.3 |
| 22 | + - laravel: 9.* |
| 23 | + php: 7.4 |
| 24 | + - laravel: 9.* |
| 25 | + php: 8.3 |
| 26 | + - laravel: 10.* |
| 27 | + php: 7.4 |
| 28 | + - laravel: 10.* |
| 29 | + php: '8.0' |
| 30 | + - laravel: 11.* |
| 31 | + php: 7.4 |
| 32 | + - laravel: 11.* |
| 33 | + php: '8.0' |
| 34 | + - laravel: 11.* |
| 35 | + php: 8.1 |
| 36 | + - laravel: 12.* |
| 37 | + php: 7.4 |
| 38 | + - laravel: 12.* |
| 39 | + php: '8.0' |
| 40 | + - laravel: 12.* |
| 41 | + php: 8.1 |
| 42 | + include: |
| 43 | + - laravel: 8.* |
| 44 | + phpunit: ^9.5 |
| 45 | + - laravel: 9.* |
| 46 | + phpunit: ^9.5 |
| 47 | + - laravel: 10.* |
| 48 | + phpunit: ^10.5 |
| 49 | + - laravel: 11.* |
| 50 | + phpunit: ^10.5 |
| 51 | + - laravel: 12.* |
| 52 | + phpunit: ^11.5 |
| 53 | + |
| 54 | + name: P${{ matrix.php }} - L${{ matrix.laravel }} - ${{ matrix.stability }} |
| 55 | + |
| 56 | + steps: |
| 57 | + - name: Checkout code |
| 58 | + uses: actions/checkout@v4 |
| 59 | + with: |
| 60 | + # Fetch 10 commits or Scrutinizer will throw |
| 61 | + fetch-depth: 10 |
| 62 | + |
| 63 | + - name: Setup PHP |
| 64 | + uses: shivammathur/setup-php@v2 |
| 65 | + with: |
| 66 | + php-version: ${{ matrix.php }} |
| 67 | + coverage: xdebug |
| 68 | + tools: composer:v2 |
| 69 | + |
| 70 | + - name: Get composer cache directory |
| 71 | + id: composer-cache |
| 72 | + run: echo "dir=$(composer config cache-files-dir)" >> $GITHUB_OUTPUT |
| 73 | + |
| 74 | + - name: Cache composer dependencies |
| 75 | + uses: actions/cache@v4 |
| 76 | + with: |
| 77 | + path: ${{ steps.composer-cache.outputs.dir }} |
| 78 | + key: php-${{ matrix.php }}-laravel-${{ matrix.laravel }}-composer-${{ matrix.stability }}-${{ hashFiles('**/composer.json') }} |
| 79 | + restore-keys: php-${{ matrix.php }}-laravel-${{ matrix.laravel }}-composer-${{ matrix.stability }}- |
| 80 | + |
| 81 | + - name: Install dependencies |
| 82 | + run: | |
| 83 | + composer require "illuminate/contracts:${{ matrix.laravel }}" --no-interaction --no-update |
| 84 | + composer require "phpunit/phpunit:${{ matrix.phpunit }}" --dev --no-interaction --no-update |
| 85 | + composer update --${{ matrix.stability }} --prefer-dist --no-interaction |
| 86 | +
|
| 87 | + - name: Execute tests |
| 88 | + run: XDEBUG_MODE=coverage vendor/bin/phpunit --configuration=${{ matrix.phpunit == '^9.5' && 'phpunit-9.xml' || 'phpunit.xml' }} --coverage-text --coverage-clover=coverage.clover |
| 89 | + |
| 90 | + - name: Upload Scrutinizer coverage |
| 91 | + uses: sudo-bot/action-scrutinizer@latest |
| 92 | + # Do not run this step on forked versions of the main repository (example: contributor forks) |
| 93 | + if: "matrix.laravel == '9.*' && github.repository == 'swisnl/json-api-client-laravel'" |
| 94 | + with: |
| 95 | + cli-args: --format=php-clover coverage.clover --revision=${{ github.event.pull_request.head.sha || github.sha }} |
0 commit comments