Skip to content

Commit 11d90ec

Browse files
committed
Add static code analysis testing
1 parent 285719c commit 11d90ec

File tree

1 file changed

+74
-0
lines changed

1 file changed

+74
-0
lines changed
Lines changed: 74 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,74 @@
1+
name: Static Code Analysis
2+
3+
on:
4+
schedule:
5+
- cron: '0 0 * * *'
6+
pull_request:
7+
push:
8+
branches:
9+
- 1.x
10+
paths:
11+
- '**.php'
12+
- .github/workflows/static-code-analysis.yml
13+
- composer.json
14+
- '**.neon'
15+
16+
concurrency:
17+
group: sca-${{ github.head_ref || github.run_id }}
18+
cancel-in-progress: true
19+
20+
permissions:
21+
contents: read
22+
23+
jobs:
24+
tests:
25+
strategy:
26+
fail-fast: false
27+
matrix:
28+
php-version:
29+
- '8.2'
30+
- '8.3'
31+
- '8.4'
32+
33+
name: Static Code Analysis
34+
runs-on: ubuntu-24.04
35+
36+
steps:
37+
- name: Checkout code
38+
uses: actions/checkout@v5
39+
40+
- name: Setup PHP
41+
uses: shivammathur/setup-php@v2
42+
with:
43+
php-version: ${{ matrix.php-version }}
44+
coverage: none
45+
ini-values: display_errors=On, display_startup_errors=On, error_reporting=-1, zend.assertions=1, assert.exception=1
46+
47+
- name: Get composer cache directory
48+
id: cache-dir
49+
run: |
50+
echo "COMPOSER_CACHE_DIR=$(composer config cache-dir)" >> $GITHUB_OUTPUT
51+
52+
- name: Cache Composer dependencies
53+
uses: actions/cache@v4
54+
with:
55+
path: ${{ steps.cache-dir.outputs.COMPOSER_CACHE_DIR }}
56+
key: ${{ github.workflow }}-PHP_${{ matrix.php-version }}-${{ hashFiles('**/composer.json') }}
57+
restore-keys: |
58+
${{ github.workflow }}-PHP_${{ matrix.php-version }}-
59+
60+
- name: Install dependencies
61+
run: |
62+
composer update --ansi
63+
64+
- name: Check - PHP Configuration
65+
run: vendor/bin/phpunit --check-php-configuration
66+
67+
- name: Check - PHP-CS-Fixer
68+
run: composer cs:check
69+
70+
- name: Check - PHPStan
71+
run: composer phpstan:check
72+
73+
- name: Check - Static Type Analysis
74+
run: composer test:stan

0 commit comments

Comments
 (0)