diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 7edefac63..f137c3a79 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -3,7 +3,7 @@ on: [push, pull_request] jobs: build: name: >- - ${{ matrix.os }} ruby ${{ matrix.ruby }} ${{ matrix.db }} + ${{ matrix.os }} ruby ${{ matrix.ruby }} ${{ matrix.db }} ${{ matrix.db-client || '' }} # Run all the tests on the new environment as much as possible. # https://docs.github.com/en/free-pro-team@latest/actions/reference/specifications-for-github-hosted-runners runs-on: ${{ matrix.os }} @@ -26,6 +26,7 @@ jobs: - 2.2 - 2.1 db: [''] + db-client: [null] include: # Allow failure due to Mysql2::Error: Unknown system variable 'session_track_system_variables'. - {os: ubuntu-16.04, ruby: 2.4, db: mariadb10.0, allow-failure: true} @@ -36,6 +37,7 @@ jobs: - {os: ubuntu-18.04, ruby: 2.4, db: mysql57} # Allow failure due to the issue #1165. - {os: ubuntu-20.04, ruby: 2.4, db: mysql80, allow-failure: true} + - {os: ubuntu-20.04, ruby: 2.4, db: mysql80, db-client: mariadb, allow-failure: true} - {os: ubuntu-18.04, ruby: 'head', db: '', allow-failure: true} # db: A DB's brew package name in macOS case. # Set a name "db: 'name@X.Y'" when using an old version. @@ -60,6 +62,10 @@ jobs: - run: bundle install --without development - if: matrix.db != '' run: echo 'DB=${{ matrix.db }}' >> $GITHUB_ENV + - if: matrix.db-client != null + run: echo 'DB_CLIENT=${{ matrix.db-client }}' >> $GITHUB_ENV - run: sudo echo "127.0.0.1 mysql2gem.example.com" | sudo tee -a /etc/hosts - run: bash ci/setup.sh + - run: bundle exec rake compile + - run: ldd lib/mysql2/mysql2.so - run: bundle exec rake diff --git a/ci/mysql80.sh b/ci/mysql80.sh index b4921b1f8..a29ed60e8 100644 --- a/ci/mysql80.sh +++ b/ci/mysql80.sh @@ -10,4 +10,4 @@ apt-key add support/5072E1F5.asc wget -q --spider http://repo.mysql.com/apt/ubuntu/dists/$(lsb_release -cs)/mysql-8.0 add-apt-repository 'http://repo.mysql.com/apt/ubuntu mysql-8.0' apt-get update -qq -apt-get install -qq mysql-server libmysqlclient-dev +apt-get install -qq mysql-server diff --git a/ci/setup.sh b/ci/setup.sh index 97e89818a..32f185241 100644 --- a/ci/setup.sh +++ b/ci/setup.sh @@ -9,6 +9,8 @@ CHANGED_PASSWORD=false # https://stackoverflow.com/questions/56052177/ CHANGED_PASSWORD_BY_RECREATE=false +echo "DB: ${DB-}, DB_CLIENT: ${DB_CLIENT-}" + # Install the default used DB if DB is not set. if [[ -n ${GITHUB_ACTIONS-} && -z ${DB-} ]]; then if command -v lsb_release > /dev/null; then @@ -41,6 +43,12 @@ fi # Install MySQL 8.0 if DB=mysql80 if [[ -n ${DB-} && x$DB =~ ^xmysql80 ]]; then sudo bash ci/mysql80.sh + if [[ -n ${DB_CLIENT-} && x$DB_CLIENT =~ ^xmariadb ]]; then + sudo apt-get install -qq libmariadb-dev-compat + else + sudo apt-get install -qq libmysqlclient-dev + fi + CHANGED_PASSWORD=true fi