|
| 1 | +name: Runner |
| 2 | +on: [push] |
| 3 | +jobs: |
| 4 | + e2e-tests: |
| 5 | + name: E2E Tests - ${{ matrix.os }} |
| 6 | + runs-on: ${{ matrix.os }} |
| 7 | + strategy: |
| 8 | + fail-fast: false |
| 9 | + matrix: |
| 10 | + os: [ubuntu-24.04, macos-14, windows-latest] |
| 11 | + steps: |
| 12 | + # Test 1: Phar type tools with exact versions |
| 13 | + - name: Setup PHP with phar tools |
| 14 | + uses: shivammathur/setup-php@develop |
| 15 | + with: |
| 16 | + php-version: '8.3' |
| 17 | + tools: >- |
| 18 | + phpstan:1.12.0, |
| 19 | + psalm:5.26.0, |
| 20 | + php-cs-fixer:3.64.0, |
| 21 | + phpcs:3.10.3, |
| 22 | + phpmd:2.15.0, |
| 23 | + parallel-lint:1.4.0, |
| 24 | + cs2pr:1.8.2 |
| 25 | +
|
| 26 | + - name: Test PHPStan 1.12.0 |
| 27 | + run: php -r "if(strpos(shell_exec('phpstan --version 2>&1'), '1.12.0')===false) exit(1);" |
| 28 | + |
| 29 | + - name: Test Psalm 5.26.0 |
| 30 | + run: php -r "if(strpos(shell_exec('psalm --version 2>&1'), '5.26.0')===false) exit(1);" |
| 31 | + |
| 32 | + - name: Test PHP-CS-Fixer 3.64.0 |
| 33 | + run: php -r "if(strpos(shell_exec('php-cs-fixer --version 2>&1'), '3.64.0')===false) exit(1);" |
| 34 | + |
| 35 | + - name: Test PHPCS 3.10.3 |
| 36 | + run: php -r "if(strpos(shell_exec('phpcs --version 2>&1'), '3.10.3')===false) exit(1);" |
| 37 | + |
| 38 | + - name: Test PHPMD 2.15.0 |
| 39 | + run: php -r "if(strpos(shell_exec('phpmd --version 2>&1'), '2.15.0')===false) exit(1);" |
| 40 | + |
| 41 | + - name: Test Parallel-Lint 1.4.0 |
| 42 | + run: php -r "if(strpos(shell_exec('parallel-lint --version 2>&1'), '1.4.0')===false) exit(1);" |
| 43 | + |
| 44 | + - name: Test CS2PR 1.8.2 |
| 45 | + run: php -r "if(strpos(shell_exec('cs2pr -V 2>&1'), '1.8.2')===false) exit(1);" |
| 46 | + |
| 47 | + # Test 2: Composer type tools |
| 48 | + - name: Setup PHP with composer tools |
| 49 | + uses: shivammathur/setup-php@develop |
| 50 | + with: |
| 51 | + php-version: '8.3' |
| 52 | + tools: >- |
| 53 | + rector:1.2.0, |
| 54 | + behat:3.28.0, |
| 55 | + phinx:0.16.10 |
| 56 | +
|
| 57 | + - name: Test Rector 1.2.0 |
| 58 | + run: php -r "if(strpos(shell_exec('rector --version 2>&1'), '1.2.0')===false) exit(1);" |
| 59 | + |
| 60 | + - name: Test Behat 3.28.0 |
| 61 | + run: php -r "if(strpos(shell_exec('behat --version 2>&1'), '3.28.0')===false) exit(1);" |
| 62 | + |
| 63 | + - name: Test Phinx 0.16.10 |
| 64 | + run: php -r "if(strpos(shell_exec('phinx --version 2>&1'), '0.16.10')===false) exit(1);" |
| 65 | + |
| 66 | + # Test 3: Custom-function tools |
| 67 | + - name: Setup PHP with custom-function tools |
| 68 | + uses: shivammathur/setup-php@develop |
| 69 | + with: |
| 70 | + php-version: '8.3' |
| 71 | + tools: >- |
| 72 | + composer:2.7.9, |
| 73 | + phpunit:11.3.0, |
| 74 | + deployer:7.4.1, |
| 75 | + phive:0.15.3 |
| 76 | +
|
| 77 | + - name: Test Composer 2.7.9 |
| 78 | + run: php -r "if(strpos(shell_exec('composer --version 2>&1'), '2.7.9')===false) exit(1);" |
| 79 | + |
| 80 | + - name: Test PHPUnit 11.3.0 |
| 81 | + run: php -r "if(strpos(shell_exec('phpunit --version 2>&1'), '11.3.0')===false) exit(1);" |
| 82 | + |
| 83 | + - name: Test Deployer 7.4.1 |
| 84 | + run: php -r "if(strpos(shell_exec('deployer --version 2>&1'), '7.4.1')===false) exit(1);" |
| 85 | + |
| 86 | + - name: Test Phive 0.15.3 |
| 87 | + run: php -r "if(strpos(shell_exec('phive --version 2>&1'), '0.15.3')===false) exit(1);" |
| 88 | + |
| 89 | + # Test 4: WP-CLI (Unix only) |
| 90 | + - name: Setup PHP with WP-CLI |
| 91 | + if: runner.os != 'Windows' |
| 92 | + uses: shivammathur/setup-php@develop |
| 93 | + with: |
| 94 | + php-version: '8.3' |
| 95 | + tools: wp-cli:2.11.0 |
| 96 | + |
| 97 | + - name: Test WP-CLI 2.11.0 |
| 98 | + if: runner.os != 'Windows' |
| 99 | + run: php -r "if(strpos(shell_exec('wp --version 2>&1'), '2.11.0')===false) exit(1);" |
| 100 | + |
| 101 | + # Test 5: Latest version resolution |
| 102 | + - name: Setup PHP with latest tool versions |
| 103 | + uses: shivammathur/setup-php@develop |
| 104 | + with: |
| 105 | + php-version: '8.3' |
| 106 | + tools: >- |
| 107 | + composer, |
| 108 | + phpunit, |
| 109 | + phpstan, |
| 110 | + php-cs-fixer |
| 111 | +
|
| 112 | + - name: Test tools installed (latest) |
| 113 | + run: | |
| 114 | + composer --version |
| 115 | + phpunit --version |
| 116 | + phpstan --version |
| 117 | + php-cs-fixer --version |
| 118 | +
|
| 119 | + # Test 6: Semver resolution (major.minor) |
| 120 | + - name: Setup PHP with major.minor versions |
| 121 | + uses: shivammathur/setup-php@develop |
| 122 | + with: |
| 123 | + php-version: '8.3' |
| 124 | + tools: >- |
| 125 | + phpstan:1.12, |
| 126 | + phpunit:11.3, |
| 127 | + psalm:5.26 |
| 128 | +
|
| 129 | + - name: Test PHPStan resolves 1.12.x |
| 130 | + run: php -r "if(strpos(shell_exec('phpstan --version 2>&1'), '1.12.')===false) exit(1);" |
| 131 | + |
| 132 | + - name: Test PHPUnit resolves 11.3.x |
| 133 | + run: php -r "if(strpos(shell_exec('phpunit --version 2>&1'), '11.3.')===false) exit(1);" |
| 134 | + |
| 135 | + - name: Test Psalm resolves 5.26.x |
| 136 | + run: php -r "if(strpos(shell_exec('psalm --version 2>&1'), '5.26.')===false) exit(1);" |
| 137 | + |
| 138 | + # Test 7: Composer channels |
| 139 | + - name: Setup PHP with composer stable |
| 140 | + uses: shivammathur/setup-php@develop |
| 141 | + with: |
| 142 | + php-version: '8.3' |
| 143 | + tools: composer:stable |
| 144 | + |
| 145 | + - name: Test Composer stable channel |
| 146 | + run: composer --version |
| 147 | + |
| 148 | + - name: Setup PHP with composer 2 |
| 149 | + uses: shivammathur/setup-php@develop |
| 150 | + with: |
| 151 | + php-version: '8.3' |
| 152 | + tools: composer:2 |
| 153 | + |
| 154 | + - name: Test Composer 2 channel |
| 155 | + run: php -r "if(strpos(shell_exec('composer --version 2>&1'), 'Composer version 2')===false) exit(1);" |
| 156 | + |
| 157 | + # Test 8: Tool aliases |
| 158 | + - name: Setup PHP with tool aliases |
| 159 | + uses: shivammathur/setup-php@develop |
| 160 | + with: |
| 161 | + php-version: '8.3' |
| 162 | + tools: >- |
| 163 | + phpdoc:3.5.0, |
| 164 | + ecs:12.3.0 |
| 165 | +
|
| 166 | + - name: Test phpDocumentor 3.5.0 (alias - phpdoc) |
| 167 | + run: php -r "if(strpos(shell_exec('phpdoc --version 2>&1'), '3.5.0')===false) exit(1);" |
| 168 | + |
| 169 | + - name: Test Easy Coding Standard 12.3.0 (alias - ecs) |
| 170 | + run: php -r "if(strpos(shell_exec('ecs --version 2>&1'), '12.3.0')===false) exit(1);" |
| 171 | + |
| 172 | + # Test 9: User/repo format for composer tools |
| 173 | + - name: Setup PHP with user/repo tools |
| 174 | + uses: shivammathur/setup-php@develop |
| 175 | + with: |
| 176 | + php-version: '8.3' |
| 177 | + tools: laravel/pint:1.18.0 |
| 178 | + |
| 179 | + - name: Test Pint 1.18.0 (user/repo format) |
| 180 | + run: php -r "if(strpos(shell_exec('pint --version 2>&1'), '1.18.0')===false) exit(1);" |
| 181 | + |
| 182 | + # Test 10: Dev tools (Unix only) |
| 183 | + - name: Setup PHP with dev tools |
| 184 | + if: runner.os != 'Windows' |
| 185 | + uses: shivammathur/setup-php@develop |
| 186 | + with: |
| 187 | + php-version: '8.3' |
| 188 | + tools: php-config, phpize |
| 189 | + |
| 190 | + - name: Test php-config |
| 191 | + if: runner.os != 'Windows' |
| 192 | + run: php-config --version |
| 193 | + |
| 194 | + - name: Test phpize |
| 195 | + if: runner.os != 'Windows' |
| 196 | + run: phpize --version |
| 197 | + |
| 198 | + # Test 11: PECL (Unix only) |
| 199 | + - name: Setup PHP with PECL |
| 200 | + if: runner.os != 'Windows' |
| 201 | + uses: shivammathur/setup-php@develop |
| 202 | + with: |
| 203 | + php-version: '8.3' |
| 204 | + tools: pecl |
| 205 | + |
| 206 | + - name: Test PECL |
| 207 | + if: runner.os != 'Windows' |
| 208 | + run: pecl version |
| 209 | + |
| 210 | + # Test 12: Partial version resolution (major and major.minor) |
| 211 | + - name: Setup PHP with partial version tools |
| 212 | + uses: shivammathur/setup-php@develop |
| 213 | + with: |
| 214 | + php-version: '8.3' |
| 215 | + tools: >- |
| 216 | + phpunit:10, |
| 217 | + phpstan:2.1, |
| 218 | + psalm:6, |
| 219 | + deployer:7.5, |
| 220 | + phpcs:3.13 |
| 221 | +
|
| 222 | + - name: Test PHPUnit 10.5.x (major version) |
| 223 | + run: php -r "if(strpos(shell_exec('phpunit --version 2>&1'), '10.5.')===false) exit(1);" |
| 224 | + |
| 225 | + - name: Test PHPStan 2.1.x (major.minor version) |
| 226 | + run: php -r "if(strpos(shell_exec('phpstan --version 2>&1'), '2.1.')===false) exit(1);" |
| 227 | + |
| 228 | + - name: Test Psalm 6.x (major version) |
| 229 | + run: php -r "if(strpos(shell_exec('psalm --version 2>&1'), 'Psalm 6.')===false) exit(1);" |
| 230 | + |
| 231 | + - name: Test Deployer 7.5.x (major.minor version) |
| 232 | + run: php -r "if(strpos(shell_exec('deployer --version 2>&1'), '7.5.')===false) exit(1);" |
| 233 | + |
| 234 | + - name: Test PHPCS 3.13.x (major.minor version) |
| 235 | + run: php -r "if(strpos(shell_exec('phpcs --version 2>&1'), '3.13.')===false) exit(1);" |
| 236 | + |
| 237 | + # Test 13: Castor (custom-function) |
| 238 | + - name: Setup PHP with Castor |
| 239 | + uses: shivammathur/setup-php@develop |
| 240 | + with: |
| 241 | + php-version: '8.3' |
| 242 | + tools: castor:0.18.0 |
| 243 | + |
| 244 | + - name: Test Castor 0.18.0 |
| 245 | + run: php -r "if(strpos(shell_exec('castor --version 2>&1'), '0.18.0')===false) exit(1);" |
| 246 | + |
| 247 | + # Test 14: Phing (custom-function) |
| 248 | + - name: Setup PHP with Phing |
| 249 | + uses: shivammathur/setup-php@develop |
| 250 | + with: |
| 251 | + php-version: '8.3' |
| 252 | + tools: phing:3.0.1 |
| 253 | + |
| 254 | + - name: Test Phing 3.0.1 |
| 255 | + run: php -r "if(strpos(shell_exec('phing -v 2>&1'), '3.0.1')===false) exit(1);" |
| 256 | + |
| 257 | + # Test 15: PHPCPD (custom-function using phpunit handler) |
| 258 | + - name: Setup PHP with PHPCPD |
| 259 | + uses: shivammathur/setup-php@develop |
| 260 | + with: |
| 261 | + php-version: '8.3' |
| 262 | + tools: phpcpd:6.0.3 |
| 263 | + |
| 264 | + - name: Test PHPCPD 6.0.3 |
| 265 | + run: php -r "if(strpos(shell_exec('phpcpd --version 2>&1'), '6.0.3')===false) exit(1);" |
| 266 | + |
| 267 | + # Test 16: fetch_latest tools |
| 268 | + - name: Setup PHP with fetch_latest tool |
| 269 | + uses: shivammathur/setup-php@develop |
| 270 | + with: |
| 271 | + php-version: '8.3' |
| 272 | + tools: php-cs-fixer:3.64 |
| 273 | + |
| 274 | + - name: Test PHP-CS-Fixer 3.64.x (fetch_latest) |
| 275 | + run: php -r "if(strpos(shell_exec('php-cs-fixer --version 2>&1'), '3.64.')===false) exit(1);" |
| 276 | + |
| 277 | + # Test 17: Multiple tools in single input |
| 278 | + - name: Setup PHP with multiple tools |
| 279 | + uses: shivammathur/setup-php@develop |
| 280 | + with: |
| 281 | + php-version: '8.3' |
| 282 | + tools: composer:2.7.9, phpunit:11.3.0, phpstan:1.12.0, php-cs-fixer:3.64.0, psalm:5.26.0 |
| 283 | + |
| 284 | + - name: Verify all tools installed with exact versions |
| 285 | + run: | |
| 286 | + php -r "if(strpos(shell_exec('composer --version 2>&1'), '2.7.9')===false) exit(1);" |
| 287 | + php -r "if(strpos(shell_exec('phpunit --version 2>&1'), '11.3.0')===false) exit(1);" |
| 288 | + php -r "if(strpos(shell_exec('phpstan --version 2>&1'), '1.12.0')===false) exit(1);" |
| 289 | + php -r "if(strpos(shell_exec('php-cs-fixer --version 2>&1'), '3.64.0')===false) exit(1);" |
| 290 | + php -r "if(strpos(shell_exec('psalm --version 2>&1'), '5.26.0')===false) exit(1);" |
| 291 | +
|
| 292 | + # Test 18: Box tool (phar type) |
| 293 | + - name: Setup PHP with Box |
| 294 | + uses: shivammathur/setup-php@develop |
| 295 | + with: |
| 296 | + php-version: '8.3' |
| 297 | + tools: box:4.6.2 |
| 298 | + |
| 299 | + - name: Test Box 4.6.2 |
| 300 | + run: php -r "if(strpos(shell_exec('box --version 2>&1'), '4.6.2')===false) exit(1);" |
| 301 | + |
| 302 | + # Test 19: Infection tool (phar type) |
| 303 | + - name: Setup PHP with Infection |
| 304 | + uses: shivammathur/setup-php@develop |
| 305 | + with: |
| 306 | + php-version: '8.3' |
| 307 | + tools: infection:0.29.6 |
| 308 | + |
| 309 | + - name: Test Infection 0.29.6 |
| 310 | + run: php -r "if(strpos(shell_exec('infection --version 2>&1'), '0.29.6')===false) exit(1);" |
0 commit comments