CI workaround for PHP < 7.4 & MySQL 8

The error on PHP 7.2 & 7.3 is:

> PDO::__construct(): The server requested authentication method unknown to the client [caching_sha2_password]

See:
- https://stackoverflow.com/q/53066962/569101
- https://stackoverflow.com/q/52364415/569101
- https://stackoverflow.com/q/51489616/569101
- https://stackoverflow.com/q/50026939/569101

Also upgrade `actions/checkout` v3
This commit is contained in:
Jeremy Benoist 2022-04-11 21:50:03 +02:00
parent 17f87affdb
commit 0ac8089eee
No known key found for this signature in database
GPG key ID: BCA73962457ACC3C
5 changed files with 18 additions and 8 deletions

View file

@ -14,7 +14,7 @@ jobs:
steps:
- name: "Checkout"
uses: "actions/checkout@v2"
uses: "actions/checkout@v3"
- name: "Install Node"
uses: actions/setup-node@v2

View file

@ -14,7 +14,7 @@ jobs:
steps:
- name: "Checkout"
uses: "actions/checkout@v2"
uses: "actions/checkout@v3"
- name: "Install PHP"
uses: "shivammathur/setup-php@v2"

View file

@ -41,7 +41,7 @@ jobs:
steps:
- name: "Checkout"
uses: "actions/checkout@v2"
uses: "actions/checkout@v3"
with:
fetch-depth: 2
@ -54,11 +54,21 @@ jobs:
extensions: json, pdo, pdo_mysql, pdo_sqlite, pdo_pgsql, curl, imagick, pgsql, gd, tidy
ini-values: "date.timezone=Europe/Paris"
- name: "Install MySQL (for PHP < 7.4)"
# there is an issue with PHP < 7.4 and MySQL 8 with `caching_sha2_password`
if: "${{ matrix.database == 'mysql' && (matrix.php == '7.2' || matrix.php == '7.3') }}"
uses: shogo82148/actions-setup-mysql@v1
with:
root-password: root
mysql-version: '5.7'
- name: "Install MySQL (for PHP >= 7.4)"
if: "${{ matrix.database == 'mysql' && matrix.php != '7.2' && matrix.php != '7.3' }}"
run: sudo systemctl start mysql.service
- name: "Setup MySQL"
if: "${{ matrix.database == 'mysql' }}"
run: |
sudo systemctl start mysql.service
sudo mysql -u root -proot -e "CREATE DATABASE wallabag_test"
run: sudo mysql -u root -proot -h 127.0.0.1 -e "CREATE DATABASE wallabag_test"
- name: "Setup PostgreSQL"
if: "${{ matrix.database == 'pgsql' }}"

View file

@ -19,7 +19,7 @@ jobs:
steps:
- name: "Checkout"
uses: "actions/checkout@v2"
uses: "actions/checkout@v3"
- name: "Install PHP"
uses: "shivammathur/setup-php@v2"

View file

@ -1,6 +1,6 @@
parameters:
test_database_driver: pdo_mysql
test_database_host: localhost
test_database_host: 127.0.0.1
test_database_port: 3306
test_database_name: wallabag_test
test_database_user: root