Skip to content

Commit

Permalink
Add PHPStan to tests workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
bobbyiliev committed May 19, 2024
1 parent 68cb5ac commit a889fa4
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 12 deletions.
16 changes: 11 additions & 5 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -42,11 +42,11 @@ jobs:
- name: Install DevDojo Auth from current branch
run: composer require devdojo/auth:dev-${{ env.branch }} --with-all-dependencies
working-directory: ./laravel_app

- name: Publish the DevDojo Auth Assets
run: php artisan vendor:publish --tag=auth:assets
working-directory: ./laravel_app

- name: Publish the DevDojo Configs
run: php artisan vendor:publish --tag=auth:config
working-directory: ./laravel_app
Expand Down Expand Up @@ -81,17 +81,17 @@ jobs:
- name: Run the migrations
run: php artisan migrate
working-directory: ./laravel_app

- name: Run the Auth Migrations
run: php artisan migrate --path=vendor/devdojo/auth/database/migrations
run: php artisan migrate --path=vendor/devdojo/auth/database/migrations
working-directory: ./laravel_app

# Testing on a mac, this command should be:
# sed -i '' '/"phpunit\/phpunit"/d' composer.json
- name: Remove PHPUnit from composer.json
run: sed -i '/"phpunit\/phpunit"/d' composer.json
working-directory: ./laravel_app


- name: Remove composer.lock and re-run composer install
run: |
Expand All @@ -103,10 +103,16 @@ jobs:
run: composer require pestphp/pest --dev --with-all-dependencies
working-directory: ./laravel_app

- name: Install PHPStan
run: composer require phpstan/phpstan --dev --with-all-dependencies

- name: Clear all view caches
run: php artisan view:clear
working-directory: ./laravel_app

- name: Run Tests
run: ./vendor/bin/pest
working-directory: ./laravel_app

- name: Run PHPStan for DevDojo Auth
run: ./vendor/bin/phpstan analyse --memory-limit=1G vendor/devdojo/auth/src
3 changes: 2 additions & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,8 @@
"laravel/pint": "^1.15",
"orchestra/testbench": "^9.0",
"pestphp/pest": "^2.34",
"pestphp/pest-plugin-laravel": "^2.4"
"pestphp/pest-plugin-laravel": "^2.4",
"phpstan/phpstan": "^1.11"
},
"autoload": {
"psr-4": {
Expand Down
12 changes: 6 additions & 6 deletions composer.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit a889fa4

Please sign in to comment.