From 47bbab97a5aa0585645b7d81e74417faca0b46b8 Mon Sep 17 00:00:00 2001 From: shiyuhang <1136742008@qq.com> Date: Mon, 12 Jun 2023 17:16:06 +0800 Subject: [PATCH 1/8] fix python tls --- .github/workflows/connect-test.yml | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/.github/workflows/connect-test.yml b/.github/workflows/connect-test.yml index 723254b..09409a7 100644 --- a/.github/workflows/connect-test.yml +++ b/.github/workflows/connect-test.yml @@ -12,13 +12,13 @@ jobs: steps: - name: Checkout uses: actions/checkout@v3 - + - name: Set up ticloud uses: tidbcloud/setup-tidbcloud-cli@v0 with: api_public_key: ${{ secrets.TLS_PUBLIC_KEY }} api_private_key: ${{ secrets.TLS_PRIVATE_KEY }} - + - name: Get Connection Info run: | # delete cluster if exists @@ -210,6 +210,7 @@ jobs: export PATH=$PATH:/usr/local/mysql/bin - name: Run test on ${{ matrix.os }} run: | + pip3 install -U wheel pip3 install mysqlclient cd example_code/python python3 ConnectTest_mysqlclient.py ${{needs.setup.outputs.TIDB_CLOUD_HOST}} ${{needs.setup.outputs.TIDB_CLOUD_USER}} ${{ secrets.TIDB_CLOUD_PASSWORD }} ${{ matrix.cert }} @@ -289,6 +290,7 @@ jobs: brew install mysql - name: Run test on ${{ matrix.os }} run: | + pip3 install -U wheel pip3 install mysqlclient pip3 install sqlalchemy cd example_code/sqlalchemy From c6da75fe8a62deb0ed3d7455380dfd2dfe591c8a Mon Sep 17 00:00:00 2001 From: shiyuhang <1136742008@qq.com> Date: Mon, 12 Jun 2023 17:35:21 +0800 Subject: [PATCH 2/8] fix python tls --- .github/workflows/connect-test.yml | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/.github/workflows/connect-test.yml b/.github/workflows/connect-test.yml index 09409a7..2bafc5d 100644 --- a/.github/workflows/connect-test.yml +++ b/.github/workflows/connect-test.yml @@ -210,7 +210,7 @@ jobs: export PATH=$PATH:/usr/local/mysql/bin - name: Run test on ${{ matrix.os }} run: | - pip3 install -U wheel + xcode-select --install pip3 install mysqlclient cd example_code/python python3 ConnectTest_mysqlclient.py ${{needs.setup.outputs.TIDB_CLOUD_HOST}} ${{needs.setup.outputs.TIDB_CLOUD_USER}} ${{ secrets.TIDB_CLOUD_PASSWORD }} ${{ matrix.cert }} @@ -290,7 +290,7 @@ jobs: brew install mysql - name: Run test on ${{ matrix.os }} run: | - pip3 install -U wheel + xcode-select --install pip3 install mysqlclient pip3 install sqlalchemy cd example_code/sqlalchemy @@ -402,6 +402,7 @@ jobs: - name: Install mysql on macos if: ${{ matrix.os == 'macos-latest' }} run: | + xcode-select --install brew install mysql cd example_code/ruby gem install mysql2 From 4384907cb8b934f983a222b3d595b794306bc401 Mon Sep 17 00:00:00 2001 From: shiyuhang <1136742008@qq.com> Date: Mon, 12 Jun 2023 17:50:07 +0800 Subject: [PATCH 3/8] fix python tls --- .github/workflows/connect-test.yml | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/.github/workflows/connect-test.yml b/.github/workflows/connect-test.yml index 2bafc5d..da6c574 100644 --- a/.github/workflows/connect-test.yml +++ b/.github/workflows/connect-test.yml @@ -210,7 +210,8 @@ jobs: export PATH=$PATH:/usr/local/mysql/bin - name: Run test on ${{ matrix.os }} run: | - xcode-select --install + export MYSQLCLIENT_LDFLAGS=$(pkg-config --libs mysqlclient) + export MYSQLCLIENT_CFLAGS=$(pkg-config --cflags mysqlclient) pip3 install mysqlclient cd example_code/python python3 ConnectTest_mysqlclient.py ${{needs.setup.outputs.TIDB_CLOUD_HOST}} ${{needs.setup.outputs.TIDB_CLOUD_USER}} ${{ secrets.TIDB_CLOUD_PASSWORD }} ${{ matrix.cert }} @@ -290,7 +291,8 @@ jobs: brew install mysql - name: Run test on ${{ matrix.os }} run: | - xcode-select --install + export MYSQLCLIENT_LDFLAGS=$(pkg-config --libs mysqlclient) + export MYSQLCLIENT_CFLAGS=$(pkg-config --cflags mysqlclient) pip3 install mysqlclient pip3 install sqlalchemy cd example_code/sqlalchemy @@ -402,10 +404,9 @@ jobs: - name: Install mysql on macos if: ${{ matrix.os == 'macos-latest' }} run: | - xcode-select --install brew install mysql cd example_code/ruby - gem install mysql2 + 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-latest' }} From 6a3d974c0fdeeef72f0512d8ad716339a8315058 Mon Sep 17 00:00:00 2001 From: shiyuhang <1136742008@qq.com> Date: Mon, 12 Jun 2023 17:54:08 +0800 Subject: [PATCH 4/8] fix python tls --- .github/workflows/connect-test.yml | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/.github/workflows/connect-test.yml b/.github/workflows/connect-test.yml index da6c574..6fea45b 100644 --- a/.github/workflows/connect-test.yml +++ b/.github/workflows/connect-test.yml @@ -210,8 +210,7 @@ jobs: export PATH=$PATH:/usr/local/mysql/bin - name: Run test on ${{ matrix.os }} run: | - export MYSQLCLIENT_LDFLAGS=$(pkg-config --libs mysqlclient) - export MYSQLCLIENT_CFLAGS=$(pkg-config --cflags mysqlclient) + ln -sv $(brew --prefix zlib)/lib/libz.dylib $(brew --prefix)/lib/libzlib.dylib pip3 install mysqlclient cd example_code/python python3 ConnectTest_mysqlclient.py ${{needs.setup.outputs.TIDB_CLOUD_HOST}} ${{needs.setup.outputs.TIDB_CLOUD_USER}} ${{ secrets.TIDB_CLOUD_PASSWORD }} ${{ matrix.cert }} @@ -291,8 +290,7 @@ jobs: brew install mysql - name: Run test on ${{ matrix.os }} run: | - export MYSQLCLIENT_LDFLAGS=$(pkg-config --libs mysqlclient) - export MYSQLCLIENT_CFLAGS=$(pkg-config --cflags mysqlclient) + ln -sv $(brew --prefix zlib)/lib/libz.dylib $(brew --prefix)/lib/libzlib.dylib pip3 install mysqlclient pip3 install sqlalchemy cd example_code/sqlalchemy From dbe34630f2b4eb4022205c9849e19aff37c0a734 Mon Sep 17 00:00:00 2001 From: shiyuhang <1136742008@qq.com> Date: Mon, 12 Jun 2023 17:58:25 +0800 Subject: [PATCH 5/8] fix python tls --- .github/workflows/connect-test.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/connect-test.yml b/.github/workflows/connect-test.yml index 6fea45b..a66e1f0 100644 --- a/.github/workflows/connect-test.yml +++ b/.github/workflows/connect-test.yml @@ -206,11 +206,11 @@ jobs: - name: Install mysql in macos if: ${{ matrix.os == 'macos-latest' }} run: | + ln -sv $(brew --prefix zlib)/lib/libz.dylib $(brew --prefix)/lib/libzlib.dylib brew install mysql export PATH=$PATH:/usr/local/mysql/bin - name: Run test on ${{ matrix.os }} run: | - ln -sv $(brew --prefix zlib)/lib/libz.dylib $(brew --prefix)/lib/libzlib.dylib pip3 install mysqlclient cd example_code/python python3 ConnectTest_mysqlclient.py ${{needs.setup.outputs.TIDB_CLOUD_HOST}} ${{needs.setup.outputs.TIDB_CLOUD_USER}} ${{ secrets.TIDB_CLOUD_PASSWORD }} ${{ matrix.cert }} @@ -287,10 +287,10 @@ jobs: - name: Install mysql in macos if: ${{ matrix.os == 'macos-latest' }} run: | + ln -sv $(brew --prefix zlib)/lib/libz.dylib $(brew --prefix)/lib/libzlib.dylib brew install mysql - name: Run test on ${{ matrix.os }} run: | - ln -sv $(brew --prefix zlib)/lib/libz.dylib $(brew --prefix)/lib/libzlib.dylib pip3 install mysqlclient pip3 install sqlalchemy cd example_code/sqlalchemy From 2e58987173ab691606485fb76a2257ba6b19d517 Mon Sep 17 00:00:00 2001 From: shiyuhang <1136742008@qq.com> Date: Mon, 12 Jun 2023 18:08:17 +0800 Subject: [PATCH 6/8] test ruby --- .github/workflows/connect-test.yml | 802 ++++++++++++++--------------- 1 file changed, 401 insertions(+), 401 deletions(-) diff --git a/.github/workflows/connect-test.yml b/.github/workflows/connect-test.yml index a66e1f0..f34c8ce 100644 --- a/.github/workflows/connect-test.yml +++ b/.github/workflows/connect-test.yml @@ -38,353 +38,353 @@ jobs: TiDB_CLOUD_USER: ${{ env.TIDB_CLOUD_USER }} TiDB_CLOUD_HOST: ${{ env.TIDB_CLOUD_HOST }} - mysql: - needs: setup - strategy: - matrix: - os: [ ubuntu-latest, windows-latest, macos-latest ] - include: - - os: ubuntu-latest - cert: /etc/ssl/certs/ca-certificates.crt - - os: macos-latest - cert: /etc/ssl/cert.pem - - os: windows-latest - cert: ./example_code/x1.pem - runs-on: ${{ matrix.os }} - timeout-minutes: 5 - steps: - - name: Checkout - uses: actions/checkout@v3 - - - name: Get mysql - uses: shogo82148/actions-setup-mysql@v1 - - - name: Run test on ${{ matrix.os }} - run: mysql -u ${{needs.setup.outputs.TIDB_CLOUD_USER}} -h ${{needs.setup.outputs.TIDB_CLOUD_HOST}} -P 4000 -D test --ssl-mode=VERIFY_IDENTITY --ssl-ca=${{ matrix.cert }} -p${{ secrets.TIDB_CLOUD_PASSWORD }} - - no_tls: - needs: setup - runs-on: ubuntu-latest - steps: - - name: Checkout - uses: actions/checkout@v3 - - - name: Get mysql - uses: shogo82148/actions-setup-mysql@v1 - - - name: Run test - run: "! mysql -u ${{needs.setup.outputs.TIDB_CLOUD_USER}} -h ${{needs.setup.outputs.TIDB_CLOUD_HOST}} -P 4000 -D test --ssl-mode=DISABLED -p${{ secrets.TIDB_CLOUD_PASSWORD }}" - - invalid_tls_version: - needs: setup - runs-on: ubuntu-latest - strategy: - matrix: - tls: [ TLSv1, TLSv1.1 ] - steps: - - uses: actions/checkout@v3 - - uses: actions/setup-python@v4 - with: - python-version: '3.10' - - - name: Run test on ${{ matrix.tls }} - run: | - # Starting from 8.0.26, TLSv1 & TLSv1.1 are deprecated. From 8.0.28, they are completely removed. - pip3 install mysql-connector-python==8.0.25 - cd example_code/python - ! python3 tls_version.py ${{needs.setup.outputs.TIDB_CLOUD_HOST}} ${{needs.setup.outputs.TIDB_CLOUD_USER}} ${{secrets.TIDB_CLOUD_PASSWORD}} /etc/ssl/certs/ca-certificates.crt ${{ matrix.tls }} - - valid_tls_version: - needs: setup - runs-on: ubuntu-latest - strategy: - matrix: - tls: [ TLSv1.2, TLSv1.3 ] - steps: - - uses: actions/checkout@v3 - - uses: actions/setup-python@v4 - with: - python-version: '3.10' - - - name: Run test on ${{ matrix.tls }} - run: | - pip3 install mysql-connector-python - cd example_code/python - python3 tls_version.py ${{needs.setup.outputs.TIDB_CLOUD_HOST}} ${{needs.setup.outputs.TIDB_CLOUD_USER}} ${{secrets.TIDB_CLOUD_PASSWORD}} /etc/ssl/certs/ca-certificates.crt ${{ matrix.tls }} - - mycli: - needs: setup - strategy: - matrix: - os: [ ubuntu-latest, windows-latest, macos-latest ] - include: - - os: ubuntu-latest - cert: /etc/ssl/certs/ca-certificates.crt - - os: macos-latest - cert: /etc/ssl/cert.pem - - os: windows-latest - cert: ./example_code/x1.pem - runs-on: ${{ matrix.os }} - timeout-minutes: 5 - steps: - - name: Checkout - uses: actions/checkout@v3 - - - name: Install python - uses: actions/setup-python@v3 - - - name: Install mycli - run: pip3 install mycli - - - name: Run test on ${{ matrix.os }} - run: - mycli -u ${{needs.setup.outputs.TIDB_CLOUD_USER}} -h ${{needs.setup.outputs.TIDB_CLOUD_HOST}} -P 4000 -D test --ssl-ca=${{ matrix.cert }} --ssl-verify-server-cert -p${{ secrets.TIDB_CLOUD_PASSWORD}} - - java_jdbc: - needs: setup - strategy: - matrix: - os: [ ubuntu-latest, windows-latest, macos-latest ] - runs-on: ${{ matrix.os }} - timeout-minutes: 5 - steps: - - uses: actions/checkout@v3 - - uses: actions/setup-java@v3 - with: - distribution: 'adopt' - java-version: '8' - - name: Run test on ubuntu or macos - if: ${{ matrix.os != 'windows-latest' }} - run: | - cd example_code/java - javac ConnectTest.java - java -cp mysql-connector-j-8.0.31.jar: ConnectTest ${{needs.setup.outputs.TIDB_CLOUD_USER}} ${{needs.setup.outputs.TIDB_CLOUD_HOST}} ${{ secrets.TIDB_CLOUD_PASSWORD }} - - - name: Run test on windows - if: ${{ matrix.os == 'windows-latest' }} - # Need to use Chinese semicolon and an extra space before ConnectTest (don't know why) - run: | - cd example_code/java - javac ConnectTest.java - java -cp mysql-connector-j-8.0.31.jar; ConnectTest ${{needs.setup.outputs.TIDB_CLOUD_USER}} ${{needs.setup.outputs.TIDB_CLOUD_HOST}} ${{ secrets.TIDB_CLOUD_PASSWORD }} - - # https://jira.mariadb.org/browse/CONJ-1023 - java_jdbc_mariadb_CONJ-1023: - needs: setup - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v3 - - uses: actions/setup-java@v3 - with: - distribution: 'adopt' - java-version: '8' - - name: Run test - run: | - cd example_code/java - javac ConnectTestMariaDB.java - java -cp mariadb-java-client-3.0.9.jar: ConnectTestMariaDB ${{needs.setup.outputs.TIDB_CLOUD_USER}} ${{needs.setup.outputs.TIDB_CLOUD_HOST}} ${{ secrets.TIDB_CLOUD_PASSWORD }} - - python_mysqlclient: - needs: setup - strategy: - matrix: - os: [ ubuntu-latest, windows-latest, macos-latest ] - include: - - os: ubuntu-latest - cert: /etc/ssl/certs/ca-certificates.crt - - os: macos-latest - cert: /etc/ssl/cert.pem - - os: windows-latest - cert: ../x1.pem - runs-on: ${{ matrix.os }} - timeout-minutes: 5 - steps: - - uses: actions/checkout@v3 - - uses: actions/setup-python@v4 - with: - python-version: '3.10' - - name: Install mysql in macos - if: ${{ matrix.os == 'macos-latest' }} - run: | - ln -sv $(brew --prefix zlib)/lib/libz.dylib $(brew --prefix)/lib/libzlib.dylib - brew install mysql - export PATH=$PATH:/usr/local/mysql/bin - - name: Run test on ${{ matrix.os }} - run: | - pip3 install mysqlclient - cd example_code/python - python3 ConnectTest_mysqlclient.py ${{needs.setup.outputs.TIDB_CLOUD_HOST}} ${{needs.setup.outputs.TIDB_CLOUD_USER}} ${{ secrets.TIDB_CLOUD_PASSWORD }} ${{ matrix.cert }} - - python_mysql_connector: - needs: setup - strategy: - matrix: - os: [ ubuntu-latest, windows-latest, macos-latest ] - include: - - os: ubuntu-latest - cert: /etc/ssl/certs/ca-certificates.crt - - os: macos-latest - cert: /etc/ssl/cert.pem - - os: windows-latest - cert: ../x1.pem - runs-on: ${{ matrix.os }} - timeout-minutes: 5 - steps: - - uses: actions/checkout@v3 - - uses: actions/setup-python@v4 - with: - python-version: '3.10' - - name: Run test on ${{ matrix.os }} - run: | - pip3 install mysql-connector-python - cd example_code/python - python3 ConnectTest_mysql-connector-python.py ${{needs.setup.outputs.TIDB_CLOUD_HOST}} ${{needs.setup.outputs.TIDB_CLOUD_USER}} ${{ secrets.TIDB_CLOUD_PASSWORD }} ${{ matrix.cert }} - - python_pymysql: - needs: setup - strategy: - matrix: - os: [ ubuntu-latest, windows-latest, macos-latest ] - include: - - os: ubuntu-latest - cert: /etc/ssl/certs/ca-certificates.crt - - os: macos-latest - cert: /etc/ssl/cert.pem - - os: windows-latest - cert: ../x1.pem - runs-on: ${{ matrix.os }} - timeout-minutes: 5 - steps: - - uses: actions/checkout@v3 - - uses: actions/setup-python@v4 - with: - python-version: '3.10' - - name: Run test on ${{ matrix.os }} - run: | - pip3 install pymysql - cd example_code/python - python3 ConnectTest_pymysql.py ${{needs.setup.outputs.TIDB_CLOUD_HOST}} ${{needs.setup.outputs.TIDB_CLOUD_USER}} ${{ secrets.TIDB_CLOUD_PASSWORD }} ${{ matrix.cert }} - - python_sqlalchemy: - needs: setup - strategy: - matrix: - os: [ ubuntu-latest, windows-latest, macos-latest ] - include: - - os: ubuntu-latest - cert: /etc/ssl/certs/ca-certificates.crt - - os: macos-latest - cert: /etc/ssl/cert.pem - - os: windows-latest - cert: ../x1.pem - runs-on: ${{ matrix.os }} - timeout-minutes: 5 - steps: - - uses: actions/checkout@v3 - - uses: actions/setup-python@v4 - with: - python-version: '3.10' - - name: Install mysql in macos - if: ${{ matrix.os == 'macos-latest' }} - run: | - ln -sv $(brew --prefix zlib)/lib/libz.dylib $(brew --prefix)/lib/libzlib.dylib - brew install mysql - - name: Run test on ${{ matrix.os }} - run: | - pip3 install mysqlclient - pip3 install sqlalchemy - cd example_code/sqlalchemy - python3 ConnectTest.py ${{needs.setup.outputs.TIDB_CLOUD_HOST}} ${{needs.setup.outputs.TIDB_CLOUD_USER}} ${{ secrets.TIDB_CLOUD_PASSWORD }} ${{ matrix.cert }} - - go_godriver: - needs: setup - strategy: - matrix: - os: [ ubuntu-latest, windows-latest, macos-latest ] - runs-on: ${{ matrix.os }} - timeout-minutes: 5 - steps: - - uses: actions/checkout@v3 - - uses: actions/setup-go@v3 - with: - go-version: '1.17.0' - - name: Run test on ${{ matrix.os }} - run: | - cd example_code/go - go mod tidy - go run ConnectTest.go ${{needs.setup.outputs.TIDB_CLOUD_HOST}} ${{needs.setup.outputs.TIDB_CLOUD_USER}} ${{ secrets.TIDB_CLOUD_PASSWORD }} - - go_gorm: - needs: setup - strategy: - matrix: - os: [ ubuntu-latest, windows-latest, macos-latest ] - runs-on: ${{ matrix.os }} - timeout-minutes: 5 - steps: - - uses: actions/checkout@v3 - - uses: actions/setup-go@v3 - with: - go-version: '1.17.0' - - name: Run test on ${{ matrix.os }} - run: | - cd example_code/gorm - go mod tidy - go run ConnectTest.go ${{needs.setup.outputs.TIDB_CLOUD_HOST}} ${{needs.setup.outputs.TIDB_CLOUD_USER}} ${{ secrets.TIDB_CLOUD_PASSWORD }} - - node_mysql2: - needs: setup - strategy: - matrix: - os: [ ubuntu-latest, windows-latest, macos-latest ] - runs-on: ${{ matrix.os }} - timeout-minutes: 5 - steps: - - uses: actions/checkout@v3 - - uses: actions/setup-node@v3 - with: - node-version: 16 - - name: Run test on ${{ matrix.os }} - run: | - cd example_code/node - npm install --save mysql2 - node ConnectTest.js ${{needs.setup.outputs.TIDB_CLOUD_HOST}} ${{needs.setup.outputs.TIDB_CLOUD_USER}} ${{ secrets.TIDB_CLOUD_PASSWORD }} - - node_sequelize: - needs: setup - strategy: - matrix: - os: [ ubuntu-latest, windows-latest, macos-latest ] - runs-on: ${{ matrix.os }} - timeout-minutes: 5 - steps: - - uses: actions/checkout@v3 - - uses: actions/setup-node@v3 - with: - node-version: 16 - - name: Run test on ${{ matrix.os }} - run: | - cd example_code/sequelize - npm install --save mysql2 - npm install --save sequelize - node ConnectTest.js ${{needs.setup.outputs.TIDB_CLOUD_HOST}} ${{needs.setup.outputs.TIDB_CLOUD_USER}} ${{ secrets.TIDB_CLOUD_PASSWORD }} - - rust_mysql: - needs: setup - strategy: - matrix: - os: [ ubuntu-latest, windows-latest, macos-latest ] - runs-on: ${{ matrix.os }} - timeout-minutes: 15 - steps: - - uses: actions/checkout@v3 - - uses: ATiltedTree/setup-rust@v1 - with: - rust-version: stable - - name: Run test on ${{ matrix.os }} - run: | - cd example_code/rust - cargo run ${{needs.setup.outputs.TIDB_CLOUD_HOST}} ${{needs.setup.outputs.TIDB_CLOUD_USER}} ${{ secrets.TIDB_CLOUD_PASSWORD }} +# mysql: +# needs: setup +# strategy: +# matrix: +# os: [ ubuntu-latest, windows-latest, macos-latest ] +# include: +# - os: ubuntu-latest +# cert: /etc/ssl/certs/ca-certificates.crt +# - os: macos-latest +# cert: /etc/ssl/cert.pem +# - os: windows-latest +# cert: ./example_code/x1.pem +# runs-on: ${{ matrix.os }} +# timeout-minutes: 5 +# steps: +# - name: Checkout +# uses: actions/checkout@v3 +# +# - name: Get mysql +# uses: shogo82148/actions-setup-mysql@v1 +# +# - name: Run test on ${{ matrix.os }} +# run: mysql -u ${{needs.setup.outputs.TIDB_CLOUD_USER}} -h ${{needs.setup.outputs.TIDB_CLOUD_HOST}} -P 4000 -D test --ssl-mode=VERIFY_IDENTITY --ssl-ca=${{ matrix.cert }} -p${{ secrets.TIDB_CLOUD_PASSWORD }} +# +# no_tls: +# needs: setup +# runs-on: ubuntu-latest +# steps: +# - name: Checkout +# uses: actions/checkout@v3 +# +# - name: Get mysql +# uses: shogo82148/actions-setup-mysql@v1 +# +# - name: Run test +# run: "! mysql -u ${{needs.setup.outputs.TIDB_CLOUD_USER}} -h ${{needs.setup.outputs.TIDB_CLOUD_HOST}} -P 4000 -D test --ssl-mode=DISABLED -p${{ secrets.TIDB_CLOUD_PASSWORD }}" +# +# invalid_tls_version: +# needs: setup +# runs-on: ubuntu-latest +# strategy: +# matrix: +# tls: [ TLSv1, TLSv1.1 ] +# steps: +# - uses: actions/checkout@v3 +# - uses: actions/setup-python@v4 +# with: +# python-version: '3.10' +# +# - name: Run test on ${{ matrix.tls }} +# run: | +# # Starting from 8.0.26, TLSv1 & TLSv1.1 are deprecated. From 8.0.28, they are completely removed. +# pip3 install mysql-connector-python==8.0.25 +# cd example_code/python +# ! python3 tls_version.py ${{needs.setup.outputs.TIDB_CLOUD_HOST}} ${{needs.setup.outputs.TIDB_CLOUD_USER}} ${{secrets.TIDB_CLOUD_PASSWORD}} /etc/ssl/certs/ca-certificates.crt ${{ matrix.tls }} +# +# valid_tls_version: +# needs: setup +# runs-on: ubuntu-latest +# strategy: +# matrix: +# tls: [ TLSv1.2, TLSv1.3 ] +# steps: +# - uses: actions/checkout@v3 +# - uses: actions/setup-python@v4 +# with: +# python-version: '3.10' +# +# - name: Run test on ${{ matrix.tls }} +# run: | +# pip3 install mysql-connector-python +# cd example_code/python +# python3 tls_version.py ${{needs.setup.outputs.TIDB_CLOUD_HOST}} ${{needs.setup.outputs.TIDB_CLOUD_USER}} ${{secrets.TIDB_CLOUD_PASSWORD}} /etc/ssl/certs/ca-certificates.crt ${{ matrix.tls }} +# +# mycli: +# needs: setup +# strategy: +# matrix: +# os: [ ubuntu-latest, windows-latest, macos-latest ] +# include: +# - os: ubuntu-latest +# cert: /etc/ssl/certs/ca-certificates.crt +# - os: macos-latest +# cert: /etc/ssl/cert.pem +# - os: windows-latest +# cert: ./example_code/x1.pem +# runs-on: ${{ matrix.os }} +# timeout-minutes: 5 +# steps: +# - name: Checkout +# uses: actions/checkout@v3 +# +# - name: Install python +# uses: actions/setup-python@v3 +# +# - name: Install mycli +# run: pip3 install mycli +# +# - name: Run test on ${{ matrix.os }} +# run: +# mycli -u ${{needs.setup.outputs.TIDB_CLOUD_USER}} -h ${{needs.setup.outputs.TIDB_CLOUD_HOST}} -P 4000 -D test --ssl-ca=${{ matrix.cert }} --ssl-verify-server-cert -p${{ secrets.TIDB_CLOUD_PASSWORD}} +# +# java_jdbc: +# needs: setup +# strategy: +# matrix: +# os: [ ubuntu-latest, windows-latest, macos-latest ] +# runs-on: ${{ matrix.os }} +# timeout-minutes: 5 +# steps: +# - uses: actions/checkout@v3 +# - uses: actions/setup-java@v3 +# with: +# distribution: 'adopt' +# java-version: '8' +# - name: Run test on ubuntu or macos +# if: ${{ matrix.os != 'windows-latest' }} +# run: | +# cd example_code/java +# javac ConnectTest.java +# java -cp mysql-connector-j-8.0.31.jar: ConnectTest ${{needs.setup.outputs.TIDB_CLOUD_USER}} ${{needs.setup.outputs.TIDB_CLOUD_HOST}} ${{ secrets.TIDB_CLOUD_PASSWORD }} +# +# - name: Run test on windows +# if: ${{ matrix.os == 'windows-latest' }} +# # Need to use Chinese semicolon and an extra space before ConnectTest (don't know why) +# run: | +# cd example_code/java +# javac ConnectTest.java +# java -cp mysql-connector-j-8.0.31.jar; ConnectTest ${{needs.setup.outputs.TIDB_CLOUD_USER}} ${{needs.setup.outputs.TIDB_CLOUD_HOST}} ${{ secrets.TIDB_CLOUD_PASSWORD }} +# +# # https://jira.mariadb.org/browse/CONJ-1023 +# java_jdbc_mariadb_CONJ-1023: +# needs: setup +# runs-on: ubuntu-latest +# steps: +# - uses: actions/checkout@v3 +# - uses: actions/setup-java@v3 +# with: +# distribution: 'adopt' +# java-version: '8' +# - name: Run test +# run: | +# cd example_code/java +# javac ConnectTestMariaDB.java +# java -cp mariadb-java-client-3.0.9.jar: ConnectTestMariaDB ${{needs.setup.outputs.TIDB_CLOUD_USER}} ${{needs.setup.outputs.TIDB_CLOUD_HOST}} ${{ secrets.TIDB_CLOUD_PASSWORD }} +# +# python_mysqlclient: +# needs: setup +# strategy: +# matrix: +# os: [ ubuntu-latest, windows-latest, macos-latest ] +# include: +# - os: ubuntu-latest +# cert: /etc/ssl/certs/ca-certificates.crt +# - os: macos-latest +# cert: /etc/ssl/cert.pem +# - os: windows-latest +# cert: ../x1.pem +# runs-on: ${{ matrix.os }} +# timeout-minutes: 5 +# steps: +# - uses: actions/checkout@v3 +# - uses: actions/setup-python@v4 +# with: +# python-version: '3.10' +# - name: Install mysql in macos +# if: ${{ matrix.os == 'macos-latest' }} +# run: | +# ln -sv $(brew --prefix zlib)/lib/libz.dylib $(brew --prefix)/lib/libzlib.dylib +# brew install mysql +# export PATH=$PATH:/usr/local/mysql/bin +# - name: Run test on ${{ matrix.os }} +# run: | +# pip3 install mysqlclient +# cd example_code/python +# python3 ConnectTest_mysqlclient.py ${{needs.setup.outputs.TIDB_CLOUD_HOST}} ${{needs.setup.outputs.TIDB_CLOUD_USER}} ${{ secrets.TIDB_CLOUD_PASSWORD }} ${{ matrix.cert }} +# +# python_mysql_connector: +# needs: setup +# strategy: +# matrix: +# os: [ ubuntu-latest, windows-latest, macos-latest ] +# include: +# - os: ubuntu-latest +# cert: /etc/ssl/certs/ca-certificates.crt +# - os: macos-latest +# cert: /etc/ssl/cert.pem +# - os: windows-latest +# cert: ../x1.pem +# runs-on: ${{ matrix.os }} +# timeout-minutes: 5 +# steps: +# - uses: actions/checkout@v3 +# - uses: actions/setup-python@v4 +# with: +# python-version: '3.10' +# - name: Run test on ${{ matrix.os }} +# run: | +# pip3 install mysql-connector-python +# cd example_code/python +# python3 ConnectTest_mysql-connector-python.py ${{needs.setup.outputs.TIDB_CLOUD_HOST}} ${{needs.setup.outputs.TIDB_CLOUD_USER}} ${{ secrets.TIDB_CLOUD_PASSWORD }} ${{ matrix.cert }} +# +# python_pymysql: +# needs: setup +# strategy: +# matrix: +# os: [ ubuntu-latest, windows-latest, macos-latest ] +# include: +# - os: ubuntu-latest +# cert: /etc/ssl/certs/ca-certificates.crt +# - os: macos-latest +# cert: /etc/ssl/cert.pem +# - os: windows-latest +# cert: ../x1.pem +# runs-on: ${{ matrix.os }} +# timeout-minutes: 5 +# steps: +# - uses: actions/checkout@v3 +# - uses: actions/setup-python@v4 +# with: +# python-version: '3.10' +# - name: Run test on ${{ matrix.os }} +# run: | +# pip3 install pymysql +# cd example_code/python +# python3 ConnectTest_pymysql.py ${{needs.setup.outputs.TIDB_CLOUD_HOST}} ${{needs.setup.outputs.TIDB_CLOUD_USER}} ${{ secrets.TIDB_CLOUD_PASSWORD }} ${{ matrix.cert }} +# +# python_sqlalchemy: +# needs: setup +# strategy: +# matrix: +# os: [ ubuntu-latest, windows-latest, macos-latest ] +# include: +# - os: ubuntu-latest +# cert: /etc/ssl/certs/ca-certificates.crt +# - os: macos-latest +# cert: /etc/ssl/cert.pem +# - os: windows-latest +# cert: ../x1.pem +# runs-on: ${{ matrix.os }} +# timeout-minutes: 5 +# steps: +# - uses: actions/checkout@v3 +# - uses: actions/setup-python@v4 +# with: +# python-version: '3.10' +# - name: Install mysql in macos +# if: ${{ matrix.os == 'macos-latest' }} +# run: | +# ln -sv $(brew --prefix zlib)/lib/libz.dylib $(brew --prefix)/lib/libzlib.dylib +# brew install mysql +# - name: Run test on ${{ matrix.os }} +# run: | +# pip3 install mysqlclient +# pip3 install sqlalchemy +# cd example_code/sqlalchemy +# python3 ConnectTest.py ${{needs.setup.outputs.TIDB_CLOUD_HOST}} ${{needs.setup.outputs.TIDB_CLOUD_USER}} ${{ secrets.TIDB_CLOUD_PASSWORD }} ${{ matrix.cert }} +# +# go_godriver: +# needs: setup +# strategy: +# matrix: +# os: [ ubuntu-latest, windows-latest, macos-latest ] +# runs-on: ${{ matrix.os }} +# timeout-minutes: 5 +# steps: +# - uses: actions/checkout@v3 +# - uses: actions/setup-go@v3 +# with: +# go-version: '1.17.0' +# - name: Run test on ${{ matrix.os }} +# run: | +# cd example_code/go +# go mod tidy +# go run ConnectTest.go ${{needs.setup.outputs.TIDB_CLOUD_HOST}} ${{needs.setup.outputs.TIDB_CLOUD_USER}} ${{ secrets.TIDB_CLOUD_PASSWORD }} +# +# go_gorm: +# needs: setup +# strategy: +# matrix: +# os: [ ubuntu-latest, windows-latest, macos-latest ] +# runs-on: ${{ matrix.os }} +# timeout-minutes: 5 +# steps: +# - uses: actions/checkout@v3 +# - uses: actions/setup-go@v3 +# with: +# go-version: '1.17.0' +# - name: Run test on ${{ matrix.os }} +# run: | +# cd example_code/gorm +# go mod tidy +# go run ConnectTest.go ${{needs.setup.outputs.TIDB_CLOUD_HOST}} ${{needs.setup.outputs.TIDB_CLOUD_USER}} ${{ secrets.TIDB_CLOUD_PASSWORD }} +# +# node_mysql2: +# needs: setup +# strategy: +# matrix: +# os: [ ubuntu-latest, windows-latest, macos-latest ] +# runs-on: ${{ matrix.os }} +# timeout-minutes: 5 +# steps: +# - uses: actions/checkout@v3 +# - uses: actions/setup-node@v3 +# with: +# node-version: 16 +# - name: Run test on ${{ matrix.os }} +# run: | +# cd example_code/node +# npm install --save mysql2 +# node ConnectTest.js ${{needs.setup.outputs.TIDB_CLOUD_HOST}} ${{needs.setup.outputs.TIDB_CLOUD_USER}} ${{ secrets.TIDB_CLOUD_PASSWORD }} +# +# node_sequelize: +# needs: setup +# strategy: +# matrix: +# os: [ ubuntu-latest, windows-latest, macos-latest ] +# runs-on: ${{ matrix.os }} +# timeout-minutes: 5 +# steps: +# - uses: actions/checkout@v3 +# - uses: actions/setup-node@v3 +# with: +# node-version: 16 +# - name: Run test on ${{ matrix.os }} +# run: | +# cd example_code/sequelize +# npm install --save mysql2 +# npm install --save sequelize +# node ConnectTest.js ${{needs.setup.outputs.TIDB_CLOUD_HOST}} ${{needs.setup.outputs.TIDB_CLOUD_USER}} ${{ secrets.TIDB_CLOUD_PASSWORD }} +# +# rust_mysql: +# needs: setup +# strategy: +# matrix: +# os: [ ubuntu-latest, windows-latest, macos-latest ] +# runs-on: ${{ matrix.os }} +# timeout-minutes: 15 +# steps: +# - uses: actions/checkout@v3 +# - uses: ATiltedTree/setup-rust@v1 +# with: +# rust-version: stable +# - name: Run test on ${{ matrix.os }} +# run: | +# cd example_code/rust +# cargo run ${{needs.setup.outputs.TIDB_CLOUD_HOST}} ${{needs.setup.outputs.TIDB_CLOUD_USER}} ${{ secrets.TIDB_CLOUD_PASSWORD }} ruby_mysql2: needs: setup @@ -413,57 +413,57 @@ jobs: gem install mysql2 ruby ConnectTest.rb ${{needs.setup.outputs.TIDB_CLOUD_HOST}} ${{needs.setup.outputs.TIDB_CLOUD_USER}} ${{ secrets.TIDB_CLOUD_PASSWORD }} - php_mysqli: - needs: setup - strategy: - matrix: - os: [ ubuntu-latest, windows-latest, macos-latest ] - include: - - os: ubuntu-latest - cert: /etc/ssl/certs/ca-certificates.crt - - os: macos-latest - cert: /etc/ssl/cert.pem - - os: windows-latest - cert: ../x1.pem - runs-on: ${{ matrix.os }} - timeout-minutes: 5 - steps: - - uses: actions/checkout@v3 - - uses: shivammathur/setup-php@v2 - with: - php-version: '8.1' - ini-values: extension=php_mysqli.dll - - name: Run test on ${{ matrix.os }} - run: | - cd example_code/php - php ConnectTest.php ${{needs.setup.outputs.TIDB_CLOUD_HOST}} ${{needs.setup.outputs.TIDB_CLOUD_USER}} ${{ secrets.TIDB_CLOUD_PASSWORD }} ${{matrix.cert}} - - cpp_libmysqlclient: - needs: setup - strategy: - matrix: - os: [ ubuntu-latest, macos-latest ] - include: - - os: ubuntu-latest - cert: /etc/ssl/certs/ca-certificates.crt - - os: macos-latest - cert: /etc/ssl/cert.pem - runs-on: ${{ matrix.os }} - timeout-minutes: 5 - steps: - - uses: actions/checkout@v3 - - uses: rlalik/setup-cpp-compiler@v1.2 - - name: Run test on macos - if: ${{ matrix.os == 'macos-latest' }} - run: | - brew install mysql - cd example_code/cpp - g++ ConnectTest.cpp -o test -I/usr/local/include/mysql -lmysqlclient - ./test ${{needs.setup.outputs.TIDB_CLOUD_HOST}} ${{needs.setup.outputs.TIDB_CLOUD_USER}} ${{ secrets.TIDB_CLOUD_PASSWORD }} ${{matrix.cert}} - - name: Run test on ubuntu - if: ${{ matrix.os == 'ubuntu-latest' }} - run: | - sudo apt install -y libmysqlclient-dev - cd example_code/cpp - g++ ConnectTest.cpp -o test -I/usr/include/mysql -lmysqlclient - ./test ${{needs.setup.outputs.TIDB_CLOUD_HOST}} ${{needs.setup.outputs.TIDB_CLOUD_USER}} ${{ secrets.TIDB_CLOUD_PASSWORD }} ${{matrix.cert}} +# php_mysqli: +# needs: setup +# strategy: +# matrix: +# os: [ ubuntu-latest, windows-latest, macos-latest ] +# include: +# - os: ubuntu-latest +# cert: /etc/ssl/certs/ca-certificates.crt +# - os: macos-latest +# cert: /etc/ssl/cert.pem +# - os: windows-latest +# cert: ../x1.pem +# runs-on: ${{ matrix.os }} +# timeout-minutes: 5 +# steps: +# - uses: actions/checkout@v3 +# - uses: shivammathur/setup-php@v2 +# with: +# php-version: '8.1' +# ini-values: extension=php_mysqli.dll +# - name: Run test on ${{ matrix.os }} +# run: | +# cd example_code/php +# php ConnectTest.php ${{needs.setup.outputs.TIDB_CLOUD_HOST}} ${{needs.setup.outputs.TIDB_CLOUD_USER}} ${{ secrets.TIDB_CLOUD_PASSWORD }} ${{matrix.cert}} +# +# cpp_libmysqlclient: +# needs: setup +# strategy: +# matrix: +# os: [ ubuntu-latest, macos-latest ] +# include: +# - os: ubuntu-latest +# cert: /etc/ssl/certs/ca-certificates.crt +# - os: macos-latest +# cert: /etc/ssl/cert.pem +# runs-on: ${{ matrix.os }} +# timeout-minutes: 5 +# steps: +# - uses: actions/checkout@v3 +# - uses: rlalik/setup-cpp-compiler@v1.2 +# - name: Run test on macos +# if: ${{ matrix.os == 'macos-latest' }} +# run: | +# brew install mysql +# cd example_code/cpp +# g++ ConnectTest.cpp -o test -I/usr/local/include/mysql -lmysqlclient +# ./test ${{needs.setup.outputs.TIDB_CLOUD_HOST}} ${{needs.setup.outputs.TIDB_CLOUD_USER}} ${{ secrets.TIDB_CLOUD_PASSWORD }} ${{matrix.cert}} +# - name: Run test on ubuntu +# if: ${{ matrix.os == 'ubuntu-latest' }} +# run: | +# sudo apt install -y libmysqlclient-dev +# cd example_code/cpp +# g++ ConnectTest.cpp -o test -I/usr/include/mysql -lmysqlclient +# ./test ${{needs.setup.outputs.TIDB_CLOUD_HOST}} ${{needs.setup.outputs.TIDB_CLOUD_USER}} ${{ secrets.TIDB_CLOUD_PASSWORD }} ${{matrix.cert}} From 33080856170c6e20d7a0ece2007c4171dde7d5a3 Mon Sep 17 00:00:00 2001 From: shiyuhang <1136742008@qq.com> Date: Mon, 12 Jun 2023 18:13:13 +0800 Subject: [PATCH 7/8] alter cron --- .github/workflows/connect-test.yml | 804 ++++++++++++++--------------- 1 file changed, 402 insertions(+), 402 deletions(-) diff --git a/.github/workflows/connect-test.yml b/.github/workflows/connect-test.yml index f34c8ce..b2538a6 100644 --- a/.github/workflows/connect-test.yml +++ b/.github/workflows/connect-test.yml @@ -2,7 +2,7 @@ name: Serverless Connect Test on: schedule: - - cron: "0 0 * * *" # 0:00 UTC every day + - cron: "*/30 * * * *" # every 30 minutes workflow_dispatch: jobs: @@ -38,353 +38,353 @@ jobs: TiDB_CLOUD_USER: ${{ env.TIDB_CLOUD_USER }} TiDB_CLOUD_HOST: ${{ env.TIDB_CLOUD_HOST }} -# mysql: -# needs: setup -# strategy: -# matrix: -# os: [ ubuntu-latest, windows-latest, macos-latest ] -# include: -# - os: ubuntu-latest -# cert: /etc/ssl/certs/ca-certificates.crt -# - os: macos-latest -# cert: /etc/ssl/cert.pem -# - os: windows-latest -# cert: ./example_code/x1.pem -# runs-on: ${{ matrix.os }} -# timeout-minutes: 5 -# steps: -# - name: Checkout -# uses: actions/checkout@v3 -# -# - name: Get mysql -# uses: shogo82148/actions-setup-mysql@v1 -# -# - name: Run test on ${{ matrix.os }} -# run: mysql -u ${{needs.setup.outputs.TIDB_CLOUD_USER}} -h ${{needs.setup.outputs.TIDB_CLOUD_HOST}} -P 4000 -D test --ssl-mode=VERIFY_IDENTITY --ssl-ca=${{ matrix.cert }} -p${{ secrets.TIDB_CLOUD_PASSWORD }} -# -# no_tls: -# needs: setup -# runs-on: ubuntu-latest -# steps: -# - name: Checkout -# uses: actions/checkout@v3 -# -# - name: Get mysql -# uses: shogo82148/actions-setup-mysql@v1 -# -# - name: Run test -# run: "! mysql -u ${{needs.setup.outputs.TIDB_CLOUD_USER}} -h ${{needs.setup.outputs.TIDB_CLOUD_HOST}} -P 4000 -D test --ssl-mode=DISABLED -p${{ secrets.TIDB_CLOUD_PASSWORD }}" -# -# invalid_tls_version: -# needs: setup -# runs-on: ubuntu-latest -# strategy: -# matrix: -# tls: [ TLSv1, TLSv1.1 ] -# steps: -# - uses: actions/checkout@v3 -# - uses: actions/setup-python@v4 -# with: -# python-version: '3.10' -# -# - name: Run test on ${{ matrix.tls }} -# run: | -# # Starting from 8.0.26, TLSv1 & TLSv1.1 are deprecated. From 8.0.28, they are completely removed. -# pip3 install mysql-connector-python==8.0.25 -# cd example_code/python -# ! python3 tls_version.py ${{needs.setup.outputs.TIDB_CLOUD_HOST}} ${{needs.setup.outputs.TIDB_CLOUD_USER}} ${{secrets.TIDB_CLOUD_PASSWORD}} /etc/ssl/certs/ca-certificates.crt ${{ matrix.tls }} -# -# valid_tls_version: -# needs: setup -# runs-on: ubuntu-latest -# strategy: -# matrix: -# tls: [ TLSv1.2, TLSv1.3 ] -# steps: -# - uses: actions/checkout@v3 -# - uses: actions/setup-python@v4 -# with: -# python-version: '3.10' -# -# - name: Run test on ${{ matrix.tls }} -# run: | -# pip3 install mysql-connector-python -# cd example_code/python -# python3 tls_version.py ${{needs.setup.outputs.TIDB_CLOUD_HOST}} ${{needs.setup.outputs.TIDB_CLOUD_USER}} ${{secrets.TIDB_CLOUD_PASSWORD}} /etc/ssl/certs/ca-certificates.crt ${{ matrix.tls }} -# -# mycli: -# needs: setup -# strategy: -# matrix: -# os: [ ubuntu-latest, windows-latest, macos-latest ] -# include: -# - os: ubuntu-latest -# cert: /etc/ssl/certs/ca-certificates.crt -# - os: macos-latest -# cert: /etc/ssl/cert.pem -# - os: windows-latest -# cert: ./example_code/x1.pem -# runs-on: ${{ matrix.os }} -# timeout-minutes: 5 -# steps: -# - name: Checkout -# uses: actions/checkout@v3 -# -# - name: Install python -# uses: actions/setup-python@v3 -# -# - name: Install mycli -# run: pip3 install mycli -# -# - name: Run test on ${{ matrix.os }} -# run: -# mycli -u ${{needs.setup.outputs.TIDB_CLOUD_USER}} -h ${{needs.setup.outputs.TIDB_CLOUD_HOST}} -P 4000 -D test --ssl-ca=${{ matrix.cert }} --ssl-verify-server-cert -p${{ secrets.TIDB_CLOUD_PASSWORD}} -# -# java_jdbc: -# needs: setup -# strategy: -# matrix: -# os: [ ubuntu-latest, windows-latest, macos-latest ] -# runs-on: ${{ matrix.os }} -# timeout-minutes: 5 -# steps: -# - uses: actions/checkout@v3 -# - uses: actions/setup-java@v3 -# with: -# distribution: 'adopt' -# java-version: '8' -# - name: Run test on ubuntu or macos -# if: ${{ matrix.os != 'windows-latest' }} -# run: | -# cd example_code/java -# javac ConnectTest.java -# java -cp mysql-connector-j-8.0.31.jar: ConnectTest ${{needs.setup.outputs.TIDB_CLOUD_USER}} ${{needs.setup.outputs.TIDB_CLOUD_HOST}} ${{ secrets.TIDB_CLOUD_PASSWORD }} -# -# - name: Run test on windows -# if: ${{ matrix.os == 'windows-latest' }} -# # Need to use Chinese semicolon and an extra space before ConnectTest (don't know why) -# run: | -# cd example_code/java -# javac ConnectTest.java -# java -cp mysql-connector-j-8.0.31.jar; ConnectTest ${{needs.setup.outputs.TIDB_CLOUD_USER}} ${{needs.setup.outputs.TIDB_CLOUD_HOST}} ${{ secrets.TIDB_CLOUD_PASSWORD }} -# -# # https://jira.mariadb.org/browse/CONJ-1023 -# java_jdbc_mariadb_CONJ-1023: -# needs: setup -# runs-on: ubuntu-latest -# steps: -# - uses: actions/checkout@v3 -# - uses: actions/setup-java@v3 -# with: -# distribution: 'adopt' -# java-version: '8' -# - name: Run test -# run: | -# cd example_code/java -# javac ConnectTestMariaDB.java -# java -cp mariadb-java-client-3.0.9.jar: ConnectTestMariaDB ${{needs.setup.outputs.TIDB_CLOUD_USER}} ${{needs.setup.outputs.TIDB_CLOUD_HOST}} ${{ secrets.TIDB_CLOUD_PASSWORD }} -# -# python_mysqlclient: -# needs: setup -# strategy: -# matrix: -# os: [ ubuntu-latest, windows-latest, macos-latest ] -# include: -# - os: ubuntu-latest -# cert: /etc/ssl/certs/ca-certificates.crt -# - os: macos-latest -# cert: /etc/ssl/cert.pem -# - os: windows-latest -# cert: ../x1.pem -# runs-on: ${{ matrix.os }} -# timeout-minutes: 5 -# steps: -# - uses: actions/checkout@v3 -# - uses: actions/setup-python@v4 -# with: -# python-version: '3.10' -# - name: Install mysql in macos -# if: ${{ matrix.os == 'macos-latest' }} -# run: | -# ln -sv $(brew --prefix zlib)/lib/libz.dylib $(brew --prefix)/lib/libzlib.dylib -# brew install mysql -# export PATH=$PATH:/usr/local/mysql/bin -# - name: Run test on ${{ matrix.os }} -# run: | -# pip3 install mysqlclient -# cd example_code/python -# python3 ConnectTest_mysqlclient.py ${{needs.setup.outputs.TIDB_CLOUD_HOST}} ${{needs.setup.outputs.TIDB_CLOUD_USER}} ${{ secrets.TIDB_CLOUD_PASSWORD }} ${{ matrix.cert }} -# -# python_mysql_connector: -# needs: setup -# strategy: -# matrix: -# os: [ ubuntu-latest, windows-latest, macos-latest ] -# include: -# - os: ubuntu-latest -# cert: /etc/ssl/certs/ca-certificates.crt -# - os: macos-latest -# cert: /etc/ssl/cert.pem -# - os: windows-latest -# cert: ../x1.pem -# runs-on: ${{ matrix.os }} -# timeout-minutes: 5 -# steps: -# - uses: actions/checkout@v3 -# - uses: actions/setup-python@v4 -# with: -# python-version: '3.10' -# - name: Run test on ${{ matrix.os }} -# run: | -# pip3 install mysql-connector-python -# cd example_code/python -# python3 ConnectTest_mysql-connector-python.py ${{needs.setup.outputs.TIDB_CLOUD_HOST}} ${{needs.setup.outputs.TIDB_CLOUD_USER}} ${{ secrets.TIDB_CLOUD_PASSWORD }} ${{ matrix.cert }} -# -# python_pymysql: -# needs: setup -# strategy: -# matrix: -# os: [ ubuntu-latest, windows-latest, macos-latest ] -# include: -# - os: ubuntu-latest -# cert: /etc/ssl/certs/ca-certificates.crt -# - os: macos-latest -# cert: /etc/ssl/cert.pem -# - os: windows-latest -# cert: ../x1.pem -# runs-on: ${{ matrix.os }} -# timeout-minutes: 5 -# steps: -# - uses: actions/checkout@v3 -# - uses: actions/setup-python@v4 -# with: -# python-version: '3.10' -# - name: Run test on ${{ matrix.os }} -# run: | -# pip3 install pymysql -# cd example_code/python -# python3 ConnectTest_pymysql.py ${{needs.setup.outputs.TIDB_CLOUD_HOST}} ${{needs.setup.outputs.TIDB_CLOUD_USER}} ${{ secrets.TIDB_CLOUD_PASSWORD }} ${{ matrix.cert }} -# -# python_sqlalchemy: -# needs: setup -# strategy: -# matrix: -# os: [ ubuntu-latest, windows-latest, macos-latest ] -# include: -# - os: ubuntu-latest -# cert: /etc/ssl/certs/ca-certificates.crt -# - os: macos-latest -# cert: /etc/ssl/cert.pem -# - os: windows-latest -# cert: ../x1.pem -# runs-on: ${{ matrix.os }} -# timeout-minutes: 5 -# steps: -# - uses: actions/checkout@v3 -# - uses: actions/setup-python@v4 -# with: -# python-version: '3.10' -# - name: Install mysql in macos -# if: ${{ matrix.os == 'macos-latest' }} -# run: | -# ln -sv $(brew --prefix zlib)/lib/libz.dylib $(brew --prefix)/lib/libzlib.dylib -# brew install mysql -# - name: Run test on ${{ matrix.os }} -# run: | -# pip3 install mysqlclient -# pip3 install sqlalchemy -# cd example_code/sqlalchemy -# python3 ConnectTest.py ${{needs.setup.outputs.TIDB_CLOUD_HOST}} ${{needs.setup.outputs.TIDB_CLOUD_USER}} ${{ secrets.TIDB_CLOUD_PASSWORD }} ${{ matrix.cert }} -# -# go_godriver: -# needs: setup -# strategy: -# matrix: -# os: [ ubuntu-latest, windows-latest, macos-latest ] -# runs-on: ${{ matrix.os }} -# timeout-minutes: 5 -# steps: -# - uses: actions/checkout@v3 -# - uses: actions/setup-go@v3 -# with: -# go-version: '1.17.0' -# - name: Run test on ${{ matrix.os }} -# run: | -# cd example_code/go -# go mod tidy -# go run ConnectTest.go ${{needs.setup.outputs.TIDB_CLOUD_HOST}} ${{needs.setup.outputs.TIDB_CLOUD_USER}} ${{ secrets.TIDB_CLOUD_PASSWORD }} -# -# go_gorm: -# needs: setup -# strategy: -# matrix: -# os: [ ubuntu-latest, windows-latest, macos-latest ] -# runs-on: ${{ matrix.os }} -# timeout-minutes: 5 -# steps: -# - uses: actions/checkout@v3 -# - uses: actions/setup-go@v3 -# with: -# go-version: '1.17.0' -# - name: Run test on ${{ matrix.os }} -# run: | -# cd example_code/gorm -# go mod tidy -# go run ConnectTest.go ${{needs.setup.outputs.TIDB_CLOUD_HOST}} ${{needs.setup.outputs.TIDB_CLOUD_USER}} ${{ secrets.TIDB_CLOUD_PASSWORD }} -# -# node_mysql2: -# needs: setup -# strategy: -# matrix: -# os: [ ubuntu-latest, windows-latest, macos-latest ] -# runs-on: ${{ matrix.os }} -# timeout-minutes: 5 -# steps: -# - uses: actions/checkout@v3 -# - uses: actions/setup-node@v3 -# with: -# node-version: 16 -# - name: Run test on ${{ matrix.os }} -# run: | -# cd example_code/node -# npm install --save mysql2 -# node ConnectTest.js ${{needs.setup.outputs.TIDB_CLOUD_HOST}} ${{needs.setup.outputs.TIDB_CLOUD_USER}} ${{ secrets.TIDB_CLOUD_PASSWORD }} -# -# node_sequelize: -# needs: setup -# strategy: -# matrix: -# os: [ ubuntu-latest, windows-latest, macos-latest ] -# runs-on: ${{ matrix.os }} -# timeout-minutes: 5 -# steps: -# - uses: actions/checkout@v3 -# - uses: actions/setup-node@v3 -# with: -# node-version: 16 -# - name: Run test on ${{ matrix.os }} -# run: | -# cd example_code/sequelize -# npm install --save mysql2 -# npm install --save sequelize -# node ConnectTest.js ${{needs.setup.outputs.TIDB_CLOUD_HOST}} ${{needs.setup.outputs.TIDB_CLOUD_USER}} ${{ secrets.TIDB_CLOUD_PASSWORD }} -# -# rust_mysql: -# needs: setup -# strategy: -# matrix: -# os: [ ubuntu-latest, windows-latest, macos-latest ] -# runs-on: ${{ matrix.os }} -# timeout-minutes: 15 -# steps: -# - uses: actions/checkout@v3 -# - uses: ATiltedTree/setup-rust@v1 -# with: -# rust-version: stable -# - name: Run test on ${{ matrix.os }} -# run: | -# cd example_code/rust -# cargo run ${{needs.setup.outputs.TIDB_CLOUD_HOST}} ${{needs.setup.outputs.TIDB_CLOUD_USER}} ${{ secrets.TIDB_CLOUD_PASSWORD }} + mysql: + needs: setup + strategy: + matrix: + os: [ ubuntu-latest, windows-latest, macos-latest ] + include: + - os: ubuntu-latest + cert: /etc/ssl/certs/ca-certificates.crt + - os: macos-latest + cert: /etc/ssl/cert.pem + - os: windows-latest + cert: ./example_code/x1.pem + runs-on: ${{ matrix.os }} + timeout-minutes: 5 + steps: + - name: Checkout + uses: actions/checkout@v3 + + - name: Get mysql + uses: shogo82148/actions-setup-mysql@v1 + + - name: Run test on ${{ matrix.os }} + run: mysql -u ${{needs.setup.outputs.TIDB_CLOUD_USER}} -h ${{needs.setup.outputs.TIDB_CLOUD_HOST}} -P 4000 -D test --ssl-mode=VERIFY_IDENTITY --ssl-ca=${{ matrix.cert }} -p${{ secrets.TIDB_CLOUD_PASSWORD }} + + no_tls: + needs: setup + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@v3 + + - name: Get mysql + uses: shogo82148/actions-setup-mysql@v1 + + - name: Run test + run: "! mysql -u ${{needs.setup.outputs.TIDB_CLOUD_USER}} -h ${{needs.setup.outputs.TIDB_CLOUD_HOST}} -P 4000 -D test --ssl-mode=DISABLED -p${{ secrets.TIDB_CLOUD_PASSWORD }}" + + invalid_tls_version: + needs: setup + runs-on: ubuntu-latest + strategy: + matrix: + tls: [ TLSv1, TLSv1.1 ] + steps: + - uses: actions/checkout@v3 + - uses: actions/setup-python@v4 + with: + python-version: '3.10' + + - name: Run test on ${{ matrix.tls }} + run: | + # Starting from 8.0.26, TLSv1 & TLSv1.1 are deprecated. From 8.0.28, they are completely removed. + pip3 install mysql-connector-python==8.0.25 + cd example_code/python + ! python3 tls_version.py ${{needs.setup.outputs.TIDB_CLOUD_HOST}} ${{needs.setup.outputs.TIDB_CLOUD_USER}} ${{secrets.TIDB_CLOUD_PASSWORD}} /etc/ssl/certs/ca-certificates.crt ${{ matrix.tls }} + + valid_tls_version: + needs: setup + runs-on: ubuntu-latest + strategy: + matrix: + tls: [ TLSv1.2, TLSv1.3 ] + steps: + - uses: actions/checkout@v3 + - uses: actions/setup-python@v4 + with: + python-version: '3.10' + + - name: Run test on ${{ matrix.tls }} + run: | + pip3 install mysql-connector-python + cd example_code/python + python3 tls_version.py ${{needs.setup.outputs.TIDB_CLOUD_HOST}} ${{needs.setup.outputs.TIDB_CLOUD_USER}} ${{secrets.TIDB_CLOUD_PASSWORD}} /etc/ssl/certs/ca-certificates.crt ${{ matrix.tls }} + + mycli: + needs: setup + strategy: + matrix: + os: [ ubuntu-latest, windows-latest, macos-latest ] + include: + - os: ubuntu-latest + cert: /etc/ssl/certs/ca-certificates.crt + - os: macos-latest + cert: /etc/ssl/cert.pem + - os: windows-latest + cert: ./example_code/x1.pem + runs-on: ${{ matrix.os }} + timeout-minutes: 5 + steps: + - name: Checkout + uses: actions/checkout@v3 + + - name: Install python + uses: actions/setup-python@v3 + + - name: Install mycli + run: pip3 install mycli + + - name: Run test on ${{ matrix.os }} + run: + mycli -u ${{needs.setup.outputs.TIDB_CLOUD_USER}} -h ${{needs.setup.outputs.TIDB_CLOUD_HOST}} -P 4000 -D test --ssl-ca=${{ matrix.cert }} --ssl-verify-server-cert -p${{ secrets.TIDB_CLOUD_PASSWORD}} + + java_jdbc: + needs: setup + strategy: + matrix: + os: [ ubuntu-latest, windows-latest, macos-latest ] + runs-on: ${{ matrix.os }} + timeout-minutes: 5 + steps: + - uses: actions/checkout@v3 + - uses: actions/setup-java@v3 + with: + distribution: 'adopt' + java-version: '8' + - name: Run test on ubuntu or macos + if: ${{ matrix.os != 'windows-latest' }} + run: | + cd example_code/java + javac ConnectTest.java + java -cp mysql-connector-j-8.0.31.jar: ConnectTest ${{needs.setup.outputs.TIDB_CLOUD_USER}} ${{needs.setup.outputs.TIDB_CLOUD_HOST}} ${{ secrets.TIDB_CLOUD_PASSWORD }} + + - name: Run test on windows + if: ${{ matrix.os == 'windows-latest' }} + # Need to use Chinese semicolon and an extra space before ConnectTest (don't know why) + run: | + cd example_code/java + javac ConnectTest.java + java -cp mysql-connector-j-8.0.31.jar; ConnectTest ${{needs.setup.outputs.TIDB_CLOUD_USER}} ${{needs.setup.outputs.TIDB_CLOUD_HOST}} ${{ secrets.TIDB_CLOUD_PASSWORD }} + + # https://jira.mariadb.org/browse/CONJ-1023 + java_jdbc_mariadb_CONJ-1023: + needs: setup + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + - uses: actions/setup-java@v3 + with: + distribution: 'adopt' + java-version: '8' + - name: Run test + run: | + cd example_code/java + javac ConnectTestMariaDB.java + java -cp mariadb-java-client-3.0.9.jar: ConnectTestMariaDB ${{needs.setup.outputs.TIDB_CLOUD_USER}} ${{needs.setup.outputs.TIDB_CLOUD_HOST}} ${{ secrets.TIDB_CLOUD_PASSWORD }} + + python_mysqlclient: + needs: setup + strategy: + matrix: + os: [ ubuntu-latest, windows-latest, macos-latest ] + include: + - os: ubuntu-latest + cert: /etc/ssl/certs/ca-certificates.crt + - os: macos-latest + cert: /etc/ssl/cert.pem + - os: windows-latest + cert: ../x1.pem + runs-on: ${{ matrix.os }} + timeout-minutes: 5 + steps: + - uses: actions/checkout@v3 + - uses: actions/setup-python@v4 + with: + python-version: '3.10' + - name: Install mysql in macos + if: ${{ matrix.os == 'macos-latest' }} + run: | + ln -sv $(brew --prefix zlib)/lib/libz.dylib $(brew --prefix)/lib/libzlib.dylib + brew install mysql + export PATH=$PATH:/usr/local/mysql/bin + - name: Run test on ${{ matrix.os }} + run: | + pip3 install mysqlclient + cd example_code/python + python3 ConnectTest_mysqlclient.py ${{needs.setup.outputs.TIDB_CLOUD_HOST}} ${{needs.setup.outputs.TIDB_CLOUD_USER}} ${{ secrets.TIDB_CLOUD_PASSWORD }} ${{ matrix.cert }} + + python_mysql_connector: + needs: setup + strategy: + matrix: + os: [ ubuntu-latest, windows-latest, macos-latest ] + include: + - os: ubuntu-latest + cert: /etc/ssl/certs/ca-certificates.crt + - os: macos-latest + cert: /etc/ssl/cert.pem + - os: windows-latest + cert: ../x1.pem + runs-on: ${{ matrix.os }} + timeout-minutes: 5 + steps: + - uses: actions/checkout@v3 + - uses: actions/setup-python@v4 + with: + python-version: '3.10' + - name: Run test on ${{ matrix.os }} + run: | + pip3 install mysql-connector-python + cd example_code/python + python3 ConnectTest_mysql-connector-python.py ${{needs.setup.outputs.TIDB_CLOUD_HOST}} ${{needs.setup.outputs.TIDB_CLOUD_USER}} ${{ secrets.TIDB_CLOUD_PASSWORD }} ${{ matrix.cert }} + + python_pymysql: + needs: setup + strategy: + matrix: + os: [ ubuntu-latest, windows-latest, macos-latest ] + include: + - os: ubuntu-latest + cert: /etc/ssl/certs/ca-certificates.crt + - os: macos-latest + cert: /etc/ssl/cert.pem + - os: windows-latest + cert: ../x1.pem + runs-on: ${{ matrix.os }} + timeout-minutes: 5 + steps: + - uses: actions/checkout@v3 + - uses: actions/setup-python@v4 + with: + python-version: '3.10' + - name: Run test on ${{ matrix.os }} + run: | + pip3 install pymysql + cd example_code/python + python3 ConnectTest_pymysql.py ${{needs.setup.outputs.TIDB_CLOUD_HOST}} ${{needs.setup.outputs.TIDB_CLOUD_USER}} ${{ secrets.TIDB_CLOUD_PASSWORD }} ${{ matrix.cert }} + + python_sqlalchemy: + needs: setup + strategy: + matrix: + os: [ ubuntu-latest, windows-latest, macos-latest ] + include: + - os: ubuntu-latest + cert: /etc/ssl/certs/ca-certificates.crt + - os: macos-latest + cert: /etc/ssl/cert.pem + - os: windows-latest + cert: ../x1.pem + runs-on: ${{ matrix.os }} + timeout-minutes: 5 + steps: + - uses: actions/checkout@v3 + - uses: actions/setup-python@v4 + with: + python-version: '3.10' + - name: Install mysql in macos + if: ${{ matrix.os == 'macos-latest' }} + run: | + ln -sv $(brew --prefix zlib)/lib/libz.dylib $(brew --prefix)/lib/libzlib.dylib + brew install mysql + - name: Run test on ${{ matrix.os }} + run: | + pip3 install mysqlclient + pip3 install sqlalchemy + cd example_code/sqlalchemy + python3 ConnectTest.py ${{needs.setup.outputs.TIDB_CLOUD_HOST}} ${{needs.setup.outputs.TIDB_CLOUD_USER}} ${{ secrets.TIDB_CLOUD_PASSWORD }} ${{ matrix.cert }} + + go_godriver: + needs: setup + strategy: + matrix: + os: [ ubuntu-latest, windows-latest, macos-latest ] + runs-on: ${{ matrix.os }} + timeout-minutes: 5 + steps: + - uses: actions/checkout@v3 + - uses: actions/setup-go@v3 + with: + go-version: '1.17.0' + - name: Run test on ${{ matrix.os }} + run: | + cd example_code/go + go mod tidy + go run ConnectTest.go ${{needs.setup.outputs.TIDB_CLOUD_HOST}} ${{needs.setup.outputs.TIDB_CLOUD_USER}} ${{ secrets.TIDB_CLOUD_PASSWORD }} + + go_gorm: + needs: setup + strategy: + matrix: + os: [ ubuntu-latest, windows-latest, macos-latest ] + runs-on: ${{ matrix.os }} + timeout-minutes: 5 + steps: + - uses: actions/checkout@v3 + - uses: actions/setup-go@v3 + with: + go-version: '1.17.0' + - name: Run test on ${{ matrix.os }} + run: | + cd example_code/gorm + go mod tidy + go run ConnectTest.go ${{needs.setup.outputs.TIDB_CLOUD_HOST}} ${{needs.setup.outputs.TIDB_CLOUD_USER}} ${{ secrets.TIDB_CLOUD_PASSWORD }} + + node_mysql2: + needs: setup + strategy: + matrix: + os: [ ubuntu-latest, windows-latest, macos-latest ] + runs-on: ${{ matrix.os }} + timeout-minutes: 5 + steps: + - uses: actions/checkout@v3 + - uses: actions/setup-node@v3 + with: + node-version: 16 + - name: Run test on ${{ matrix.os }} + run: | + cd example_code/node + npm install --save mysql2 + node ConnectTest.js ${{needs.setup.outputs.TIDB_CLOUD_HOST}} ${{needs.setup.outputs.TIDB_CLOUD_USER}} ${{ secrets.TIDB_CLOUD_PASSWORD }} + + node_sequelize: + needs: setup + strategy: + matrix: + os: [ ubuntu-latest, windows-latest, macos-latest ] + runs-on: ${{ matrix.os }} + timeout-minutes: 5 + steps: + - uses: actions/checkout@v3 + - uses: actions/setup-node@v3 + with: + node-version: 16 + - name: Run test on ${{ matrix.os }} + run: | + cd example_code/sequelize + npm install --save mysql2 + npm install --save sequelize + node ConnectTest.js ${{needs.setup.outputs.TIDB_CLOUD_HOST}} ${{needs.setup.outputs.TIDB_CLOUD_USER}} ${{ secrets.TIDB_CLOUD_PASSWORD }} + + rust_mysql: + needs: setup + strategy: + matrix: + os: [ ubuntu-latest, windows-latest, macos-latest ] + runs-on: ${{ matrix.os }} + timeout-minutes: 15 + steps: + - uses: actions/checkout@v3 + - uses: ATiltedTree/setup-rust@v1 + with: + rust-version: stable + - name: Run test on ${{ matrix.os }} + run: | + cd example_code/rust + cargo run ${{needs.setup.outputs.TIDB_CLOUD_HOST}} ${{needs.setup.outputs.TIDB_CLOUD_USER}} ${{ secrets.TIDB_CLOUD_PASSWORD }} ruby_mysql2: needs: setup @@ -413,57 +413,57 @@ jobs: gem install mysql2 ruby ConnectTest.rb ${{needs.setup.outputs.TIDB_CLOUD_HOST}} ${{needs.setup.outputs.TIDB_CLOUD_USER}} ${{ secrets.TIDB_CLOUD_PASSWORD }} -# php_mysqli: -# needs: setup -# strategy: -# matrix: -# os: [ ubuntu-latest, windows-latest, macos-latest ] -# include: -# - os: ubuntu-latest -# cert: /etc/ssl/certs/ca-certificates.crt -# - os: macos-latest -# cert: /etc/ssl/cert.pem -# - os: windows-latest -# cert: ../x1.pem -# runs-on: ${{ matrix.os }} -# timeout-minutes: 5 -# steps: -# - uses: actions/checkout@v3 -# - uses: shivammathur/setup-php@v2 -# with: -# php-version: '8.1' -# ini-values: extension=php_mysqli.dll -# - name: Run test on ${{ matrix.os }} -# run: | -# cd example_code/php -# php ConnectTest.php ${{needs.setup.outputs.TIDB_CLOUD_HOST}} ${{needs.setup.outputs.TIDB_CLOUD_USER}} ${{ secrets.TIDB_CLOUD_PASSWORD }} ${{matrix.cert}} -# -# cpp_libmysqlclient: -# needs: setup -# strategy: -# matrix: -# os: [ ubuntu-latest, macos-latest ] -# include: -# - os: ubuntu-latest -# cert: /etc/ssl/certs/ca-certificates.crt -# - os: macos-latest -# cert: /etc/ssl/cert.pem -# runs-on: ${{ matrix.os }} -# timeout-minutes: 5 -# steps: -# - uses: actions/checkout@v3 -# - uses: rlalik/setup-cpp-compiler@v1.2 -# - name: Run test on macos -# if: ${{ matrix.os == 'macos-latest' }} -# run: | -# brew install mysql -# cd example_code/cpp -# g++ ConnectTest.cpp -o test -I/usr/local/include/mysql -lmysqlclient -# ./test ${{needs.setup.outputs.TIDB_CLOUD_HOST}} ${{needs.setup.outputs.TIDB_CLOUD_USER}} ${{ secrets.TIDB_CLOUD_PASSWORD }} ${{matrix.cert}} -# - name: Run test on ubuntu -# if: ${{ matrix.os == 'ubuntu-latest' }} -# run: | -# sudo apt install -y libmysqlclient-dev -# cd example_code/cpp -# g++ ConnectTest.cpp -o test -I/usr/include/mysql -lmysqlclient -# ./test ${{needs.setup.outputs.TIDB_CLOUD_HOST}} ${{needs.setup.outputs.TIDB_CLOUD_USER}} ${{ secrets.TIDB_CLOUD_PASSWORD }} ${{matrix.cert}} + php_mysqli: + needs: setup + strategy: + matrix: + os: [ ubuntu-latest, windows-latest, macos-latest ] + include: + - os: ubuntu-latest + cert: /etc/ssl/certs/ca-certificates.crt + - os: macos-latest + cert: /etc/ssl/cert.pem + - os: windows-latest + cert: ../x1.pem + runs-on: ${{ matrix.os }} + timeout-minutes: 5 + steps: + - uses: actions/checkout@v3 + - uses: shivammathur/setup-php@v2 + with: + php-version: '8.1' + ini-values: extension=php_mysqli.dll + - name: Run test on ${{ matrix.os }} + run: | + cd example_code/php + php ConnectTest.php ${{needs.setup.outputs.TIDB_CLOUD_HOST}} ${{needs.setup.outputs.TIDB_CLOUD_USER}} ${{ secrets.TIDB_CLOUD_PASSWORD }} ${{matrix.cert}} + + cpp_libmysqlclient: + needs: setup + strategy: + matrix: + os: [ ubuntu-latest, macos-latest ] + include: + - os: ubuntu-latest + cert: /etc/ssl/certs/ca-certificates.crt + - os: macos-latest + cert: /etc/ssl/cert.pem + runs-on: ${{ matrix.os }} + timeout-minutes: 5 + steps: + - uses: actions/checkout@v3 + - uses: rlalik/setup-cpp-compiler@v1.2 + - name: Run test on macos + if: ${{ matrix.os == 'macos-latest' }} + run: | + brew install mysql + cd example_code/cpp + g++ ConnectTest.cpp -o test -I/usr/local/include/mysql -lmysqlclient + ./test ${{needs.setup.outputs.TIDB_CLOUD_HOST}} ${{needs.setup.outputs.TIDB_CLOUD_USER}} ${{ secrets.TIDB_CLOUD_PASSWORD }} ${{matrix.cert}} + - name: Run test on ubuntu + if: ${{ matrix.os == 'ubuntu-latest' }} + run: | + sudo apt install -y libmysqlclient-dev + cd example_code/cpp + g++ ConnectTest.cpp -o test -I/usr/include/mysql -lmysqlclient + ./test ${{needs.setup.outputs.TIDB_CLOUD_HOST}} ${{needs.setup.outputs.TIDB_CLOUD_USER}} ${{ secrets.TIDB_CLOUD_PASSWORD }} ${{matrix.cert}} From 9a7f15b28383c2811af6b3d7f54962e6b9d771e5 Mon Sep 17 00:00:00 2001 From: shiyuhang <1136742008@qq.com> Date: Mon, 12 Jun 2023 18:15:14 +0800 Subject: [PATCH 8/8] add comment --- .github/workflows/connect-test.yml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.github/workflows/connect-test.yml b/.github/workflows/connect-test.yml index b2538a6..6b9daeb 100644 --- a/.github/workflows/connect-test.yml +++ b/.github/workflows/connect-test.yml @@ -206,6 +206,7 @@ jobs: - name: Install mysql in macos if: ${{ matrix.os == 'macos-latest' }} run: | + # https://github.com/Homebrew/homebrew-core/issues/130258 ln -sv $(brew --prefix zlib)/lib/libz.dylib $(brew --prefix)/lib/libzlib.dylib brew install mysql export PATH=$PATH:/usr/local/mysql/bin @@ -287,6 +288,7 @@ jobs: - name: Install mysql in macos if: ${{ matrix.os == 'macos-latest' }} run: | + # https://github.com/Homebrew/homebrew-core/issues/130258 ln -sv $(brew --prefix zlib)/lib/libz.dylib $(brew --prefix)/lib/libzlib.dylib brew install mysql - name: Run test on ${{ matrix.os }} @@ -404,6 +406,7 @@ jobs: 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