-
Notifications
You must be signed in to change notification settings - Fork 0
135 lines (116 loc) · 4.28 KB
/
Copy pathci.yml
File metadata and controls
135 lines (116 loc) · 4.28 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
125
126
127
128
129
130
131
132
133
134
135
# CI: tests on PHP 8.2+ × Symfony 7.0, 7.4, 8.0, 8.1 (minimum minors per REQ-SF-002).
# Release (incl. latest) is created by release.yml on tag push (v*).
name: CI
on:
push:
branches: [main, master]
pull_request:
branches: [main, master]
jobs:
git-hygiene:
name: Git history (no Cursor co-author)
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v7
with:
fetch-depth: 0
- name: Check for Cursor co-author trailers (REQ-GIT-001)
run: |
chmod +x .scripts/check-no-cursor-coauthor.sh
./.scripts/check-no-cursor-coauthor.sh HEAD
test:
name: PHP ${{ matrix.php }} - Symfony ${{ matrix.symfony }}
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
php: ['8.2', '8.3', '8.4', '8.5']
symfony: ['7.0', '7.4', '8.0', '8.1']
exclude:
- php: '8.2'
symfony: '8.0'
- php: '8.2'
symfony: '8.1'
- php: '8.3'
symfony: '8.0'
- php: '8.3'
symfony: '8.1'
steps:
- name: Checkout code
uses: actions/checkout@v7
- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php }}
extensions: json
coverage: pcov
tools: composer:v2
- name: Validate composer.json
run: composer validate --strict
- name: Get Composer cache directory
id: composer-cache
run: echo "dir=$(composer config cache-files-dir)" >> $GITHUB_OUTPUT
- name: Cache Composer dependencies
uses: actions/cache@v6
with:
path: ${{ steps.composer-cache.outputs.dir }}
key: ${{ runner.os }}-php-${{ matrix.php }}-symfony-${{ matrix.symfony }}-composer-${{ hashFiles('**/composer.json') }}
restore-keys: |
${{ runner.os }}-php-${{ matrix.php }}-symfony-${{ matrix.symfony }}-composer-
${{ runner.os }}-php-${{ matrix.php }}-composer-
- name: Install dependencies with Symfony ${{ matrix.symfony }}
run: |
composer require --dev \
symfony/browser-kit:^${{ matrix.symfony }} \
symfony/framework-bundle:^${{ matrix.symfony }} \
symfony/yaml:^${{ matrix.symfony }} \
--no-interaction --no-update
composer require \
symfony/config:^${{ matrix.symfony }} \
symfony/dependency-injection:^${{ matrix.symfony }} \
symfony/form:^${{ matrix.symfony }} \
symfony/http-kernel:^${{ matrix.symfony }} \
symfony/routing:^${{ matrix.symfony }} \
symfony/security-csrf:^${{ matrix.symfony }} \
symfony/translation:^${{ matrix.symfony }} \
symfony/twig-bundle:^${{ matrix.symfony }} \
symfony/validator:^${{ matrix.symfony }} \
symfony/workflow:^${{ matrix.symfony }} \
--no-interaction --no-update
case "${{ matrix.symfony }}" in
8.0|8.1)
composer require doctrine/doctrine-bundle:^3.2.4 --no-interaction --no-update
;;
*)
composer require doctrine/doctrine-bundle:^2.13 --no-interaction --no-update
;;
esac
composer update symfony/* doctrine/doctrine-bundle --with-all-dependencies --no-interaction --prefer-dist --no-progress
- name: Composer audit (Critical/High)
run: composer audit --locked
- name: Run tests
env:
SYMFONY_DEPRECATIONS_HELPER: max[direct]=0
run: composer test
- name: Run tests with coverage (PHP 8.2 + Symfony 7.4 only)
if: matrix.php == '8.2' && matrix.symfony == '7.4'
env:
SYMFONY_DEPRECATIONS_HELPER: max[direct]=0
run: composer test-coverage
cs-check:
name: Code Style Check
runs-on: ubuntu-latest
if: github.event_name == 'pull_request'
steps:
- name: Checkout code
uses: actions/checkout@v7
- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: '8.2'
tools: composer:v2
- name: Install dependencies
run: composer install --prefer-dist --no-progress --no-interaction
- name: Check code style
run: composer cs-check