Repository navigation
124 lines (98 loc) · 3.3 KB
/
Copy pathci.yml
File metadata and controls
124 lines (98 loc) · 3.3 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
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
name: CI
on:
push:
branches:
- main
pull_request:
branches:
- main
permissions:
contents: read
jobs:
security:
name: Security Audit
runs-on: ubuntu-latest
steps:
- name: Checkout Code
uses: actions/checkout@v4
- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: '8.4'
coverage: none
- name: Install Dependencies
uses: ramsey/composer-install@v3
- name: Run Security Audit (Composer Audit)
run: composer audit
style:
name: Check Code Style
runs-on: ubuntu-latest
steps:
- name: Checkout Code
uses: actions/checkout@v4
- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: '8.5'
extensions: dom, mbstring, zip, libxml, json, tokenizer, fileinfo
coverage: none
- name: Install Dependencies
uses: ramsey/composer-install@v3
- name: Check Code Style (Pint)
run: ./vendor/bin/pint --test
analyze:
name: Static Analysis
runs-on: ubuntu-latest
steps:
- name: Checkout Code
uses: actions/checkout@v4
- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: '8.5'
extensions: dom, mbstring, zip, libxml, json, tokenizer, fileinfo
coverage: none
- name: Install Dependencies
uses: ramsey/composer-install@v3
- name: Run Static Analysis (PHPStan)
run: ./vendor/bin/phpstan analyse --no-progress
test:
name: PHP ${{ matrix.php }} (${{ matrix.os }})
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, windows-latest, macos-latest]
php: ['8.1', '8.2', '8.3', '8.4', '8.5', '8.6']
steps:
- name: Checkout Code
uses: actions/checkout@v4
- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php }}
extensions: dom, mbstring, zip, libxml, json, tokenizer, fileinfo
coverage: ${{ matrix.os == 'ubuntu-latest' && matrix.php == '8.4' && 'pcov' || 'none' }}
- name: Install Dependencies
uses: ramsey/composer-install@v3
with:
dependency-versions: ${{ matrix.php == '8.2' && 'lowest' || 'highest' }}
env:
# Pest 2 is the only line that runs on PHP 8.1 and it pins PHPUnit <= 10.5.36, which Composer
# blocks for a dev-only advisory (CVE-2026-24765). The Security Audit job still runs unfiltered.
COMPOSER_NO_SECURITY_BLOCKING: ${{ matrix.php == '8.1' && '1' || '0' }}
- name: Warm Up TypePHP Cache
run: php bin/typephp cache:warm
- name: Run Full Test Suite with Coverage (Pest)
run: ./vendor/bin/pest --coverage-clover=clover.xml --compact
if: matrix.os == 'ubuntu-latest' && matrix.php == '8.4'
- name: Run Full Test Suite (Pest)
run: ./vendor/bin/pest --compact
if: "! (matrix.os == 'ubuntu-latest' && matrix.php == '8.4')"
- name: Upload Coverage to Codecov
uses: codecov/codecov-action@v5
if: matrix.os == 'ubuntu-latest' && matrix.php == '8.4'
with:
token: ${{ secrets.CODECOV_TOKEN }}
files: clover.xml
fail_ci_if_error: false