1
1
name : CI
2
2
3
- on : [push]
3
+ on : [push, pull_request]
4
+
5
+ permissions :
6
+ contents : read
7
+ actions : read
8
+ id-token : none
4
9
5
10
jobs :
6
11
composer :
7
12
runs-on : ubuntu-latest
8
13
strategy :
9
14
matrix :
10
- php : [ 8.1, 8.2, 8. 3, 8.4 ]
15
+ php : [ 8.3, 8.4 ]
11
16
12
17
steps :
13
18
- uses : actions/checkout@v4
24
29
php_version : ${{ matrix.php }}
25
30
26
31
- name : Archive build
27
- run : mkdir /tmp/github-actions/ && tar -cvf /tmp/github-actions/build.tar ./
32
+ run : mkdir /tmp/github-actions/ && tar --exclude=".git" - cvf /tmp/github-actions/build.tar ./
28
33
29
34
- name : Upload build archive for test runners
30
35
uses : actions/upload-artifact@v4
37
42
needs : [ composer ]
38
43
strategy :
39
44
matrix :
40
- php : [ 8.1, 8.2, 8. 3, 8.4 ]
45
+ php : [ 8.3, 8.4 ]
41
46
42
47
outputs :
43
48
coverage : ${{ steps.store-coverage.outputs.coverage_text }}
56
61
env :
57
62
XDEBUG_MODE : cover
58
63
with :
59
- version : 10
60
64
php_version : ${{ matrix.php }}
61
65
php_extensions : xdebug
62
66
coverage_text : _coverage/coverage.txt
73
77
needs : [ phpunit ]
74
78
strategy :
75
79
matrix :
76
- php : [ 8.1, 8.2, 8. 3, 8.4 ]
80
+ php : [ 8.3, 8.4 ]
77
81
78
82
steps :
83
+ - uses : actions/checkout@v4
84
+
79
85
- uses : actions/download-artifact@v4
80
86
with :
81
87
name : code-coverage-${{ matrix.php }}-${{ github.run_number }}
@@ -85,16 +91,14 @@ jobs:
85
91
run : cat "_coverage/coverage.txt"
86
92
87
93
- name : Upload to Codecov
88
- uses : codecov/codecov-action@v4
89
- with :
90
- token : ${{ secrets.CODECOV_TOKEN }}
94
+ uses : codecov/codecov-action@v5
91
95
92
96
phpstan :
93
97
runs-on : ubuntu-latest
94
98
needs : [ composer ]
95
99
strategy :
96
100
matrix :
97
- php : [ 8.1, 8.2, 8. 3, 8.4 ]
101
+ php : [ 8.3, 8.4 ]
98
102
99
103
steps :
100
104
- uses : actions/download-artifact@v4
@@ -110,14 +114,13 @@ jobs:
110
114
with :
111
115
php_version : ${{ matrix.php }}
112
116
path : src/
113
- level : 6
114
117
115
118
phpmd :
116
119
runs-on : ubuntu-latest
117
120
needs : [ composer ]
118
121
strategy :
119
122
matrix :
120
- php : [ 8.1, 8.2, 8. 3, 8.4 ]
123
+ php : [ 8.3, 8.4 ]
121
124
122
125
steps :
123
126
- uses : actions/download-artifact@v4
@@ -141,7 +144,7 @@ jobs:
141
144
needs : [ composer ]
142
145
strategy :
143
146
matrix :
144
- php : [ 8.1, 8.2, 8. 3, 8.4 ]
147
+ php : [ 8.3, 8.4 ]
145
148
146
149
steps :
147
150
- uses : actions/download-artifact@v4
@@ -162,12 +165,15 @@ jobs:
162
165
remove_old_artifacts :
163
166
runs-on : ubuntu-latest
164
167
168
+ permissions :
169
+ actions : write
170
+
165
171
steps :
166
172
- name : Remove old artifacts for prior workflow runs on this repository
167
173
env :
168
174
GH_TOKEN : ${{ github.token }}
169
175
run : |
170
- gh api "/repos/${{ github.repository }}/actions/artifacts?name=build-artifact " | jq ".artifacts[] | select(.name | startswith(\"build-artifact\")) | .id" > artifact-id-list.txt
176
+ gh api "/repos/${{ github.repository }}/actions/artifacts" | jq ".artifacts[] | select(.name | startswith(\"build-artifact\")) | .id" > artifact-id-list.txt
171
177
while read id
172
178
do
173
179
echo -n "Deleting artifact ID $id ... "
0 commit comments