77 paths-ignore :
88 - ' **.md'
99 pull_request :
10- paths-ignore :
11- - ' **.md'
1210 # Allow manually triggering the workflow.
1311 workflow_dispatch :
1412
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+
1519jobs :
1620 build :
1721 runs-on : ubuntu-latest
@@ -112,8 +116,21 @@ jobs:
112116 coverage : none
113117 tools : cs2pr
114118
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+
115132 # 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
117134 - name : Install Composer dependencies - normal
118135 if : ${{ matrix.php < '8.0' }}
119136 uses : " ramsey/composer-install@v2"
@@ -126,7 +143,7 @@ jobs:
126143 if : ${{ matrix.php >= '8.0' }}
127144 uses : " ramsey/composer-install@v2"
128145 with :
129- composer-options : --ignore-platform-reqs
146+ composer-options : --ignore-platform-req=php+
130147 custom-cache-suffix : $(date -u "+%Y-%m")
131148
132149 # Note: The code style check is run multiple times against every PHP version
@@ -151,17 +168,13 @@ jobs:
151168
152169 - name : ' PHPCS: check code style to show results in PR'
153170 if : ${{ matrix.custom_ini == false && matrix.php == '7.4' }}
154- continue-on-error : true
171+ id : phpcs
155172 run : php bin/phpcs --no-cache --parallel=1 --report-full --report-checkstyle=./phpcs-report.xml
156173
157174 - 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' }}
159176 run : cs2pr ./phpcs-report.xml
160177
161- - name : ' Composer: validate config'
162- if : ${{ matrix.custom_ini == false }}
163- run : composer validate --no-check-all --strict
164-
165178 - name : Download the PHPCS phar
166179 uses : actions/download-artifact@v3
167180 with :
0 commit comments