Skip to content

feat: add URL path prefix configuration option and apply it to object… #4

feat: add URL path prefix configuration option and apply it to object…

feat: add URL path prefix configuration option and apply it to object… #4

name: Static Analysis
on:
push:
branches: [main, develop]
paths:
- "**.php"
- "phpstan.neon.dist"
- "phpstan-baseline.neon"
- ".github/workflows/static-analysis.yml"
- "composer.json"
- "composer.lock"
pull_request:
paths:
- "**.php"
- "phpstan.neon.dist"
- "phpstan-baseline.neon"
- ".github/workflows/static-analysis.yml"
- "composer.json"
- "composer.lock"
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
phpstan:
name: PHPStan
runs-on: ubuntu-latest
timeout-minutes: 10
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: "8.2"
coverage: none
extensions: mbstring, xml, pcntl, dom, curl, libxml, zip, pdo, sqlite, pdo_sqlite, bcmath, soap, intl, gd, exif, iconv
tools: composer:v2
- name: Get composer cache directory
id: composer-cache
run: echo "dir=$(composer config cache-files-dir)" >> $GITHUB_OUTPUT
- name: Cache composer dependencies
uses: actions/cache@v4
with:
path: ${{ steps.composer-cache.outputs.dir }}
key: ${{ runner.os }}-composer-phpstan-${{ hashFiles('**/composer.lock') }}
restore-keys: |
${{ runner.os }}-composer-phpstan-
${{ runner.os }}-composer-
- name: Install composer dependencies
run: composer install --prefer-dist --no-interaction --no-progress --optimize-autoloader
- name: Create build directory
run: mkdir -p build/phpstan
- name: Run PHPStan
run: ./vendor/bin/phpstan analyse --error-format=github --no-progress
- name: Store PHPStan results
if: always()
uses: actions/upload-artifact@v4
with:
name: phpstan-results
path: build/phpstan/
retention-days: 7
psalm:
name: Psalm
runs-on: ubuntu-latest
timeout-minutes: 10
continue-on-error: true
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: "8.2"
coverage: none
extensions: mbstring, xml, pcntl, dom, curl, libxml, zip, pdo, sqlite, pdo_sqlite, bcmath, soap, intl, gd, exif, iconv
tools: composer:v2
- name: Get composer cache directory
id: composer-cache
run: echo "dir=$(composer config cache-files-dir)" >> $GITHUB_OUTPUT
- name: Cache composer dependencies
uses: actions/cache@v4
with:
path: ${{ steps.composer-cache.outputs.dir }}
key: ${{ runner.os }}-composer-psalm-${{ hashFiles('**/composer.lock') }}
restore-keys: |
${{ runner.os }}-composer-psalm-
${{ runner.os }}-composer-
- name: Install composer dependencies
run: composer install --prefer-dist --no-interaction --no-progress --optimize-autoloader
- name: Install Psalm
run: composer require --dev vimeo/psalm --no-interaction
- name: Initialize Psalm config
run: |
if [ ! -f psalm.xml ]; then
./vendor/bin/psalm --init
fi
- name: Run Psalm
run: ./vendor/bin/psalm --output-format=github --no-progress
continue-on-error: true