7
7
name : CI
8
8
9
9
env :
10
- COMPOSER_ROOT_VERSION : " 11.0.x-dev"
10
+ COMPOSER_ROOT_VERSION : 11.0.x-dev
11
+ PHP_VERSION : 8.4
11
12
12
13
jobs :
13
14
coding-guidelines :
@@ -17,12 +18,23 @@ jobs:
17
18
18
19
steps :
19
20
- name : Checkout
20
- uses : actions/checkout@v4
21
+ uses : actions/checkout@v5
22
+ with :
23
+ fetch-depth : 1
24
+ ref : ${{ github.event.pull_request.head.sha || github.sha }}
25
+
26
+ - name : Use local branch
27
+ shell : bash
28
+ run : |
29
+ BRANCH=$([ "${{ github.event_name }}" == "pull_request" ] && echo "${{ github.head_ref }}" || echo "${{ github.ref_name }}")
30
+ git branch -D $BRANCH 2>/dev/null || true
31
+ git branch $BRANCH HEAD
32
+ git checkout $BRANCH
21
33
22
34
- name : Install PHP
23
35
uses : shivammathur/setup-php@v2
24
36
with :
25
- php-version : 8.3
37
+ php-version : ${{ env.PHP_VERSION }}
26
38
extensions : none, iconv, json, phar, tokenizer
27
39
coverage : none
28
40
tools : none
@@ -37,17 +49,41 @@ jobs:
37
49
38
50
steps :
39
51
- name : Checkout
40
- uses : actions/checkout@v4
52
+ uses : actions/checkout@v5
53
+ with :
54
+ fetch-depth : 1
55
+ ref : ${{ github.event.pull_request.head.sha || github.sha }}
56
+
57
+ - name : Use local branch
58
+ shell : bash
59
+ run : |
60
+ BRANCH=$([ "${{ github.event_name }}" == "pull_request" ] && echo "${{ github.head_ref }}" || echo "${{ github.ref_name }}")
61
+ git branch -D $BRANCH 2>/dev/null || true
62
+ git branch $BRANCH HEAD
63
+ git checkout $BRANCH
41
64
42
65
- name : Install PHP
43
66
uses : shivammathur/setup-php@v2
44
67
with :
45
- php-version : 8.4
68
+ php-version : ${{ env.PHP_VERSION }}
46
69
extensions : none, ctype, curl, dom, iconv, mbstring, opcache, simplexml, tokenizer, xml, xmlwriter
47
70
coverage : none
48
71
tools : none
49
72
50
- - name : Install dependencies with Composer
73
+ - name : Get Composer cache directory
74
+ id : composer-cache
75
+ shell : bash
76
+ run : |
77
+ echo "dir=$(composer config cache-files-dir)" >> "$GITHUB_OUTPUT"
78
+
79
+ - name : Cache Composer cache directory
80
+ uses : actions/cache@v4
81
+ with :
82
+ path : ${{ steps.composer-cache.outputs.dir }}
83
+ key : ${{ runner.os }}-composer-${{ hashFiles('**/composer.lock') }}
84
+ restore-keys : ${{ runner.os }}-composer-
85
+
86
+ - name : Update dependencies with composer
51
87
run : ./tools/composer update --no-interaction --no-ansi --no-progress
52
88
53
89
- name : Run PHPStan
@@ -70,22 +106,33 @@ jobs:
70
106
- windows-latest
71
107
72
108
php-version :
73
- - " 8.2"
74
- - " 8.3"
75
- - " 8.4"
76
- - " 8.5"
109
+ - 8.2
110
+ - 8.3
111
+ - 8.4
112
+ - 8.5
77
113
78
114
coverage-driver :
79
- - " pcov"
80
- - " xdebug3"
115
+ - pcov
116
+ - xdebug3
81
117
82
118
steps :
83
119
- name : Configure Git to avoid issues with line endings
84
120
if : matrix.os == 'windows-latest'
85
121
run : git config --global core.autocrlf false
86
122
87
123
- name : Checkout
88
- uses : actions/checkout@v4
124
+ uses : actions/checkout@v5
125
+ with :
126
+ fetch-depth : 1
127
+ ref : ${{ github.event.pull_request.head.sha || github.sha }}
128
+
129
+ - name : Use local branch
130
+ shell : bash
131
+ run : |
132
+ BRANCH=$([ "${{ github.event_name }}" == "pull_request" ] && echo "${{ github.head_ref }}" || echo "${{ github.ref_name }}")
133
+ git branch -D $BRANCH 2>/dev/null || true
134
+ git branch $BRANCH HEAD
135
+ git checkout $BRANCH
89
136
90
137
- name : Install PHP with extensions
91
138
uses : shivammathur/setup-php@v2
@@ -96,19 +143,36 @@ jobs:
96
143
ini-values : ${{ env.PHP_INI_VALUES }}
97
144
tools : none
98
145
146
+ - name : Get Composer cache directory
147
+ id : composer-cache
148
+ shell : bash
149
+ run : |
150
+ echo "dir=$(composer config cache-files-dir)" >> "$GITHUB_OUTPUT"
151
+
152
+ - name : Cache Composer cache directory
153
+ uses : actions/cache@v4
154
+ with :
155
+ path : ${{ steps.composer-cache.outputs.dir }}
156
+ key : ${{ runner.os }}-composer-${{ hashFiles('**/composer.lock') }}
157
+ restore-keys : ${{ runner.os }}-composer-
158
+
99
159
- name : Install dependencies with Composer
100
160
run : php ./tools/composer update --no-ansi --no-interaction --no-progress
101
161
102
162
- name : Run tests with PHPUnit
103
- run : vendor/bin/phpunit --log-junit junit .xml --coverage-clover=coverage.xml
163
+ run : vendor/bin/phpunit --log-junit test-results .xml --coverage-clover=code- coverage.xml
104
164
105
165
- name : Upload test results to Codecov.io
106
166
if : ${{ !cancelled() }}
107
167
uses : codecov/test-results-action@v1
108
168
with :
109
169
token : ${{ secrets.CODECOV_TOKEN }}
170
+ disable_search : true
171
+ files : ./test-results.xml
110
172
111
173
- name : Upload code coverage data to Codecov.io
112
174
uses : codecov/codecov-action@v4
113
175
with :
114
176
token : ${{ secrets.CODECOV_TOKEN }}
177
+ disable_search : true
178
+ files : ./code-coverage.xml
0 commit comments