77 runs-on : ubuntu-latest
88 strategy :
99 matrix :
10- php : [ 8.1, 8.2 ]
10+ php : [ 8.4 ]
1111
1212 steps :
13- - uses : actions/checkout@v3
13+ - uses : actions/checkout@v4
1414
1515 - name : Cache Composer dependencies
16- uses : actions/cache@v3
16+ uses : actions/cache@v4
1717 with :
1818 path : /tmp/composer-cache
19- key : ${{ runner.os }}-${{ hashFiles('**/composer.lock') }}
19+ key : ${{ runner.os }}-${{ matrix.php }}-${{ hashFiles('**/composer.lock') }}
2020
2121 - name : Composer install
2222 uses : php-actions/composer@v6
2323 with :
2424 php_version : ${{ matrix.php }}
2525
2626 - name : Archive build
27- run : mkdir /tmp/github-actions/ && tar -cvf /tmp/github-actions/build.tar ./
27+ run : mkdir /tmp/github-actions/ && tar --exclude=".git" - cvf /tmp/github-actions/build.tar ./
2828
2929 - name : Upload build archive for test runners
30- uses : actions/upload-artifact@v3
30+ uses : actions/upload-artifact@v4
3131 with :
32- name : build-artifact
32+ name : build-artifact-${{ matrix.php }}
3333 path : /tmp/github-actions
3434
3535 phpunit :
3636 runs-on : ubuntu-latest
3737 needs : [ composer ]
3838 strategy :
3939 matrix :
40- php : [ 8.1, 8.2 ]
40+ php : [ 8.4 ]
4141
4242 outputs :
4343 coverage : ${{ steps.store-coverage.outputs.coverage_text }}
4444
4545 steps :
46- - uses : actions/download-artifact@v3
46+ - uses : actions/download-artifact@v4
4747 with :
48- name : build-artifact
48+ name : build-artifact-${{ matrix.php }}
4949 path : /tmp/github-actions
5050
5151 - name : Extract build archive
5252 run : tar -xvf /tmp/github-actions/build.tar ./
5353
5454 - name : PHP Unit tests
55- uses : php-actions/phpunit@v3
55+ uses : php-actions/phpunit@v4
5656 env :
5757 XDEBUG_MODE : cover
5858 with :
5959 php_version : ${{ matrix.php }}
6060 php_extensions : xdebug
61- configuration : test/phpunit/phpunit.xml
62- bootstrap : vendor/autoload.php
6361 coverage_text : _coverage/coverage.txt
6462 coverage_clover : _coverage/clover.xml
6563
6664 - name : Store coverage data
67- uses : actions/upload-artifact@v3
65+ uses : actions/upload-artifact@v4
6866 with :
69- name : code-coverage
67+ name : code-coverage-${{ matrix.php }}-${{ github.run_number }}
7068 path : _coverage
7169
7270 coverage :
7371 runs-on : ubuntu-latest
7472 needs : [ phpunit ]
73+ strategy :
74+ matrix :
75+ php : [ 8.4 ]
7576
7677 steps :
77- - uses : actions/checkout@v3
78+ - uses : actions/checkout@v4
7879
79- - uses : actions/download-artifact@v3
80+ - uses : actions/download-artifact@v4
8081 with :
81- name : code-coverage
82+ name : code-coverage-${{ matrix.php }}-${{ github.run_number }}
8283 path : _coverage
8384
8485 - name : Output coverage
8586 run : cat "_coverage/coverage.txt"
8687
8788 - name : Upload to Codecov
88- uses : codecov/codecov-action@v3
89+ uses : codecov/codecov-action@v5
90+ with :
91+ token : ${{ secrets.CODECOV_TOKEN }}
92+ slug : PhpGt/Http
8993
9094 phpstan :
9195 runs-on : ubuntu-latest
9296 needs : [ composer ]
9397 strategy :
9498 matrix :
95- php : [ 8.1, 8.2 ]
99+ php : [ 8.4 ]
96100
97101 steps :
98- - uses : actions/download-artifact@v3
102+ - uses : actions/download-artifact@v4
99103 with :
100- name : build-artifact
104+ name : build-artifact-${{ matrix.php }}
101105 path : /tmp/github-actions
102106
103107 - name : Extract build archive
@@ -107,19 +111,20 @@ jobs:
107111 uses : php-actions/phpstan@v3
108112 with :
109113 php_version : ${{ matrix.php }}
114+ level : 6
110115 path : src/
111116
112117 phpmd :
113118 runs-on : ubuntu-latest
114119 needs : [ composer ]
115120 strategy :
116121 matrix :
117- php : [ 8.1, 8.2 ]
122+ php : [ 8.4 ]
118123
119124 steps :
120- - uses : actions/download-artifact@v3
125+ - uses : actions/download-artifact@v4
121126 with :
122- name : build-artifact
127+ name : build-artifact-${{ matrix.php }}
123128 path : /tmp/github-actions
124129
125130 - name : Extract build archive
@@ -138,12 +143,12 @@ jobs:
138143 needs : [ composer ]
139144 strategy :
140145 matrix :
141- php : [ 8.1, 8.2 ]
146+ php : [ 8.4 ]
142147
143148 steps :
144- - uses : actions/download-artifact@v3
149+ - uses : actions/download-artifact@v4
145150 with :
146- name : build-artifact
151+ name : build-artifact-${{ matrix.php }}
147152 path : /tmp/github-actions
148153
149154 - name : Extract build archive
@@ -159,14 +164,18 @@ jobs:
159164 remove_old_artifacts :
160165 runs-on : ubuntu-latest
161166
167+ permissions :
168+ actions : write
169+
162170 steps :
163171 - name : Remove old artifacts for prior workflow runs on this repository
164172 env :
165173 GH_TOKEN : ${{ github.token }}
166174 run : |
167- gh api "/repos/${{ github.repository }}/actions/artifacts?name=build-artifact " | jq ".artifacts[] | select(.name == \"build-artifact\") | .id" > artifact-id-list.txt
175+ gh api "/repos/${{ github.repository }}/actions/artifacts" | jq ".artifacts[] | select(.name | startswith( \"build-artifact\") ) | .id" > artifact-id-list.txt
168176 while read id
169177 do
170178 echo -n "Deleting artifact ID $id ... "
171179 gh api --method DELETE /repos/${{ github.repository }}/actions/artifacts/$id && echo "Done"
172180 done <artifact-id-list.txt
181+
0 commit comments