-
-
Notifications
You must be signed in to change notification settings - Fork 1
65 lines (54 loc) · 2.07 KB
/
codeql.yml
File metadata and controls
65 lines (54 loc) · 2.07 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
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