1
- name : run-tests
1
+ name : Tests
2
2
3
3
on :
4
4
push :
5
- branches : [main, master ]
5
+ branches : [master, main ]
6
6
pull_request :
7
- branches : [main, master ]
7
+ branches : [master, main ]
8
8
9
9
jobs :
10
10
test :
11
- runs-on : ${{ matrix.os }}
12
- strategy :
13
- fail-fast : true
14
- matrix :
15
- os : [ubuntu-latest]
16
- php : [8.2, 8.3]
17
- laravel : [10.*, 11.*, 12.*]
18
- stability : [prefer-lowest, prefer-stable]
19
- include :
20
- - laravel : 12.*
21
- testbench : 9.*
22
- - laravel : 11.*
23
- testbench : 9.*
24
- - laravel : 10.*
25
- testbench : 8.*
26
-
27
- name : P${{ matrix.php }} - L${{ matrix.laravel }} - ${{ matrix.stability }} - ${{ matrix.os }}
28
-
11
+ runs-on : ubuntu-latest
12
+
29
13
services :
30
14
rabbitmq :
31
- image : rabbitmq:3.8 -management-alpine
15
+ image : rabbitmq:3.12 -management
32
16
env :
33
17
RABBITMQ_DEFAULT_USER : guest
34
18
RABBITMQ_DEFAULT_PASS : guest
41
25
--health-timeout 5s
42
26
--health-retries 5
43
27
28
+ strategy :
29
+ fail-fast : true
30
+ matrix :
31
+ php : [8.2, 8.3]
32
+ laravel : [11.*, 12.*]
33
+ stability : [prefer-lowest, prefer-stable]
34
+ include :
35
+ - laravel : 11.*
36
+ testbench : ^9.0
37
+ carbon : ^2.63|^3.0
38
+ - laravel : 12.*
39
+ testbench : ^10.1
40
+ carbon : ^2.63|^3.0
41
+ exclude :
42
+ - laravel : 12.*
43
+ php : 8.2
44
+ stability : prefer-lowest
45
+
46
+ name : P${{ matrix.php }} - L${{ matrix.laravel }} - ${{ matrix.stability }}
47
+
44
48
steps :
45
49
- name : Checkout code
46
50
uses : actions/checkout@v4
49
53
uses : shivammathur/setup-php@v2
50
54
with :
51
55
php-version : ${{ matrix.php }}
52
- extensions : dom, curl, libxml, mbstring, zip, pcntl, pdo, sqlite, pdo_sqlite, bcmath, soap, intl, gd, exif, iconv, imagick, fileinfo
56
+ extensions : dom, curl, libxml, mbstring, zip, pcntl, pdo, sqlite, pdo_sqlite, bcmath, soap, intl, gd, exif, iconv, imagick, fileinfo, pcntl
53
57
coverage : none
54
58
55
59
- name : Setup problem matchers
@@ -59,17 +63,78 @@ jobs:
59
63
60
64
- name : Install dependencies
61
65
run : |
62
- composer require "laravel/framework:${{ matrix.laravel }}" "orchestra/testbench:${{ matrix.testbench }}" --no-interaction --no-update
66
+ composer require "laravel/framework:${{ matrix.laravel }}" "orchestra/testbench:${{ matrix.testbench }}" "nesbot/carbon:${{ matrix.carbon }}" --no-interaction --no-update
63
67
composer update --${{ matrix.stability }} --prefer-dist --no-interaction
64
68
65
69
- name : List Installed Dependencies
66
70
run : composer show -D
67
71
72
+ - name : Wait for RabbitMQ
73
+ run : |
74
+ timeout 60 bash -c 'until printf "" 2>>/dev/null >>/dev/tcp/localhost/5672; do sleep 1; done'
75
+ echo "RabbitMQ is ready"
76
+
68
77
- name : Execute tests
69
- run : vendor/bin/phpunit
78
+ run : vendor/bin/phpunit --verbose
79
+ env :
80
+ RABBITMQ_HOST : localhost
81
+ RABBITMQ_PORT : 5672
82
+ RABBITMQ_USER : guest
83
+ RABBITMQ_PASSWORD : guest
84
+ RABBITMQ_VHOST : /
85
+
86
+ coverage :
87
+ runs-on : ubuntu-latest
88
+
89
+ services :
90
+ rabbitmq :
91
+ image : rabbitmq:3.12-management
92
+ env :
93
+ RABBITMQ_DEFAULT_USER : guest
94
+ RABBITMQ_DEFAULT_PASS : guest
95
+ ports :
96
+ - 5672:5672
97
+ - 15672:15672
98
+ options : >-
99
+ --health-cmd "rabbitmq-diagnostics -q ping"
100
+ --health-interval 10s
101
+ --health-timeout 5s
102
+ --health-retries 5
103
+
104
+ name : Coverage
105
+
106
+ steps :
107
+ - name : Checkout code
108
+ uses : actions/checkout@v4
109
+
110
+ - name : Setup PHP
111
+ uses : shivammathur/setup-php@v2
112
+ with :
113
+ php-version : 8.3
114
+ extensions : dom, curl, libxml, mbstring, zip, pcntl, pdo, sqlite, pdo_sqlite, bcmath, soap, intl, gd, exif, iconv, imagick, fileinfo, pcntl
115
+ coverage : xdebug
116
+
117
+ - name : Install dependencies
118
+ run : |
119
+ composer require "laravel/framework:^12.0" "orchestra/testbench:^10.1" "nesbot/carbon:^2.63|^3.0" --no-interaction --no-update
120
+ composer update --prefer-stable --prefer-dist --no-interaction
121
+
122
+ - name : Wait for RabbitMQ
123
+ run : |
124
+ timeout 60 bash -c 'until printf "" 2>>/dev/null >>/dev/tcp/localhost/5672; do sleep 1; done'
125
+ echo "RabbitMQ is ready"
126
+
127
+ - name : Execute tests with coverage
128
+ run : vendor/bin/phpunit --coverage-text --coverage-clover=coverage.clover
70
129
env :
71
130
RABBITMQ_HOST : localhost
72
131
RABBITMQ_PORT : 5672
73
132
RABBITMQ_USER : guest
74
133
RABBITMQ_PASSWORD : guest
75
134
RABBITMQ_VHOST : /
135
+
136
+ - name : Upload coverage to Codecov
137
+ uses : codecov/codecov-action@v3
138
+ with :
139
+ file : ./coverage.clover
140
+ fail_ci_if_error : false
0 commit comments