|
1 | 1 | name: CI
|
2 |
| -on: push |
| 2 | +on: |
| 3 | + push: {} |
| 4 | + pull_request: |
| 5 | + types: [opened, reopened, synchronize] |
3 | 6 | jobs:
|
4 | 7 | run:
|
5 | 8 | env:
|
@@ -33,20 +36,23 @@ jobs:
|
33 | 36 | - name: Composer dependencies
|
34 | 37 | run: composer install --no-ansi --no-interaction --no-scripts --no-suggest --no-progress --prefer-dist
|
35 | 38 |
|
36 |
| - - name: Configure tests for the current PHPUnit version (Non-Windows) |
| 39 | + - name: Set correct phpt file name |
| 40 | + id: phpt-filename |
37 | 41 | run: |
|
38 |
| - V=$(./vendor/bin/phpunit --version) |
39 |
| - sed -i.bak "s/%%VERSION%%/$V/" test/states-test.phpt |
40 |
| - if: "!startsWith(matrix.os, 'windows')" |
| 42 | + If (${{matrix.phpunit-version}} -eq 6) { |
| 43 | + '##[set-output name=version;]-phpunit6' |
| 44 | + } Else { |
| 45 | + '##[set-output name=version;]' |
| 46 | + } |
| 47 | + shell: pwsh |
41 | 48 |
|
42 |
| - - name: Configure tests for the current PHPUnit version (Windows) |
43 |
| - id: phpunit-windows |
| 49 | + - name: Configure tests for the current PHPUnit version |
44 | 50 | run: |
|
45 | 51 | $V = (.\vendor\bin\phpunit --version | Out-String).trim()
|
46 |
| - $content = Get-Content -Path 'test/states-test.phpt' |
| 52 | + $content = Get-Content -Path 'test/states-test${{ steps.phpt-filename.outputs.version}}.phpt' |
47 | 53 | $newContent = $content -replace '%%VERSION%%', $V
|
48 |
| - $newContent | Set-Content -Path 'test/states-test.phpt' |
49 |
| - if: "startsWith(matrix.os, 'windows')" |
| 54 | + $newContent | Set-Content -Path 'test/states-test${{ steps.phpt-filename.outputs.version}}.phpt' |
| 55 | + shell: pwsh |
50 | 56 |
|
51 | 57 | - name: Run phpunit
|
52 | 58 | run: ./vendor/bin/phpunit
|
|
0 commit comments