19
19
env :
20
20
default-php-version : ' 8.2'
21
21
default-laravel-version : ' 10.*'
22
- semantic-node-version : 18
22
+ semantic-node-version : 20
23
+
24
+ concurrency :
25
+ group : Tests ${{ github.ref }}
26
+ cancel-in-progress : true
23
27
24
28
jobs :
25
29
tests :
29
33
strategy :
30
34
fail-fast : false
31
35
matrix :
32
- php-version : ['8.1','8.2']
33
- laravel-version : [9.*, 10.*]
36
+ php-version : ['8.1', '8.2', '8.3 ']
37
+ laravel-version : [' 9.*', ' 10.*' ]
34
38
psr7 : ['guzzle']
35
39
include :
36
40
- php-version : ' 8.1'
63
67
run : composer -V
64
68
- name : Check PHP Extensions
65
69
run : php -m
70
+ - name : Setup problem matchers for PHP
71
+ run : echo "::add-matcher::${{ runner.tool_cache }}/php.json"
66
72
67
73
- name : Validate composer.json
68
74
run : composer validate
71
77
id : composer-cache
72
78
run : echo "dir=$(composer config cache-files-dir)" >> $GITHUB_OUTPUT
73
79
- name : Cache composer files
74
- uses : actions/cache@v3
80
+ uses : actions/cache@v4
75
81
with :
76
82
path : ${{ steps.composer-cache.outputs.dir }}
77
83
key : ${{ runner.os }}-composer-v4-${{ hashFiles('**/composer.json') }}-${{ matrix.php-version }}-${{ matrix.laravel-version }}
@@ -104,24 +110,25 @@ jobs:
104
110
run : |
105
111
composer update --no-interaction --no-progress --prefer-dist
106
112
107
- - name : Setup problem matchers
108
- run : |
109
- echo "::add-matcher::${{ runner.tool_cache }}/php.json"
110
- echo "::add-matcher::${{ runner.tool_cache }}/phpunit.json"
113
+ - name : Set results artifact name
114
+ id : artifact
115
+ run : echo "name=${{ matrix.php-version }}_${{ matrix.laravel-version }}${{ matrix.psr7 }}" | sed -e "s/*//g" >> $GITHUB_OUTPUT
111
116
117
+ - name : Setup problem matchers
118
+ run : echo "::add-matcher::${{ runner.tool_cache }}/phpunit.json"
112
119
- name : Run test suite
113
120
run : vendor/bin/phpunit -c phpunit.xml --log-junit ./results/results_${{ matrix.psr7 }}.xml --coverage-clover ./results/coverage_${{ matrix.psr7 }}.xml
114
121
115
122
- name : Fix results files
123
+ if : success() || failure()
116
124
run : sed -i -e "s%$GITHUB_WORKSPACE/%%g" *.xml
117
125
working-directory : results
118
- if : success() || failure()
119
126
120
127
- name : Store results
121
- if : matrix.php-version == env.default-php-version && matrix.laravel-version == env.default-laravel-version && ( success() || failure() )
122
- uses : actions/upload-artifact@v3
128
+ if : success() || failure()
129
+ uses : actions/upload-artifact@v4
123
130
with :
124
- name : results
131
+ name : results_${{ steps.artifact.outputs.name }}
125
132
path : results
126
133
127
134
@@ -140,16 +147,19 @@ jobs:
140
147
fetch-depth : 0
141
148
142
149
- name : Download results
143
- uses : actions/download-artifact@v3
150
+ uses : actions/download-artifact@v4
144
151
with :
145
- name : results
152
+ pattern : ${{ format('results_{0}_{1}', env.default-php-version, env.default-laravel-version) }}
146
153
path : results
154
+ merge-multiple : true
147
155
148
156
- name : Merge junit files
149
157
run : |
158
+ mkdir -p $RUNNER_TEMP/junit-merge
159
+ cd $RUNNER_TEMP/junit-merge
150
160
npm init -y
151
161
yarn set version berry
152
- yarn dlx junit-report-merger . /results/results.xml ". /results/results* .xml"
162
+ yarn dlx junit-merge --recursive --dir $GITHUB_WORKSPACE /results --out $GITHUB_WORKSPACE /results/results.xml
153
163
154
164
- name : Set coverage list
155
165
id : coverage
@@ -159,7 +169,7 @@ jobs:
159
169
160
170
- name : SonarCloud Scan
161
171
if : env.SONAR_TOKEN != ''
162
- uses : SonarSource/sonarcloud-github-action@v2.0.2
172
+ uses : SonarSource/sonarcloud-github-action@v2
163
173
env :
164
174
GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
165
175
SONAR_TOKEN : ${{ secrets.SONAR_TOKEN }}
@@ -207,7 +217,7 @@ jobs:
207
217
208
218
- name : Store changelog file
209
219
if : steps.semantic.outputs.new_release_published == 'true'
210
- uses : actions/upload-artifact@v3
220
+ uses : actions/upload-artifact@v4
211
221
with :
212
222
name : changelog
213
223
path : CHANGELOG.md
0 commit comments