Skip to content

Commit 316d5f3

Browse files
authored
Fix CI + run on pull_request (#24)
1 parent 91658a4 commit 316d5f3

File tree

1 file changed

+16
-10
lines changed

1 file changed

+16
-10
lines changed

Diff for: .github/workflows/push.yml renamed to .github/workflows/ci.yml

+16-10
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
11
name: CI
2-
on: push
2+
on:
3+
push: {}
4+
pull_request:
5+
types: [opened, reopened, synchronize]
36
jobs:
47
run:
58
env:
@@ -33,20 +36,23 @@ jobs:
3336
- name: Composer dependencies
3437
run: composer install --no-ansi --no-interaction --no-scripts --no-suggest --no-progress --prefer-dist
3538

36-
- name: Configure tests for the current PHPUnit version (Non-Windows)
39+
- name: Set correct phpt file name
40+
id: phpt-filename
3741
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
4148

42-
- name: Configure tests for the current PHPUnit version (Windows)
43-
id: phpunit-windows
49+
- name: Configure tests for the current PHPUnit version
4450
run: |
4551
$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'
4753
$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
5056

5157
- name: Run phpunit
5258
run: ./vendor/bin/phpunit

0 commit comments

Comments
 (0)