Fix tests - double chargement de la config #243
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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/ |