From 2122a47ce09f59eabb42fc64e3db735cf6ab4537 Mon Sep 17 00:00:00 2001 From: Daniel Lockyer Date: Mon, 17 Jan 2022 11:05:09 +0000 Subject: [PATCH] Added MySQL 8 to CI tests refs https://github.com/TryGhost/Toolbox/issues/181 - we officially support MySQL 8 but we don't run tests for it -- oops - this commit adds MySQL 8 to the DB matrix in CI tests - I had to switch to a fork of the `mysql-action` repo so I could get the native authentication plugin working, but I expect to revert this once we've merged support for mysql2 --- .github/workflows/test.yml | 42 +++++++++++++++++++++++++++++--------- 1 file changed, 32 insertions(+), 10 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 8efd7e3b34..80f442c17f 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -40,15 +40,21 @@ jobs: if: github.event_name == 'push' || (github.event_name == 'pull_request' && !startsWith(github.head_ref, 'renovate/')) strategy: matrix: - DB: ['sqlite3', 'mysql'] + env: + - DB: sqlite3 + DB_CLIENT: sqlite3 + - DB: mysql5 + DB_CLIENT: mysql + - DB: mysql8 + DB_CLIENT: mysql env: - database__client: ${{ matrix.DB }} + database__client: ${{ matrix.env.DB_CLIENT }} database__connection__filename: /dev/shm/ghost-test.db database__connection__host: 127.0.0.1 database__connection__user: root database__connection__password: root database__connection__database: ghost_testing - name: Migrations - ${{ matrix.DB }} + name: Migrations - ${{ matrix.env.DB }} steps: - uses: actions/checkout@v2 with: @@ -63,15 +69,22 @@ jobs: - name: Shutdown MySQL run: sudo service mysql stop - if: matrix.DB == 'mysql' + if: matrix.env.DB == 'mysql5' || matrix.env.DB == 'mysql8' - - uses: mirromutth/mysql-action@v1.1 - if: matrix.DB == 'mysql' + - uses: daniellockyer/mysql-action@main + if: matrix.env.DB == 'mysql5' with: mysql version: '5.7' mysql database: 'ghost_testing' mysql root password: 'root' + - uses: daniellockyer/mysql-action@main + if: matrix.env.DB == 'mysql8' + with: + mysql version: '8.0' + mysql database: 'ghost_testing' + mysql root password: 'root' + - run: yarn - run: | node index.js & @@ -89,7 +102,9 @@ jobs: env: - DB: sqlite3 NODE_ENV: testing - - DB: mysql + - DB: mysql5 + NODE_ENV: testing-mysql + - DB: mysql8 NODE_ENV: testing-mysql env: DB: ${{ matrix.env.DB }} @@ -107,15 +122,22 @@ jobs: - name: Shutdown MySQL run: sudo service mysql stop - if: matrix.env.DB == 'mysql' + if: matrix.env.DB == 'mysql5' || matrix.env.DB == 'mysql8' - - uses: mirromutth/mysql-action@v1.1 - if: matrix.env.DB == 'mysql' + - uses: daniellockyer/mysql-action@main + if: matrix.env.DB == 'mysql5' with: mysql version: '5.7' mysql database: 'ghost_testing' mysql root password: 'root' + - uses: daniellockyer/mysql-action@main + if: matrix.env.DB == 'mysql8' + with: + mysql version: '8.0' + mysql database: 'ghost_testing' + mysql root password: 'root' + - run: yarn - run: date +%s > ${{ runner.temp }}/startTime # Get start time for test suite