Help with github actions

I copied the workflow file from filament:
name: phpstan

on:
push:
pull_request:

jobs:
phpstan:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
php: [8.2, 8.1]
laravel: [10.*]
dependency-version: [prefer-stable]
include:
- laravel: 10.*
testbench: 8.*
exclude:
- laravel: 11.*
php: 8.1
name: P${{ matrix.php }} - L${{ matrix.laravel }} - ${{ matrix.dependency-version }}
steps:
- uses: actions/checkout@v3
- name: Cache dependencies
uses: actions/cache@v3
with:
path: ~/.composer/cache/files
key: dependencies-laravel-${{ matrix.laravel }}-php-${{ matrix.php }}-composer-${{ hashFiles('composer.json') }}
- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php }}
extensions: mbstring, pdo, pdo_sqlite
coverage: none
- name: Install dependencies
run: |
composer require "laravel/framework:${{ matrix.laravel }}" "orchestra/testbench:${{ matrix.testbench }}" "filament/support" --no-interaction --no-update
composer update --${{ matrix.dependency-version }} --prefer-dist --no-interaction
- name: Run PHPStan
run: ./vendor/bin/phpstan
name: phpstan

on:
push:
pull_request:

jobs:
phpstan:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
php: [8.2, 8.1]
laravel: [10.*]
dependency-version: [prefer-stable]
include:
- laravel: 10.*
testbench: 8.*
exclude:
- laravel: 11.*
php: 8.1
name: P${{ matrix.php }} - L${{ matrix.laravel }} - ${{ matrix.dependency-version }}
steps:
- uses: actions/checkout@v3
- name: Cache dependencies
uses: actions/cache@v3
with:
path: ~/.composer/cache/files
key: dependencies-laravel-${{ matrix.laravel }}-php-${{ matrix.php }}-composer-${{ hashFiles('composer.json') }}
- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php }}
extensions: mbstring, pdo, pdo_sqlite
coverage: none
- name: Install dependencies
run: |
composer require "laravel/framework:${{ matrix.laravel }}" "orchestra/testbench:${{ matrix.testbench }}" "filament/support" --no-interaction --no-update
composer update --${{ matrix.dependency-version }} --prefer-dist --no-interaction
- name: Run PHPStan
run: ./vendor/bin/phpstan
Any help?
9 Replies
Lara Zeus
Lara Zeus9mo ago
what is wrong? any error msg?
Matthew
MatthewOP9mo ago
Ah yes, oops Run ./vendor/bin/phpstan At least one path must be specified to analyse. Error: Process completed with exit code 1.
Lara Zeus
Lara Zeus9mo ago
I think you dont have a config file for phpstan phpstan.neon or phpstan.neon.dist
Matthew
MatthewOP9mo ago
I added ./vendor/bin/phpstan analyze app, and now it seems to be working
Lara Zeus
Lara Zeus9mo ago
that is another solution 👍 you can pass the folder/files name or set them in the config
Matthew
MatthewOP9mo ago
No description
Matthew
MatthewOP9mo ago
one more thing Im trying to use pint, and I cant exclude the migration files
{
"preset": "laravel",
"exclude": [
"database/migrations/*"
],
"rules": {
"blank_line_before_statement": true,
"concat_space": {
"spacing": "one"
},
"method_argument_space": true,
"single_trait_insert_per_statement": true,
"types_spaces": {
"space": "single"
}
}
}
{
"preset": "laravel",
"exclude": [
"database/migrations/*"
],
"rules": {
"blank_line_before_statement": true,
"concat_space": {
"spacing": "one"
},
"method_argument_space": true,
"single_trait_insert_per_statement": true,
"types_spaces": {
"space": "single"
}
}
}
I also tried
"exclude": [
"database/migrations"
],
"exclude": [
"database/migrations"
],
and
"exclude": [
"migrations"
],
"exclude": [
"migrations"
],
FYI pint works and the config is loaded, I just cant exclude directories
Lara Zeus
Lara Zeus9mo ago
sometimes it can be cache?! not sure database/migrations should work try notName and notPath
Matthew
MatthewOP9mo ago
I cleared cache Still. they get formatted even with not path nvm im stupid. I called the wrong config 💀 Its fixed now :)
Want results from more Discord servers?
Add your server