Skip to content
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Commit ba77366

Browse files
committedFeb 19, 2025··
Update GitHub Actions for Laravel 12
1 parent b8e5e66 commit ba77366

File tree

1 file changed

+93
-85
lines changed

1 file changed

+93
-85
lines changed
 

‎.github/workflows/tests.yml

+93-85
Original file line numberDiff line numberDiff line change
@@ -1,85 +1,93 @@
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: '8.2'
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-depth: 10
61+
62+
- name: Setup PHP
63+
uses: shivammathur/setup-php@v2
64+
with:
65+
php-version: ${{ matrix.php }}
66+
coverage: xdebug
67+
tools: composer:v2
68+
69+
- name: Get composer cache directory
70+
id: composer-cache
71+
run: echo "dir=$(composer config cache-files-dir)" >> $GITHUB_OUTPUT
72+
73+
- name: Cache composer dependencies
74+
uses: actions/cache@v4
75+
with:
76+
path: ${{ steps.composer-cache.outputs.dir }}
77+
key: php-${{ matrix.php }}-laravel-${{ matrix.laravel }}-composer-${{ matrix.stability }}-${{ hashFiles('**/composer.json') }}
78+
restore-keys: php-${{ matrix.php }}-laravel-${{ matrix.laravel }}-composer-${{ matrix.stability }}-
79+
80+
- name: Install dependencies
81+
run: |
82+
composer require "illuminate/contracts:${{ matrix.laravel }}" --no-interaction --no-update
83+
composer require "phpunit/phpunit:${{ matrix.phpunit }}" --dev --no-interaction --no-update
84+
composer update --${{ matrix.stability }} --prefer-dist --no-interaction
85+
86+
- name: Execute tests
87+
run: XDEBUG_MODE=coverage vendor/bin/phpunit --configuration=${{ matrix.phpunit == '^9.5' && 'phpunit-9.xml' || 'phpunit.xml' }} --coverage-text --coverage-clover=coverage.clover
88+
89+
- name: Upload Scrutinizer coverage
90+
uses: sudo-bot/action-scrutinizer@latest
91+
if: "matrix.laravel == '9.*' && github.repository == 'swisnl/json-api-client-laravel'"
92+
with:
93+
cli-args: --format=php-clover coverage.clover --revision=${{ github.event.pull_request.head.sha || github.sha }}

0 commit comments

Comments
 (0)
Please sign in to comment.