From f74f7f58cd165a494d5f2e873318886df62e15e1 Mon Sep 17 00:00:00 2001 From: Sami Mazouz Date: Fri, 12 Aug 2022 19:22:38 +0100 Subject: [PATCH] test: refactor prefix matrix and add `MySQL 8.0` & `PHP 7.3` to workflows (#3595) * chore: simplify added prefix tests to matrix without using exclusions * test: recover 7.3 testing * test: add mysql 8.0 to matrix * test: exclude some PHP versions from running with MySQL 8.0 to reduce actions Signed-off-by: Sami Mazouz --- .github/workflows/REUSABLE_backend.yml | 40 +++++++++++++++++++------- 1 file changed, 29 insertions(+), 11 deletions(-) diff --git a/.github/workflows/REUSABLE_backend.yml b/.github/workflows/REUSABLE_backend.yml index 3d1925fea..a4b8c75bc 100644 --- a/.github/workflows/REUSABLE_backend.yml +++ b/.github/workflows/REUSABLE_backend.yml @@ -19,12 +19,12 @@ on: description: Versions of PHP to test with. Should be array of strings encoded as JSON array type: string required: false - default: '["7.4", "8.0", "8.1"]' + default: '["7.3", "7.4", "8.0", "8.1"]' db_versions: description: Versions of databases to test with. Should be array of strings encoded as JSON array type: string required: false - default: '["mysql:5.7", "mariadb"]' + default: '["mysql:5.7", "mysql:8.0.30", "mariadb"]' php_ini_values: description: PHP ini values @@ -44,23 +44,41 @@ jobs: matrix: php: ${{ fromJSON(inputs.php_versions) }} service: ${{ fromJSON(inputs.db_versions) }} - prefix: ['', flarum_] + prefix: [''] + # https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#jobsjob_idstrategymatrixinclude include: + # Expands the matrix by naming DBs. - service: 'mysql:5.7' - db: MySQL + db: MySQL 5.7 + - service: 'mysql:8.0.30' + db: MySQL 8.0 - service: mariadb db: MariaDB - - prefix: flarum_ + + # Include Database prefix tests with only one PHP version. + - php: ${{ fromJSON(inputs.php_versions)[0] }} + service: 'mysql:5.7' + db: MySQL 5.7 + prefix: flarum_ + prefixStr: (prefix) + - php: ${{ fromJSON(inputs.php_versions)[0] }} + service: 'mysql:8.0.30' + db: MySQL 8.0 + prefix: flarum_ + prefixStr: (prefix) + - php: ${{ fromJSON(inputs.php_versions)[0] }} + service: mariadb + db: MariaDB + prefix: flarum_ prefixStr: (prefix) + # To reduce number of actions, we exclude some PHP versions from running with some DB versions. exclude: - - php: 8.0 - service: 'mysql:5.7' - prefix: flarum_ - - php: 8.0 - service: mariadb - prefix: flarum_ + - php: ${{ fromJSON(inputs.php_versions)[1] }} + service: 'mysql:8.0.30' + - php: ${{ fromJSON(inputs.php_versions)[2] }} + service: 'mysql:8.0.30' services: mysql: