Merge pull request #88 from psalm/test-lumen

chore: test lumen project
This commit is contained in:
feek 2020-06-21 21:39:04 -07:00 committed by GitHub
commit 797789d23b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 72 additions and 2 deletions

View File

@ -1,4 +1,4 @@
name: Run Tests
name: Test laravel projects
on:
push:
@ -16,6 +16,10 @@ jobs:
- name: Checkout code
uses: actions/checkout@v2
- name: Test
- name: Test Laravel
run: |
./tests/laravel-test.sh
- name: Test Lumen
run: |
./tests/lumen-test.sh

View File

@ -0,0 +1,31 @@
<?xml version="1.0" encoding="UTF-8"?>
<files psalm-version="dev-master@02e8313c398b9c6cb6ded9210e5ef53ecd7a2dab">
<file src="app/Console/Kernel.php">
<PropertyNotSetInConstructor occurrences="1">
<code>Kernel</code>
</PropertyNotSetInConstructor>
</file>
<file src="app/Exceptions/Handler.php">
<LessSpecificReturnStatement occurrences="1">
<code>parent::render($request, $exception)</code>
</LessSpecificReturnStatement>
<MoreSpecificReturnType occurrences="1">
<code>\Illuminate\Http\Response|\Illuminate\Http\JsonResponse</code>
</MoreSpecificReturnType>
</file>
<file src="app/Jobs/ExampleJob.php">
<PropertyNotSetInConstructor occurrences="1">
<code>ExampleJob</code>
</PropertyNotSetInConstructor>
</file>
<file src="app/Providers/AuthServiceProvider.php">
<MissingClosureParamType occurrences="1">
<code>$request</code>
</MissingClosureParamType>
<MixedMethodCall occurrences="3">
<code>viaRequest</code>
<code>input</code>
<code>input</code>
</MixedMethodCall>
</file>
</files>

View File

@ -0,0 +1,18 @@
<psalm
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns="https://getpsalm.org/schema/config"
errorLevel="1"
resolveFromConfigFile="false"
xsi:schemaLocation="https://getpsalm.org/schema/config vendor/vimeo/psalm/config.xsd"
errorBaseline="../psalm-plugin-laravel/tests/lumen-test-baseline.xml"
>
<projectFiles>
<directory name="app"/>
<ignoreFiles>
<directory name="vendor"/>
</ignoreFiles>
</projectFiles>
<plugins>
<pluginClass class="Psalm\LaravelPlugin\Plugin"/>
</plugins>
</psalm>

17
tests/lumen-test.sh Executable file
View File

@ -0,0 +1,17 @@
#!/bin/bash
set -e
echo "Cleaning Up"
rm -rf ../lumen/
echo "Installing Lumen"
composer create-project --quiet --prefer-dist "laravel/lumen" ../lumen
cd ../lumen/
echo "Adding package from source"
sed -e 's|"type": "project",|&"repositories": [ { "type": "path", "url": "../psalm-plugin-laravel" } ],|' -i composer.json
COMPOSER_MEMORY_LIMIT=-1 composer require --dev "psalm/plugin-laravel:*"
echo "Analyzing Lumen"
./vendor/bin/psalm -c ../psalm-plugin-laravel/tests/lumen-test-psalm.xml