diff --git a/.github/workflows/full-checks.yml b/.github/workflows/full-checks.yml index ee0552c..5183251 100644 --- a/.github/workflows/full-checks.yml +++ b/.github/workflows/full-checks.yml @@ -61,3 +61,8 @@ jobs: - name: "Full CI" run: "composer ci" + + - name: "Check dependencies" + run: | + cd dependency-tests + ./check-phpstan-dependencies.sh diff --git a/dependency-tests/.gitignore b/dependency-tests/.gitignore new file mode 100644 index 0000000..5733c2a --- /dev/null +++ b/dependency-tests/.gitignore @@ -0,0 +1,3 @@ +* +!.gitignore +!check-phpstan-dependencies.sh \ No newline at end of file diff --git a/dependency-tests/check-phpstan-dependencies.sh b/dependency-tests/check-phpstan-dependencies.sh new file mode 100755 index 0000000..135cfea --- /dev/null +++ b/dependency-tests/check-phpstan-dependencies.sh @@ -0,0 +1,27 @@ +#!/bin/bash + +set -e + +# Remove any existing composer files from previous run of the script +rm -f composer.* || true + +# Create composer.json +cat <<- "EOF" > composer.json +{ + "name": "demo/test_dependencies", + "repositories" : [ + { + "type" : "path", + "url" : "../" + } + ] +} +EOF + +# Check PHPStan v1 is OK +composer require --dev phpstan/phpstan:^1.0 +composer require --dev dave-liddament/phpstan-php-language-extensions @dev +composer update --prefer-lowest --no-interaction + +# Check PHPStan v2 is OK +composer require --dev phpstan/phpstan:^2.0