-
Notifications
You must be signed in to change notification settings - Fork 1
53 lines (45 loc) · 1.85 KB
/
phpunit.yml
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
name: PHPUnit - Tests de l'application
on: [ push, pull_request, workflow_dispatch ]
jobs:
run:
runs-on: ubuntu-latest
strategy:
matrix:
php-versions: [ '8.3', '8.4' ]
name: PHP ${{ matrix.php-versions }}
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Configuration PHP
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php-versions }}
extensions: imagick, pdo_mysql
tools: phpunit
- name: Lancement de MySQL
run: sudo systemctl start mysql.service
- name: Informations sur l'environnement
run: |
php --version
mysql -V
phpunit --version
php -r 'echo Imagick::getVersion()["versionString"];'
php -r 'echo phpinfo();'
mysql -u root -proot -e "SELECT @@GLOBAL.sql_mode global, @@SESSION.sql_mode session"
- name: Mise en place de l'environnement
run: |
mysql -u root -proot -e "SET GLOBAL sql_mode = 'NO_ENGINE_SUBSTITUTION';"
mysql -u root -proot -e "alter user 'root'@'localhost' identified with mysql_native_password by 'root';"
mysql -u root -proot -e "CREATE DATABASE imageheberg;"
mysql -u root -proot imageheberg < database.sql
sh -c "mv __tests/config/config.php config/"
sh -c "mv __tests/ipv*.txt files/z_cache/"
# Pour ImageUploadAndDeleteTest
sh -c "find files/ -name _dummy -type f -delete"
# Injection des données
mysql -u root -proot imageheberg < __tests/data.sql
# Adaptation à l'environnement actuel
php '__tests/_bootstrap.php'
- name: Test de l'application - phpunit v11
if: ${{ matrix.php-versions != '8.0' }}
run: phpunit --colors --display-warnings --display-errors __tests/