-
Notifications
You must be signed in to change notification settings - Fork 5
155 lines (133 loc) · 4.83 KB
/
Copy pathci.yaml
File metadata and controls
155 lines (133 loc) · 4.83 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
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
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
- name: Run PHPStan
run: symfony php vendor/bin/phpstan analyze
e2e:
runs-on: ${{ matrix.os || 'ubuntu-latest' }}
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, windows-latest, macos-latest]
php-version: [ '8.1', '8.2', '8.3', '8.4' ]
dependency-version: [ '' ]
symfony-version: [ '' ]
minimum-stability: [ 'stable' ]
include:
# dev packages (probably not needed to have multiple such jobs)
- minimum-stability: 'dev'
php-version: '8.4'
# lowest deps
- php-version: '8.1'
dependency-version: 'lowest'
# LTS version of Symfony
- php-version: '8.1'
symfony-version: '6.4.*'
# Explicit Symfony versions
- php-version: '8.1'
symfony-version: '6.4.*'
- php-version: '8.2'
symfony-version: '7.0.*'
- php-version: '8.4'
symfony-version: '8.0.*'
steps:
- uses: actions/checkout@v4
- name: Install PHP
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php-version }}
tools: symfony-cli, flex
- name: Allow Flex Plugin
run: composer global config --no-plugins allow-plugins.symfony/flex true
- name: Configure Composer stability
run: composer config minimum-stability ${{ matrix.minimum-stability }}
- name: Install Composer dependencies
run: |
composer update ${{ matrix.dependency-version == 'lowest' && '--prefer-lowest' || '' }}
env:
SYMFONY_REQUIRE: ${{ matrix.symfony-version || '>=6.4' }}
- name: Create a new Symfony project
run: |
git config --global user.email "hugo@alliau.me"
git config --global user.name "Hugo Alliaume"
case "${{ matrix.php-version }}" in
8.1) symfony new my_app --version="6.4.*" --webapp ;;
8.2) symfony new my_app --version="7.1.*" --webapp ;;
8.3) symfony new my_app --version="7.2.*" --webapp ;;
8.4) case "${{ matrix.symfony-version }}" in
8.0.*) symfony new my_app --version="8.0.*" --webapp ;;
*) symfony new my_app --version="7.3.*" --webapp ;;
esac ;;
esac
- name: Install kocal/biome-js-bundle
working-directory: my_app
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}}'
cat << EOF > config/packages/kocal_biome_js.yaml
when@dev:
kocal_biome_js:
binary_version: '2.0.0'
EOF
symfony composer require 'kocal/biome-js-bundle:*' --dev --no-interaction
cat << EOF > biome.json
{
"files": {
"includes": [
"**",
"!assets/vendor/*",
"!assets/controllers.json",
"!public/assets/*",
"!public/bundles/*",
"!var/*",
"!vendor/*",
"!composer.json"
]
},
"linter": {
"rules" :{
"suspicious": {
"noAssignInExpressions": "off"
}
}
}
}
EOF
- name: Download the Biome.js CLI
working-directory: my_app
run: symfony console biomejs:download
- name: Run Biome CI, which should fails (but it's expected!)
working-directory: my_app
run: bin/biome ci .
continue-on-error: true
- name: Run Biome Check, and apply fixes
working-directory: my_app
run: bin/biome check . --write --unsafe
- name: Run Biome CI, which should now pass
working-directory: my_app
run: bin/biome ci .