Skip to content

Commit

Permalink
Merge pull request #37 from DaveLiddament/tests/dependency-tests
Browse files Browse the repository at this point in the history
ADD dependency-checks tests
  • Loading branch information
DaveLiddament authored Jan 15, 2025
2 parents e803de3 + ae9d988 commit c568298
Show file tree
Hide file tree
Showing 3 changed files with 35 additions and 0 deletions.
5 changes: 5 additions & 0 deletions .github/workflows/full-checks.yml
Original file line number Diff line number Diff line change
Expand Up @@ -61,3 +61,8 @@ jobs:

- name: "Full CI"
run: "composer ci"

- name: "Check dependencies"
run: |
cd dependency-tests
./check-phpstan-dependencies.sh
3 changes: 3 additions & 0 deletions dependency-tests/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
*
!.gitignore
!check-phpstan-dependencies.sh
27 changes: 27 additions & 0 deletions dependency-tests/check-phpstan-dependencies.sh
Original file line number Diff line number Diff line change
@@ -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

0 comments on commit c568298

Please sign in to comment.