From 748c26741f95e72e24b401f104683f92b1779a3d Mon Sep 17 00:00:00 2001 From: Michael Heap Date: Fri, 20 Nov 2020 20:28:59 +0000 Subject: [PATCH 1/2] Always use Powershell for setting the test to run --- .github/workflows/push.yml | 21 ++++++++++++--------- 1 file changed, 12 insertions(+), 9 deletions(-) diff --git a/.github/workflows/push.yml b/.github/workflows/push.yml index c0adb06..f9f13da 100644 --- a/.github/workflows/push.yml +++ b/.github/workflows/push.yml @@ -33,20 +33,23 @@ jobs: - name: Composer dependencies run: composer install --no-ansi --no-interaction --no-scripts --no-suggest --no-progress --prefer-dist - - name: Configure tests for the current PHPUnit version (Non-Windows) + - name: Set correct phpt file name + id: phpt-filename run: | - V=$(./vendor/bin/phpunit --version) - sed -i.bak "s/%%VERSION%%/$V/" test/states-test.phpt - if: "!startsWith(matrix.os, 'windows')" + If (${{matrix.phpunit-version}} -eq 6) { + '##[set-output name=version;]-phpunit6' + } Else { + '##[set-output name=version;]' + } + shell: pwsh - - name: Configure tests for the current PHPUnit version (Windows) - id: phpunit-windows + - name: Configure tests for the current PHPUnit version run: | $V = (.\vendor\bin\phpunit --version | Out-String).trim() - $content = Get-Content -Path 'test/states-test.phpt' + $content = Get-Content -Path 'test/states-test${{ steps.phpt-filename.outputs.version}}.phpt' $newContent = $content -replace '%%VERSION%%', $V - $newContent | Set-Content -Path 'test/states-test.phpt' - if: "startsWith(matrix.os, 'windows')" + $newContent | Set-Content -Path 'test/states-test${{ steps.phpt-filename.outputs.version}}.phpt' + shell: pwsh - name: Run phpunit run: ./vendor/bin/phpunit From 1cc7e0cdd1c600865f4a6a6d3af729ace040acf8 Mon Sep 17 00:00:00 2001 From: Michael Heap Date: Fri, 20 Nov 2020 20:37:41 +0000 Subject: [PATCH 2/2] Run CI on PR too --- .github/workflows/{push.yml => ci.yml} | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) rename .github/workflows/{push.yml => ci.yml} (96%) diff --git a/.github/workflows/push.yml b/.github/workflows/ci.yml similarity index 96% rename from .github/workflows/push.yml rename to .github/workflows/ci.yml index f9f13da..ac907a6 100644 --- a/.github/workflows/push.yml +++ b/.github/workflows/ci.yml @@ -1,5 +1,8 @@ name: CI -on: push +on: + push: {} + pull_request: + types: [opened, reopened, synchronize] jobs: run: env: