-
-
Notifications
You must be signed in to change notification settings - Fork 4
195 lines (168 loc) · 5.84 KB
/
ci.yaml
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
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
on:
push:
branches:
- main
pull_request:
types: [opened, synchronize, reopened, ready_for_review]
concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true
defaults:
run:
shell: bash
jobs:
code_quality:
name: Code Quality
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Install PHP
uses: shivammathur/setup-php@v2
with:
php-version: 8.2
tools: symfony-cli
- name: Install Composer dependencies
run: symfony composer install --prefer-dist --no-interaction --no-progress
- name: Run Easy Coding Standard
run: symfony php vendor/bin/ecs
test:
name: Test
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
config:
# Minimum supported dependencies and minimum supported PHP version
- PHP_VERSION: '8.1'
COMPOSER_FLAGS: --prefer-stable --prefer-lowest
SYMFONY_VERSION: '6.4'
- PHP_VERSION: '8.2'
COMPOSER_FLAGS: --prefer-stable --prefer-lowest
SYMFONY_VERSION: '7.0'
# Latest 6.4 stable releases
- PHP_VERSION: '8.1'
SYMFONY_VERSION: '6.4'
- PHP_VERSION: '8.2'
SYMFONY_VERSION: '6.4'
- PHP_VERSION: '8.3'
SYMFONY_VERSION: '6.4'
- PHP_VERSION: '8.4'
SYMFONY_VERSION: '6.4'
# Latest 7.0 stable releases
- PHP_VERSION: '8.2'
SYMFONY_VERSION: '7.0'
- PHP_VERSION: '8.3'
SYMFONY_VERSION: '7.0'
- PHP_VERSION: '8.4'
SYMFONY_VERSION: '7.0'
# Latest 7.1 stable releases
- PHP_VERSION: '8.2'
SYMFONY_VERSION: '7.1'
- PHP_VERSION: '8.3'
SYMFONY_VERSION: '7.1'
- PHP_VERSION: '8.4'
SYMFONY_VERSION: '7.1'
# Latest 7.2 stable releases
- PHP_VERSION: '8.2'
SYMFONY_VERSION: '7.2'
- PHP_VERSION: '8.3'
SYMFONY_VERSION: '7.2'
- PHP_VERSION: '8.4'
SYMFONY_VERSION: '7.2'
# Highest supported PHP version with the latest Symfony version, on Windows and macOS
- PHP_VERSION: '8.4'
SYMFONY_VERSION: '7.2'
OS: windows-latest
- PHP_VERSION: '8.4'
SYMFONY_VERSION: '7.2'
OS: macos-14
# Latest 7.x development releases
- PHP_VERSION: '8.2'
SYMFONY_VERSION: '7.*'
STABILITY: dev
- PHP_VERSION: '8.3'
SYMFONY_VERSION: '7.*'
STABILITY: dev
- PHP_VERSION: '8.4'
SYMFONY_VERSION: '7.*'
STABILITY: dev
env:
SYMFONY_REQUIRE: ${{ matrix.config.SYMFONY_VERSION }}
steps:
- uses: actions/checkout@v4
- name: Install PHP
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.config.PHP_VERSION }}
tools: symfony-cli
- name: Install globally Symfony Flex
run: |
symfony composer global require --no-progress --no-scripts --no-plugins symfony/flex
symfony composer global config --no-plugins allow-plugins.symfony/flex true
- name: Configure Composer minimum stability
if: matrix.config.STABILITY
run: symfony composer config minimum-stability ${{ matrix.config.STABILITY }}
- name: Install Composer dependencies
run: symfony composer update ${{ matrix.config.COMPOSER_FLAGS }} --prefer-dist --no-interaction --no-progress
- name: Run PHPStan
run: symfony php vendor/bin/phpstan analyze
- name: Run PHPUnit
run: symfony php vendor/bin/phpunit
e2e:
name: E2E (${{ matrix.os }})
strategy:
matrix:
os: [ ubuntu-latest, windows-latest, macos-latest ]
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v4
- name: Install PHP
uses: shivammathur/setup-php@v2
with:
php-version: 8.2
tools: symfony-cli
- name: Install Composer dependencies
run: symfony composer install --prefer-dist --no-interaction --no-progress
- name: Create a new Symfony project
run: |
git config --global user.email "[email protected]"
git config --global user.name "Hugo Alliaume"
symfony new my_app --webapp
- name: Install kocal/biome-js-bundle
run: |
symfony composer config minimum-stability dev
symfony composer config --json extra.symfony.allow-contrib 'true'
symfony composer config repositories.biome-js-bundle '{"type":"path", "url":"../","options":{"symlink":true}}'
symfony composer require 'kocal/biome-js-bundle:*' --dev --no-interaction
cat << EOF > biome.json
{
"files": {
"ignore": [
"assets/vendor/*",
"assets/controllers.json",
"composer.json",
"public/assets/*",
"public/bundles/*",
"vendor/*"
]
},
"linter": {
"rules" :{
"suspicious": {
"noAssignInExpressions": "off"
}
}
}
}
EOF
working-directory: my_app
- name: Run Biome CI, which should fails
run: symfony console biomejs:ci .
continue-on-error: true
working-directory: my_app
- name: Run Biome Check, and apply fixes
run: symfony console biomejs:check . --write --unsafe
working-directory: my_app
- name: Run Biome CI, which should now pass
run: symfony console biomejs:ci .
working-directory: my_app