diff --git a/.github/workflows/compatibility-test.yml b/.github/workflows/compatibility-test.yml index 7d937f0..5802d53 100644 --- a/.github/workflows/compatibility-test.yml +++ b/.github/workflows/compatibility-test.yml @@ -232,6 +232,14 @@ jobs: steps: - uses: actions/checkout@v4 - uses: actions/setup-python@v5 + - name: Install mysql in macos + if: ${{ matrix.os == 'macos-14' }} + run: | + # https://github.com/Homebrew/homebrew-core/issues/130258 + brew install mysql-client + export PKG_CONFIG_PATH="/opt/homebrew/opt/mysql-client/lib/pkgconfig" + export MYSQLCLIENT_LDFLAGS=$(pkg-config --libs mysqlclient) + export MYSQLCLIENT_CFLAGS=$(pkg-config --cflags mysqlclient) - name: Run test on ${{ matrix.os }} run: | pip3 install mysqlclient --break-system-packages @@ -301,6 +309,14 @@ jobs: steps: - uses: actions/checkout@v4 - uses: actions/setup-python@v5 + - name: Install mysql in macos + if: ${{ matrix.os == 'macos-14' }} + run: | + # https://github.com/Homebrew/homebrew-core/issues/130258 + brew install mysql-client + export PKG_CONFIG_PATH="/opt/homebrew/opt/mysql-client/lib/pkgconfig" + export MYSQLCLIENT_LDFLAGS=$(pkg-config --libs mysqlclient) + export MYSQLCLIENT_CFLAGS=$(pkg-config --cflags mysqlclient) - name: Run test on ${{ matrix.os }} run: | pip3 install mysqlclient --break-system-packages @@ -411,7 +427,16 @@ jobs: with: ruby-version: '3.0' # Not needed with a .ruby-version file bundler-cache: true # runs 'bundle install' and caches installed gems automatically - - name: Run test on ${{ matrix.os }} + - name: Install mysql on macos + if: ${{ matrix.os == 'macos-14' }} + run: | + brew install mysql + cd example_code/ruby + # https://github.com/Homebrew/homebrew-core/issues/130258 + gem install mysql2 -- --with-mysql-dir=$(brew --prefix mysql) + ruby ConnectTest.rb ${{needs.setup.outputs.TIDB_CLOUD_HOST}} ${{needs.setup.outputs.TIDB_CLOUD_USER}} ${{ secrets.TIDB_CLOUD_PASSWORD }} + - name: Run test on ubuntu + if: ${{ matrix.os == 'ubuntu-24.04' }} run: | cd example_code/ruby gem install mysql2