CodeIgniterを4.4に更新 #51
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Static Analysis | |
on: | |
pull_request: | |
branches: | |
- develop | |
paths: | |
- 'app/**' | |
- 'tests/**' | |
- composer.* | |
- phpcs.xml | |
- phpmd.xml | |
- phpstan.neon | |
- psalm.xml | |
- '.github/workflows/**' | |
workflow_dispatch: | |
jobs: | |
static-analysis-phpstan: | |
name: PHPStan | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v3 | |
with: | |
fetch-depth: 0 | |
- name: Setup PHP | |
uses: shivammathur/setup-php@v2 | |
with: | |
php-version: 8.2 | |
tools: cs2pr | |
coverage: none | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
- name: Get composer cache directory | |
run: echo "COMPOSER_CACHE_FILES_DIR=$(composer config cache-files-dir)" >> $GITHUB_ENV | |
- name: Cache composer dependencies | |
uses: actions/cache@v3 | |
with: | |
path: ${{ env.COMPOSER_CACHE_FILES_DIR }} | |
key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.json') }}-${{ hashFiles('**/composer.lock') }} | |
restore-keys: ${{ runner.os }}-composer- | |
- name: Install dependencies | |
run: composer install --no-interaction --no-progress --prefer-dist | |
- name: Run PHPStan | |
run: ./vendor/bin/phpstan analyse -c phpstan.neon --no-progress --no-interaction --error-format=checkstyle | cs2pr | |
static-analysis-psalm: | |
name: Psalm | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v3 | |
with: | |
fetch-depth: 0 | |
- name: Setup PHP | |
uses: shivammathur/setup-php@v2 | |
with: | |
php-version: 8.2 | |
tools: cs2pr | |
coverage: none | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
- name: Get composer cache directory | |
run: echo "COMPOSER_CACHE_FILES_DIR=$(composer config cache-files-dir)" >> $GITHUB_ENV | |
- name: Install dependencies | |
run: composer install --no-interaction --no-progress --prefer-dist | |
- name: Run Psalm | |
run: ./vendor/bin/psalm --show-info=false --output-format=checkstyle --shepherd | cs2pr | |
static-analysis-phpmd: | |
name: PHPMD | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v3 | |
with: | |
fetch-depth: 0 | |
- name: Setup PHP | |
uses: shivammathur/setup-php@v2 | |
with: | |
php-version: 8.2 | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
- name: Get composer cache directory | |
run: echo "COMPOSER_CACHE_FILES_DIR=$(composer config cache-files-dir)" >> $GITHUB_ENV | |
- name: Cache composer dependencies | |
uses: actions/cache@v3 | |
with: | |
path: ${{ env.COMPOSER_CACHE_FILES_DIR }} | |
key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.json') }}-${{ hashFiles('**/composer.lock') }} | |
restore-keys: ${{ runner.os }}-composer- | |
- name: Install dependencies | |
run: composer install --no-interaction --no-progress --prefer-dist | |
- name: Run PHP Mess Detector | |
run: ./vendor/bin/phpmd app text ./phpmd.xml --exclude */app/Config,*/app/Views | |
static-analysis-php-metrics: | |
name: PhpMetrics | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v3 | |
with: | |
fetch-depth: 0 | |
- name: Setup PHP | |
uses: shivammathur/setup-php@v2 | |
with: | |
php-version: 8.2 | |
coverage: none | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
- name: Get composer cache directory | |
run: echo "COMPOSER_CACHE_FILES_DIR=$(composer config cache-files-dir)" >> $GITHUB_ENV | |
- name: Install dependencies | |
run: composer install --no-interaction --no-progress --prefer-dist | |
- name: Run PhpMetrics | |
run: ./vendor/bin/phpmetrics app --exclude='Config,Database,Language,ThirdParty,Views' |