7
7
paths-ignore :
8
8
- ' **.md'
9
9
pull_request :
10
- paths-ignore :
11
- - ' **.md'
12
10
# Allow manually triggering the workflow.
13
11
workflow_dispatch :
14
12
13
+ # Cancels all previous workflow runs for the same branch that have not yet completed.
14
+ concurrency :
15
+ # The concurrency group contains the workflow name and the branch name.
16
+ group : ${{ github.workflow }}-${{ github.ref }}
17
+ cancel-in-progress : true
18
+
15
19
jobs :
16
20
build :
17
21
runs-on : ubuntu-latest
@@ -112,8 +116,21 @@ jobs:
112
116
coverage : none
113
117
tools : cs2pr
114
118
119
+ # This action also handles the caching of the dependencies.
120
+ - name : Set up node and enable caching of dependencies
121
+ uses : actions/setup-node@v3
122
+ with :
123
+ node-version : ' 20'
124
+
125
+ - name : Install external tools used in tests
126
+ run : >
127
+ npm install -g --fund false
128
+ csslint
129
+ eslint
130
+ jshint
131
+
115
132
# Install dependencies and handle caching in one go.
116
- # @link https://github.com/marketplace/actions/install-composer -dependencies
133
+ # @link https://github.com/marketplace/actions/install-php -dependencies-with-composer
117
134
- name : Install Composer dependencies - normal
118
135
if : ${{ matrix.php < '8.0' }}
119
136
uses : " ramsey/composer-install@v2"
@@ -126,7 +143,7 @@ jobs:
126
143
if : ${{ matrix.php >= '8.0' }}
127
144
uses : " ramsey/composer-install@v2"
128
145
with :
129
- composer-options : --ignore-platform-reqs
146
+ composer-options : --ignore-platform-req=php+
130
147
custom-cache-suffix : $(date -u "+%Y-%m")
131
148
132
149
# Note: The code style check is run multiple times against every PHP version
@@ -151,17 +168,13 @@ jobs:
151
168
152
169
- name : ' PHPCS: check code style to show results in PR'
153
170
if : ${{ matrix.custom_ini == false && matrix.php == '7.4' }}
154
- continue-on-error : true
171
+ id : phpcs
155
172
run : php bin/phpcs --no-cache --parallel=1 --report-full --report-checkstyle=./phpcs-report.xml
156
173
157
174
- name : Show PHPCS results in PR
158
- if : ${{ matrix.custom_ini == false && matrix.php == '7.4' }}
175
+ if : ${{ always() && steps.phpcs.outcome == 'failure' && matrix.php == '7.4' }}
159
176
run : cs2pr ./phpcs-report.xml
160
177
161
- - name : ' Composer: validate config'
162
- if : ${{ matrix.custom_ini == false }}
163
- run : composer validate --no-check-all --strict
164
-
165
178
- name : Download the PHPCS phar
166
179
uses : actions/download-artifact@v3
167
180
with :
0 commit comments