mirror of
https://github.com/danog/psalm-plugin-laravel.git
synced 2024-11-30 04:39:01 +01:00
chore: test laravel
This commit is contained in:
parent
35459bb545
commit
df1c4f7b9c
21
.github/workflows/test-laravel.yml
vendored
Normal file
21
.github/workflows/test-laravel.yml
vendored
Normal file
@ -0,0 +1,21 @@
|
|||||||
|
name: Run Tests
|
||||||
|
|
||||||
|
on:
|
||||||
|
push:
|
||||||
|
pull_request:
|
||||||
|
schedule:
|
||||||
|
- cron: '0 0 * * *'
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
build:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
|
||||||
|
name: Test Laravel
|
||||||
|
|
||||||
|
steps:
|
||||||
|
- name: Checkout code
|
||||||
|
uses: actions/checkout@v2
|
||||||
|
|
||||||
|
- name: Test
|
||||||
|
run: |
|
||||||
|
./tests/laravel-test.sh
|
13
tests/laravel-test-baseline.xml
Normal file
13
tests/laravel-test-baseline.xml
Normal file
@ -0,0 +1,13 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<files psalm-version="dev-master@02e8313c398b9c6cb6ded9210e5ef53ecd7a2dab">
|
||||||
|
<file src="app/Console/Kernel.php">
|
||||||
|
<UnresolvableInclude occurrences="1">
|
||||||
|
<code>require base_path('routes/console.php')</code>
|
||||||
|
</UnresolvableInclude>
|
||||||
|
</file>
|
||||||
|
<file src="app/Providers/BroadcastServiceProvider.php">
|
||||||
|
<UnresolvableInclude occurrences="1">
|
||||||
|
<code>require base_path('routes/channels.php')</code>
|
||||||
|
</UnresolvableInclude>
|
||||||
|
</file>
|
||||||
|
</files>
|
18
tests/laravel-test-psalm.xml
Normal file
18
tests/laravel-test-psalm.xml
Normal 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/laravel-test-baseline.xml"
|
||||||
|
>
|
||||||
|
<projectFiles>
|
||||||
|
<directory name="app"/>
|
||||||
|
<ignoreFiles>
|
||||||
|
<directory name="vendor"/>
|
||||||
|
</ignoreFiles>
|
||||||
|
</projectFiles>
|
||||||
|
<plugins>
|
||||||
|
<pluginClass class="Psalm\LaravelPlugin\Plugin"/>
|
||||||
|
</plugins>
|
||||||
|
</psalm>
|
17
tests/laravel-test.sh
Executable file
17
tests/laravel-test.sh
Executable file
@ -0,0 +1,17 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
|
||||||
|
set -e
|
||||||
|
|
||||||
|
echo "Cleaning Up"
|
||||||
|
rm -rf ../laravel/
|
||||||
|
|
||||||
|
echo "Installing Laravel"
|
||||||
|
composer create-project --quiet --prefer-dist "laravel/laravel" ../laravel
|
||||||
|
cd ../laravel/
|
||||||
|
|
||||||
|
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 Laravel"
|
||||||
|
./vendor/bin/psalm -c ../psalm-plugin-laravel/tests/laravel-test-psalm.xml
|
Loading…
Reference in New Issue
Block a user