Skip to content

CodeQL Analysis

CodeQL Analysis #39

Workflow file for this run

name: CodeQL Analysis
on:
push:
branches: ["master"]
pull_request:
branches: ["master"]
schedule:
- cron: '0 0 * * 0'
jobs:
php-lint:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
php-version: ['8.2', '8.3', '8.4']
steps:
- uses: actions/checkout@v6
- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php-version }}
- name: Cache Composer
uses: actions/cache@v4
with:
path: ~/.composer/cache
key: composer-${{ hashFiles('pluginpass-pro-plugintheme-licensing/composer.lock') }}
restore-keys: composer-
- name: Install dependencies
working-directory: pluginpass-pro-plugintheme-licensing
run: composer install --no-interaction --prefer-dist
- name: Run PHPCS
continue-on-error: true
working-directory: pluginpass-pro-plugintheme-licensing
run: vendor/bin/phpcs --standard=WordPress --extensions=php --report=full --report-file=./phpcs-report.txt inc/
- name: Run PHPStan
continue-on-error: true
working-directory: pluginpass-pro-plugintheme-licensing
run: vendor/bin/phpstan analyse --error-format=raw --no-progress inc --memory-limit=1G > ./phpstan-report.txt || true
- name: Add PHPCS report to job summary
if: always()
working-directory: pluginpass-pro-plugintheme-licensing
run: |
echo "### PHPCS Report for PHP ${{ matrix.php-version }}" >> $GITHUB_STEP_SUMMARY
echo '```' >> $GITHUB_STEP_SUMMARY
cat phpcs-report.txt >> $GITHUB_STEP_SUMMARY
echo '```' >> $GITHUB_STEP_SUMMARY
- name: Add PHPStan report to job summary
if: always()
working-directory: pluginpass-pro-plugintheme-licensing
run: |
echo "### PHPStan Report for PHP ${{ matrix.php-version }}" >> $GITHUB_STEP_SUMMARY
echo '```' >> $GITHUB_STEP_SUMMARY
cat phpstan-report.txt >> $GITHUB_STEP_SUMMARY
echo '```' >> $GITHUB_STEP_SUMMARY