1616 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
2929 - name : Upload build archive for test runners
3030 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 :
4545 steps :
4646 - 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
@@ -62,21 +62,24 @@ jobs:
6262 coverage_clover : _coverage/clover.xml
6363
6464 - name : Store coverage data
65- uses : actions/upload-artifact@v3
65+ uses : actions/upload-artifact@v4
6666 with :
67- name : code-coverage
67+ name : code-coverage-${{ matrix.php }}-${{ github.run_number }}
6868 path : _coverage
6969
7070 coverage :
7171 runs-on : ubuntu-latest
7272 needs : [ phpunit ]
73+ strategy :
74+ matrix :
75+ php : [ 8.1, 8.2, 8.3, 8.4 ]
7376
7477 steps :
7578 - uses : actions/checkout@v4
7679
7780 - uses : actions/download-artifact@v4
7881 with :
79- name : code-coverage
82+ name : code-coverage-${{ matrix.php }}-${{ github.run_number }}
8083 path : _coverage
8184
8285 - name : Output coverage
9598 steps :
9699 - uses : actions/download-artifact@v4
97100 with :
98- name : build-artifact
101+ name : build-artifact-${{ matrix.php }}
99102 path : /tmp/github-actions
100103
101104 - name : Extract build archive
@@ -117,7 +120,7 @@ jobs:
117120 steps :
118121 - uses : actions/download-artifact@v4
119122 with :
120- name : build-artifact
123+ name : build-artifact-${{ matrix.php }}
121124 path : /tmp/github-actions
122125
123126 - name : Extract build archive
@@ -141,7 +144,7 @@ jobs:
141144 steps :
142145 - uses : actions/download-artifact@v4
143146 with :
144- name : build-artifact
147+ name : build-artifact-${{ matrix.php }}
145148 path : /tmp/github-actions
146149
147150 - name : Extract build archive
@@ -162,7 +165,7 @@ jobs:
162165 env :
163166 GH_TOKEN : ${{ github.token }}
164167 run : |
165- gh api "/repos/${{ github.repository }}/actions/artifacts?name=build-artifact" | jq ".artifacts[] | select(.name == \"build-artifact\") | .id" > artifact-id-list.txt
168+ gh api "/repos/${{ github.repository }}/actions/artifacts?name=build-artifact" | jq ".artifacts[] | select(.name | startswith( \"build-artifact\") ) | .id" > artifact-id-list.txt
166169 while read id
167170 do
168171 echo -n "Deleting artifact ID $id ... "
0 commit comments