-
Notifications
You must be signed in to change notification settings - Fork 418
62 lines (55 loc) · 2.18 KB
/
Copy pathcode-rules.yml
File metadata and controls
62 lines (55 loc) · 2.18 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
name: code-rules
on: [pull_request, push]
permissions:
contents: read
pull-requests: read
jobs:
code-rules:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
with:
fetch-depth: 1
- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: '8.4'
extensions: dom, curl, libxml, mbstring, zip, gd, json, readline, xsl, imagick
tools: composer:v2
coverage: none
- name: Cache Composer dependencies
uses: actions/cache@v4
with:
path: vendor/composer/vendor
key: composer-${{ hashFiles('composer.lock') }}
restore-keys: composer-
- name: Prepare Customizing directory
# The composer classmap includes ./public/Customizing/global/plugins; --no-scripts
# skips the pre-install-cmd that would create it, so create it here — otherwise
# autoload generation aborts ("Could not scan for classes inside ...").
run: mkdir -p public/Customizing/global/plugins
- name: Install Composer packages
# --no-scripts skips the post-autoload-dump build (cli/setup.php build), which
# copies front-end assets from node_modules. PHPStan only needs the autoloader
# and classmap (still generated), so neither the build nor Node.js is required.
run: composer install --no-interaction --no-progress --no-scripts
- name: Cache PHPStan result cache
uses: actions/cache@v4
with:
path: scripts/PHPStan/.cache/code-rules
key: phpstan-code-rules-${{ github.run_id }}
restore-keys: phpstan-code-rules-
- name: ILIAS Code Rules
# Hard gate: the branch that introduced these rules also brought the count to
# zero, so any new violation has to be fixed or exempted in the pull request
# that adds it.
run: scripts/PHPStan/run_code_rules.sh
env:
GHRUN: "yes"
ERROR_FORMAT: github
- name: Code Rules Summary
if: always()
run: ERROR_FORMAT=stepSummary scripts/PHPStan/run_code_rules.sh >> "$GITHUB_STEP_SUMMARY" || true
env:
GHRUN: "yes"