Skip to content

Commit c96db92

Browse files
authored
Chore: improve CI (#247)
1 parent d3abefb commit c96db92

3 files changed

Lines changed: 50 additions & 48 deletions

File tree

.github/workflows/ci.yml

Lines changed: 40 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -25,16 +25,16 @@ jobs:
2525
steps:
2626
- name: Checkout
2727
uses: actions/checkout@v4
28-
28+
2929
- name: Lint with Hadolint
3030
uses: hadolint/hadolint-action@v3.1.0
3131
with:
3232
dockerfile: ${{ matrix.dockerfile }}
3333
failure-threshold: warning
34-
34+
3535
- name: Set up Docker Buildx
3636
uses: docker/setup-buildx-action@v3
37-
37+
3838
- name: Validate Dockerfile syntax
3939
run: |
4040
docker buildx build \
@@ -47,32 +47,32 @@ jobs:
4747
name: Analyze
4848
runs-on: ubuntu-latest
4949
container:
50-
image: php:8.3-alpine
50+
image: php:8.4-alpine
5151
options: >-
5252
--tmpfs /tmp:exec
5353
--tmpfs /var/tmp:exec
5454
steps:
5555
- name: Checkout
5656
uses: actions/checkout@v4
57-
57+
5858
- name: Install GD / ZIP PHP extension
5959
run: |
6060
apk add $PHPIZE_DEPS libpng-dev libzip-dev
6161
docker-php-ext-configure gd
6262
docker-php-ext-configure zip
6363
docker-php-ext-install gd zip
64-
64+
6565
- name: Install Composer
6666
run: wget -qO - https://getcomposer.org/installer | php -- --install-dir=/usr/local/bin --filename=composer --quiet
67-
67+
6868
- name: Validate Composer
6969
run: composer validate
70-
70+
7171
- name: Update to highest dependencies with Composer
72-
run: composer update --no-interaction --no-progress --ansi
73-
72+
run: composer install --no-interaction --no-progress --ansi
73+
7474
- name: Analyze
75-
run: PHP_CS_FIXER_IGNORE_ENV=True vendor/bin/php-cs-fixer fix --ansi
75+
run: vendor/bin/php-cs-fixer fix --ansi
7676

7777
phpunit:
7878
name: PHPUnit (PHP ${{ matrix.php }})
@@ -98,33 +98,34 @@ jobs:
9898
--health-retries 5
9999
ports:
100100
- 3306:3306
101-
101+
102102
strategy:
103103
matrix:
104104
php:
105105
- '8.2'
106106
- '8.3'
107107
- '8.4'
108+
- '8.5'
108109
fail-fast: false
109-
110+
110111
steps:
111112
- name: Checkout
112113
uses: actions/checkout@v4
113-
114+
114115
- name: Install MySQL / GD / ZIP PHP extensions
115116
run: |
116117
apk add $PHPIZE_DEPS icu-libs icu-dev libpng-dev libzip-dev
117118
docker-php-ext-configure intl
118119
docker-php-ext-configure gd
119120
docker-php-ext-configure zip
120121
docker-php-ext-install pdo pdo_mysql intl gd zip
121-
122+
122123
- name: Install Composer
123124
run: wget -qO - https://getcomposer.org/installer | php -- --install-dir=/usr/local/bin --filename=composer --quiet
124-
125+
125126
- name: Install dependencies with Composer
126127
run: composer install --no-progress --no-interaction --ansi
127-
128+
128129
- name: Run tests with PHPUnit
129130
env:
130131
DATABASE_URL: mysql://davis:davis@mysql:3306/davis_test
@@ -134,11 +135,11 @@ jobs:
134135
name: Migrations (${{ matrix.database }})
135136
runs-on: ubuntu-latest
136137
container:
137-
image: php:8.3-alpine
138+
image: php:8.4-alpine
138139
options: >-
139140
--tmpfs /tmp:exec
140141
--tmpfs /var/tmp:exec
141-
142+
142143
services:
143144
mysql:
144145
image: mariadb:10.11
@@ -152,7 +153,7 @@ jobs:
152153
--health-interval 10s
153154
--health-timeout 5s
154155
--health-retries 5
155-
156+
156157
postgres:
157158
image: postgres:15-alpine
158159
env:
@@ -164,33 +165,33 @@ jobs:
164165
--health-interval 10s
165166
--health-timeout 5s
166167
--health-retries 5
167-
168+
168169
strategy:
169170
matrix:
170171
database:
171172
- mysql
172173
- postgresql
173174
- sqlite
174175
fail-fast: false
175-
176+
176177
steps:
177178
- name: Checkout
178179
uses: actions/checkout@v4
179-
180+
180181
- name: Install database extensions
181182
run: |
182183
apk add $PHPIZE_DEPS icu-libs icu-dev libpng-dev libzip-dev postgresql-dev sqlite-dev
183184
docker-php-ext-configure intl
184185
docker-php-ext-configure gd
185186
docker-php-ext-configure zip
186187
docker-php-ext-install pdo pdo_mysql pdo_pgsql pdo_sqlite intl gd zip
187-
188+
188189
- name: Install Composer
189190
run: wget -qO - https://getcomposer.org/installer | php -- --install-dir=/usr/local/bin --filename=composer --quiet
190-
191+
191192
- name: Install dependencies with Composer
192193
run: composer install --no-progress --no-interaction --ansi
193-
194+
194195
- name: Run migrations (MySQL)
195196
if: matrix.database == 'mysql'
196197
env:
@@ -199,7 +200,7 @@ jobs:
199200
php bin/console doctrine:database:create --if-not-exists --env=test
200201
php bin/console doctrine:migrations:migrate --no-interaction --env=test
201202
php bin/console doctrine:schema:validate --env=test
202-
203+
203204
- name: Run migrations (PostgreSQL)
204205
if: matrix.database == 'postgresql'
205206
env:
@@ -208,7 +209,7 @@ jobs:
208209
php bin/console doctrine:database:create --if-not-exists --env=test
209210
php bin/console doctrine:migrations:migrate --no-interaction --env=test
210211
php bin/console doctrine:schema:validate --skip-sync --env=test
211-
212+
212213
- name: Run migrations (SQLite)
213214
if: matrix.database == 'sqlite'
214215
env:
@@ -221,11 +222,11 @@ jobs:
221222
name: Application Smoke Test
222223
runs-on: ubuntu-latest
223224
container:
224-
image: php:8.3-alpine
225+
image: php:8.4-alpine
225226
options: >-
226227
--tmpfs /tmp:exec
227228
--tmpfs /var/tmp:exec
228-
229+
229230
services:
230231
mysql:
231232
image: mariadb:10.11
@@ -239,25 +240,25 @@ jobs:
239240
--health-interval 10s
240241
--health-timeout 5s
241242
--health-retries 5
242-
243+
243244
steps:
244245
- name: Checkout
245246
uses: actions/checkout@v4
246-
247+
247248
- name: Install extensions and curl
248249
run: |
249250
apk add $PHPIZE_DEPS icu-libs icu-dev libpng-dev libzip-dev curl
250251
docker-php-ext-configure intl
251252
docker-php-ext-configure gd
252253
docker-php-ext-configure zip
253254
docker-php-ext-install pdo pdo_mysql intl gd zip
254-
255+
255256
- name: Install Composer
256257
run: wget -qO - https://getcomposer.org/installer | php -- --install-dir=/usr/local/bin --filename=composer --quiet
257-
258+
258259
- name: Install dependencies with Composer
259260
run: composer install --no-progress --no-interaction --ansi --optimize-autoloader
260-
261+
261262
- name: Prepare application
262263
env:
263264
DATABASE_URL: mysql://davis:davis@mysql:3306/davis_test
@@ -266,7 +267,7 @@ jobs:
266267
php bin/console doctrine:database:create --if-not-exists --env=test
267268
php bin/console doctrine:migrations:migrate --no-interaction --env=test
268269
php bin/console cache:clear --env=test
269-
270+
270271
- name: Start Symfony server in background
271272
env:
272273
DATABASE_URL: mysql://davis:davis@mysql:3306/davis_test
@@ -275,7 +276,7 @@ jobs:
275276
php -S 127.0.0.1:8000 -t public/ &
276277
echo $! > server.pid
277278
sleep 3
278-
279+
279280
- name: Test application responds
280281
run: |
281282
# Test that the app responds with a successful HTTP status
@@ -287,12 +288,12 @@ jobs:
287288
echo "❌ Application returned unexpected status code: $RESPONSE"
288289
exit 1
289290
fi
290-
291+
291292
- name: Test dashboard
292293
continue-on-error: true
293294
run: |
294295
curl -f http://127.0.0.1:8000/dashboard || echo "No health endpoint available"
295-
296+
296297
- name: Stop server
297298
if: always()
298299
run: |

.php-cs-fixer.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@
1717
'phpdoc_add_missing_param_annotation' => true,
1818
'single_trait_insert_per_statement' => false
1919
])
20+
->setUnsupportedPhpVersionAllowed(true)
2021
->setUsingCache(false)
2122
->setFinder($finder)
2223
;

README.md

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ Comes with already built Docker images in two flavours: [standalone](https://git
4949

5050
# 🔩 Requirements
5151

52-
- PHP > 8.2 (with `pdo_mysql` [or `pdo_pgsql`, `pdo_sqlite`], `gd` and `intl` extensions), compatible up to PHP 8.3 (_See dependencies table below_)
52+
- PHP > 8.2 (with `pdo_mysql` [or `pdo_pgsql`, `pdo_sqlite`], `gd` and `intl` extensions), compatible up to PHP 8.5 (_See dependencies table below_)
5353
- A compatible database layer, such as MySQL or MariaDB (recommended), PostgreSQL (not extensively tested yet) or SQLite (not extensively tested yet)
5454
- Composer > 2 (_The last release compatible with Composer 1 is [v1.6.2](https://github.com/tchapi/davis/releases/tag/v1.6.2)_)
5555
- The [`imap`](https://www.php.net/manual/en/imap.installation.php) and [`ldap`](https://www.php.net/manual/en/ldap.installation.php) PHP extensions if you want to use either authentication methods (_these are not enabled / compiled by default except in the Docker image_)
@@ -112,7 +112,7 @@ Create your own `.env.local` file to change the necessary variables, if you plan
112112
> In a production environnement, the `APP_ENV` variable MUST be set to `prod` to prevent leaking sensitive data.
113113
114114
**a. The database driver and url** (_you should already have it configured since you created the database previously_)
115-
115+
116116
```shell
117117
DATABASE_DRIVER=mysql # or postgresql, or sqlite
118118
DATABASE_URL=mysql://db_user:db_pass@host:3306/db_name?serverVersion=10.9.3-MariaDB&charset=utf8mb4
@@ -155,7 +155,7 @@ PUBLIC_CALENDARS_ENABLED=true
155155
**e. Mailer configuration**
156156

157157
It includes:
158-
- the mailer uri (`MAILER_DSN`)
158+
- the mailer uri (`MAILER_DSN`)
159159
- The email address that your invites are going to be sent from
160160

161161
```shell
@@ -225,7 +225,7 @@ APP_TIMEZONE=Australia/Lord_Howe
225225
> ```shell
226226
> APP_TIMEZONE=
227227
> ```
228-
> in your environment file if you wish to use the **actual default timezone of the server**, and not enforcing it.
228+
> in your environment file if you wish to use the **actual default timezone of the server**, and not enforcing it.
229229
230230
**j. Trusting forwarded headers**
231231
@@ -466,7 +466,7 @@ To build the checked out version, just run:
466466
docker build --pull --file docker/Dockerfile --tag davis:latest --build-arg fpm_user=82:82 .
467467
468468
> [!TIP]
469-
>
469+
>
470470
> The `fpm_user` build arg allows to set:
471471
> - the uid FPM will run with
472472
> - the owner of the app folder
@@ -479,7 +479,7 @@ This will build a `davis:latest` image that you can directly use. Do not forget
479479
You can use `--platform` to specify the platform to build for. Currently, `arm64` (ARMv8) and `amd64` (x86) are supported.
480480
481481
> [!IMPORTANT]
482-
>
482+
>
483483
> ⚠ Do not forget to run all the database migrations the first time you run the container :
484484
>
485485
> docker exec -it davis sh -c "APP_ENV=prod bin/console doctrine:migrations:migrate --no-interaction"
@@ -509,7 +509,7 @@ docker pull ghcr.io/tchapi/davis:edge
509509
```
510510
511511
> [!WARNING]
512-
>
512+
>
513513
> The `edge` image must not be considered stable. **Use only release images for production setups**.
514514
515515
## Full stack
@@ -525,13 +525,13 @@ You can start the containers with :
525525
> The default recipe above uses MariaDB.
526526
527527
> [!IMPORTANT]
528-
>
528+
>
529529
> ⚠ Do not forget to run all the database migrations the first time you run the container :
530530
>
531531
> docker exec -it davis sh -c "APP_ENV=prod bin/console doctrine:migrations:migrate --no-interaction"
532532
533533
> [!WARNING]
534-
>
534+
>
535535
> For SQLite, you must also make sure that the folder the database will reside in AND the database file in itself have the right permissions! You can do for instance:
536536
> `chown -R www-data: /data` if `/data` is the folder your SQLite database will be in, just after you have run the migrations
537537

0 commit comments

Comments
 (0)