-
Notifications
You must be signed in to change notification settings - Fork 4
100 lines (84 loc) · 3.74 KB
/
Copy pathcode-quality.yml
File metadata and controls
100 lines (84 loc) · 3.74 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
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
# +-------------------------------------------------------------------------+
# | Copyright (C) 2004-2026 The Cacti Group |
# | |
# | This program is free software; you can redistribute it and/or |
# | modify it under the terms of the GNU General Public License |
# | as published by the Free Software Foundation; either version 2 |
# | of the License, or (at your option) any later version. |
# | |
# | This program is distributed in the hope that it will be useful, |
# | but WITHOUT ANY WARRANTY; without even the implied warranty of |
# | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
# | GNU General Public License for more details. |
# +-------------------------------------------------------------------------+
# | Cacti: The Complete RRDtool-based Graphing Solution |
# +-------------------------------------------------------------------------+
# | This code is designed, written, and maintained by the Cacti Group. See |
# | about.php and/or the AUTHORS file for specific developer information. |
# +-------------------------------------------------------------------------+
# | http://www.cacti.net/ |
# +-------------------------------------------------------------------------+
name: Code Quality
on:
push:
branches:
- main
- develop
pull_request:
branches:
- main
- develop
jobs:
code-quality:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
php: ['8.1', '8.2', '8.3', '8.4']
name: PHP ${{ matrix.php }} Code Quality
steps:
- name: Checkout Cacti
uses: actions/checkout@v4
with:
repository: Cacti/cacti
ref: develop
path: cacti
- name: Checkout audit Plugin
uses: actions/checkout@v4
with:
path: cacti/plugins/audit
- name: Install PHP ${{ matrix.php }}
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php }}
extensions: intl, mysql, gd, ldap, gmp, mbstring, dom, xml, json, sockets
coverage: none
ini-values: "memory_limit=512M"
- name: Check PHP version
run: php -v
- name: Validate Cacti Composer files
run: composer validate --strict
working-directory: cacti
- name: Install Cacti development dependencies
run: composer install --prefer-dist --no-progress
working-directory: cacti
- name: Lint audit Plugin
run: include/vendor/bin/phplint --no-cache --exclude=locales plugins/audit
working-directory: cacti
- name: Run PHP-CS-Fixer (dry-run)
run: include/vendor/bin/php-cs-fixer fix --dry-run --diff --config=plugins/audit/.php-cs-fixer.php --allow-unsupported-php-version=yes
working-directory: cacti
- name: Run PHPStan
run: include/vendor/bin/phpstan analyse --configuration=plugins/audit/.phpstan.neon --memory-limit=512M --no-progress
working-directory: cacti
- name: Run Pest Tests
if: ${{ matrix.php != '8.1' }}
run: include/vendor/bin/pest plugins/audit/tests/Security --display-warnings
working-directory: cacti
- name: Run Audit Security Helper Tests
run: |
php tests/security_functions_test.php
php tests/controller_security_test.php
php tests/syslog_queue_test.php
timeout 60 php tests/syslog_functions_test.php
working-directory: cacti/plugins/audit