diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 24a750b..5692dd0 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -91,8 +91,8 @@ jobs: path: ./parallel-lint.phar test: - name: Run tests on PHP ${{ matrix.php }} - runs-on: ubuntu-latest + name: Run tests on PHP ${{ matrix.php }} (${{ matrix.os }}) + runs-on: "${{ matrix.os }}" continue-on-error: ${{ matrix.php == '8.4' }} needs: - bundle @@ -114,6 +114,19 @@ jobs: - '8.2' - '8.3' - '8.4' + os: + - 'ubuntu-latest' + + include: + # Also run the tests against Windows on a few PHP versions. + - php: '5.5' + os: 'windows-latest' + - php: '7.0' + os: 'windows-latest' + - php: '8.0' + os: 'windows-latest' + - php: '8.3' + os: 'windows-latest' steps: - name: Checkout code @@ -154,13 +167,14 @@ jobs: - name: Grab PHPUnit version id: phpunit_version - run: echo "VERSION=$(vendor/bin/phpunit --version | grep --only-matching --max-count=1 --extended-regexp '\b[0-9]+\.[0-9]+')" >> $GITHUB_OUTPUT + shell: bash + run: echo "VERSION=$(php vendor/bin/phpunit --version | grep --only-matching --max-count=1 --extended-regexp '[0-9]+\.[0-9]+')" >> $GITHUB_OUTPUT - name: "Run unit tests (PHPUnit < 10)" if: ${{ ! startsWith( steps.phpunit_version.outputs.VERSION, '10.' ) }} run: composer test - - name: "Run unit tests (PHPUnit < 10)" + - name: "Run unit tests (PHPUnit >= 10)" if: ${{ startsWith( steps.phpunit_version.outputs.VERSION, '10.' ) }} run: composer test10 diff --git a/src/Process/SkipLintProcess.php b/src/Process/SkipLintProcess.php index 527d61b..53f36d8 100644 --- a/src/Process/SkipLintProcess.php +++ b/src/Process/SkipLintProcess.php @@ -22,16 +22,10 @@ class SkipLintProcess extends PhpProcess */ public function __construct(PhpExecutable $phpExecutable, array $filesToCheck) { - $scriptPath = __DIR__ . '/../../bin/skip-linting.php'; - $script = file_get_contents($scriptPath); + $scriptPath = dirname(dirname(__DIR__)) . '/bin/skip-linting.php'; + $code = sprintf("include('%s');", $scriptPath); - if (!$script) { - throw new RuntimeException("skip-linting.php script not found in '$scriptPath'."); - } - - $script = str_replace('