-
Notifications
You must be signed in to change notification settings - Fork 0
101 lines (80 loc) · 2.45 KB
/
test_pull_request.yml
File metadata and controls
101 lines (80 loc) · 2.45 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
101
name: Test and Static Analysis (Pull Request)
on: pull_request
jobs:
test-and-static-analysis:
name: Test and Lint
runs-on: ubuntu-latest
strategy:
matrix:
php: ['8.1', '8.2', '8.3', '8.4', '8.5']
steps:
- name: Set up PHP
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php }}
coverage: xdebug
tools: composer:v2
- name: Set up Node
uses: actions/setup-node@v6
with:
node-version: '24.x'
- name: Checkout code
uses: actions/checkout@v5
with:
fetch-depth: 0
- name: PHP Version Check
run: php -v
- name: Validate Composer JSON
run: composer validate
- name: Run Composer Install
id: composerinstall
run: composer install --no-interaction
- name: PHP Lint
run: ./vendor/bin/parallel-lint src tests examples
- name: Neon Lint
run: ./vendor/nette/neon/bin/neon-lint conf
- name: PHP Code Sniffer
run: |
./vendor/bin/phpcs --version
./vendor/bin/phpcs --ignore=vendor --standard=phpcs.xml -s -p .
- name: PHPStan
run: |
./vendor/bin/phpstan --version
./vendor/bin/phpstan analyze -c phpstan.neon
- name: Unit tests
run: |
mkdir -p build/logs
./vendor/bin/phpunit --version
echo "Test suite All"
./vendor/bin/phpunit ./tests/
code-coverage:
name: Code coverage
runs-on: ubuntu-latest
strategy:
matrix:
php: ['8.4']
steps:
- name: Set up PHP
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php }}
coverage: xdebug
tools: composer:v2
- name: Set up Node
uses: actions/setup-node@v6
with:
node-version: '24.x'
- name: Checkout code
uses: actions/checkout@v5
with:
fetch-depth: 0
- name: Run Composer
run: composer install --no-interaction
- name: Update PHPUnit for Code Coverage
run: composer require phpunit/phpunit:^10.5 sebastian/version:* --with-all-dependencies
- name: PHP Lint
run: ./vendor/bin/parallel-lint src tests examples
- name: Unit tests
run: |
mkdir -p build/logs
XDEBUG_MODE=coverage ./vendor/bin/phpunit ./tests/ --coverage-clover build/logs/clover.xml --coverage-filter=./src/