11name : CI
22
3- on : [push, pull_request]
3+ on :
4+ push :
5+ pull_request :
46
57jobs :
68 composer :
79 runs-on : ubuntu-latest
810 strategy :
911 matrix :
10- php : [ 8.0 , 8.1 , 8.2 , 8.3, 8.4 ]
12+ php : [ 8.2 , 8.3 , 8.4 , 8.5 ]
1113
1214 steps :
13- - uses : actions/checkout@v4
15+ - uses : actions/checkout@v6
1416
1517 - name : Cache Composer dependencies
16- uses : actions/cache@v4
18+ uses : actions/cache@v5
1719 with :
1820 path : /tmp/composer-cache
1921 key : ${{ runner.os }}-${{ matrix.php }}-${{ hashFiles('**/composer.lock') }}
2022
21- - name : Composer
23+ - name : Composer install
2224 uses : php-actions/composer@v6
2325 with :
2426 php_version : ${{ matrix.php }}
27+ php_extensions : pcntl
2528
2629 - name : Archive build
2730 run : mkdir /tmp/github-actions/ && tar --exclude=".git" -cvf /tmp/github-actions/build.tar ./
@@ -34,10 +37,10 @@ jobs:
3437
3538 phpunit :
3639 runs-on : ubuntu-latest
37- needs : [composer]
40+ needs : [ composer ]
3841 strategy :
3942 matrix :
40- php : [ 8.0 , 8.1 , 8.2 , 8.3, 8.4 ]
43+ php : [ 8.2 , 8.3 , 8.4 , 8.5 ]
4144
4245 outputs :
4346 coverage : ${{ steps.store-coverage.outputs.coverage_text }}
@@ -52,14 +55,12 @@ jobs:
5255 run : tar -xvf /tmp/github-actions/build.tar ./
5356
5457 - name : PHP Unit tests
55- uses : php-actions/phpunit@v3
58+ uses : php-actions/phpunit@v4
5659 env :
57- XDEBUG_MODE : coverage
60+ XDEBUG_MODE : cover
5861 with :
59- version : 9
6062 php_version : ${{ matrix.php }}
6163 php_extensions : xdebug
62- configuration : phpunit.xml
6364 coverage_text : _coverage/coverage.txt
6465 coverage_clover : _coverage/clover.xml
6566
7475 needs : [ phpunit ]
7576 strategy :
7677 matrix :
77- php : [ 8.0 , 8.1 , 8.2 , 8.3, 8.4 ]
78+ php : [ 8.2 , 8.3 , 8.4 , 8.5 ]
7879
7980 steps :
81+ - uses : actions/checkout@v4
82+
8083 - uses : actions/download-artifact@v4
8184 with :
8285 name : code-coverage-${{ matrix.php }}-${{ github.run_number }}
@@ -89,14 +92,13 @@ jobs:
8992 uses : codecov/codecov-action@v5
9093 with :
9194 token : ${{ secrets.CODECOV_TOKEN }}
92- slug : PhpGt/CssXPath
9395
9496 phpstan :
9597 runs-on : ubuntu-latest
96- needs : [composer]
98+ needs : [ composer ]
9799 strategy :
98100 matrix :
99- php : [ 8.0 , 8.1 , 8.2 , 8.3, 8.4 ]
101+ php : [ 8.2 , 8.3 , 8.4 , 8.5 ]
100102
101103 steps :
102104 - uses : actions/download-artifact@v4
@@ -110,8 +112,57 @@ jobs:
110112 - name : PHP Static Analysis
111113 uses : php-actions/phpstan@v3
112114 with :
115+ php_version : ${{ matrix.php }}
113116 path : src/
117+ level : 6
118+ memory_limit : 256M
119+
120+ phpmd :
121+ runs-on : ubuntu-latest
122+ needs : [ composer ]
123+ strategy :
124+ matrix :
125+ php : [ 8.2, 8.3, 8.4, 8.5 ]
126+
127+ steps :
128+ - uses : actions/download-artifact@v4
129+ with :
130+ name : build-artifact-${{ matrix.php }}
131+ path : /tmp/github-actions
132+
133+ - name : Extract build archive
134+ run : tar -xvf /tmp/github-actions/build.tar ./
135+
136+ - name : PHP Mess Detector
137+ uses : php-actions/phpmd@v1
138+ with :
114139 php_version : ${{ matrix.php }}
140+ path : src/
141+ output : text
142+ ruleset : phpmd.xml
143+
144+ phpcs :
145+ runs-on : ubuntu-latest
146+ needs : [ composer ]
147+ strategy :
148+ matrix :
149+ php : [ 8.2, 8.3, 8.4, 8.5 ]
150+
151+ steps :
152+ - uses : actions/download-artifact@v4
153+ with :
154+ name : build-artifact-${{ matrix.php }}
155+ path : /tmp/github-actions
156+
157+ - name : Extract build archive
158+ run : tar -xvf /tmp/github-actions/build.tar ./
159+
160+ - name : PHP Code Sniffer
161+ uses : php-actions/phpcs@v1
162+ with :
163+ php_version : ${{ matrix.php }}
164+ path : src/
165+ standard : phpcs.xml
115166
116167 remove_old_artifacts :
117168 runs-on : ubuntu-latest
0 commit comments