11name : CI
22
3- on : [push]
3+ on : ['push', 'pull_request']
4+
5+ permissions :
6+ contents : read
7+ packages : write
48
59jobs :
6- build-test :
10+ tests :
711 runs-on : ubuntu-latest
812 continue-on-error : true
913 strategy :
1014 matrix :
11- php : [7.3, 7.4, 8.0, 8.1, 8.2]
12- laravel : [6 .*, 7 .*, 8.*, 9.*, 10 .*]
15+ php : [8.0, 8.1, 8.2]
16+ laravel : [10 .*, 11 .*, 12 .*]
1317 exclude :
14- - laravel : 6.*
15- php : 8.1
16- - laravel : 6.*
17- php : 8.2
18- - laravel : 7.*
19- php : 8.1
20- - laravel : 7.*
21- php : 8.2
22- - laravel : 9.*
18+ - laravel : 10.*
19+ php : 8.0
20+ - laravel : 11.*
2321 php : 7.3
24- - laravel : 9 .*
22+ - laravel : 11 .*
2523 php : 7.4
26- - laravel : 10.*
24+ - laravel : 11.*
25+ php : 8.0
26+ - laravel : 11.*
27+ php : 8.1
28+ - laravel : 12.*
2729 php : 7.3
28- - laravel : 10 .*
30+ - laravel : 12 .*
2931 php : 7.4
30- - laravel : 10 .*
32+ - laravel : 12 .*
3133 php : 8.0
34+ - laravel : 12.*
35+ php : 8.1
3236
3337 name : PHP ${{ matrix.php }} on Laravel ${{ matrix.laravel }}
3438
3539 steps :
36- - uses : actions/checkout@v2
37- - uses : php-actions/composer@v6
38- with :
39- php_version : 8
40- - uses : php-actions/phpunit@v3
40+ - name : Checkout code
41+ uses : actions/checkout@v2
42+ - name : Setup PHP
43+ uses : shivammathur/setup-php@v2
4144 with :
42- php_version : 8
45+ php-version : ${{ matrix.php }}
46+ - name : Install dependencies
47+ run : |
48+ composer require "illuminate/console:${{ matrix.laravel }}" "illuminate/database:${{ matrix.laravel }}" "illuminate/support:${{ matrix.laravel }}" --no-interaction --no-update
49+ composer update
50+ - name : Run tests
51+ run : vendor/bin/phpunit
52+
53+ docker :
54+ # Only push Docker image for direct pushes to master branch
55+ if : github.event_name == 'push' && github.ref == 'refs/heads/master'
56+ runs-on : ubuntu-latest
57+ needs : tests
58+ steps :
59+ - name : Checkout code
60+ uses : actions/checkout@v4
61+ - name : Log in to the Container registry
62+ uses : docker/login-action@v3
63+ with :
64+ registry : ghcr.io
65+ username : ${{ github.actor }}
66+ password : ${{ secrets.GITHUB_TOKEN }}
67+ - name : Build and push Docker image
68+ uses : docker/build-push-action@v5
69+ with :
70+ context : .
71+ push : true
72+ tags : ghcr.io/${{ github.repository }}:latest
0 commit comments