diff --git a/.github/actions/build-libmysqlclient/action.yml b/.github/actions/build-libmysqlclient/action.yml new file mode 100644 index 00000000000..b7d1b100cbe --- /dev/null +++ b/.github/actions/build-libmysqlclient/action.yml @@ -0,0 +1,32 @@ +name: Build libmysqlclient +inputs: + configurationParameters: + default: '' + required: false + libmysql: + required: true +runs: + using: composite + steps: + - shell: bash + run: | + set -x + LIBMYSQL=${{ inputs.libmysql }} + MYSQL_BASE=${LIBMYSQL%%-linux-*} + MYSQL_VERSION=${MYSQL_BASE#*-} + MYSQL_DIR=$HOME/$MYSQL_BASE + mkdir -p $MYSQL_DIR + URL=https://cdn.mysql.com/Downloads/MySQL-${MYSQL_VERSION%.*}/$LIBMYSQL + wget -nv $URL + tar -xf $LIBMYSQL --strip-components=1 -C $MYSQL_DIR + PDO_MYSQL=${MYSQL_DIR} + MYSQLI=${MYSQL_DIR}/bin/mysql_config + ./buildconf --force + ./configure ${{ inputs.configurationParameters }} \ + --enable-option-checking=fatal \ + --disable-all \ + --enable-pdo \ + --with-pdo-mysql=${PDO_MYSQL} \ + --with-mysqli=${MYSQLI} + make clean + make -j$(/usr/bin/nproc) >/dev/null diff --git a/.github/actions/test-libmysqlclient/action.yml b/.github/actions/test-libmysqlclient/action.yml new file mode 100644 index 00000000000..83c1f7573b9 --- /dev/null +++ b/.github/actions/test-libmysqlclient/action.yml @@ -0,0 +1,20 @@ +name: Test libmysqlclient +runs: + using: composite + steps: + - shell: bash + run: | + set -x + export MYSQL_TEST_USER=root + export MYSQL_TEST_PASSWD=root + export PDO_MYSQL_TEST_DSN="mysql:host=127.0.0.1;dbname=test" + export PDO_MYSQL_TEST_HOST=127.0.0.1 + export PDO_MYSQL_TEST_USER=root + export PDO_MYSQL_TEST_PASS=root + export TEST_PHP_JUNIT=junit.xml + export REPORT_EXIT_STATUS=no + rm -rf junit.xml | true + sapi/cli/php run-tests.php -P -q \ + -g FAIL,BORK,LEAK,XLEAK \ + --offline --show-diff --show-slow 1000 --set-timeout 120 \ + ext/pdo_mysql diff --git a/.github/workflows/nightly.yml b/.github/workflows/nightly.yml index 12c8690888a..5b6f573aa7a 100644 --- a/.github/workflows/nightly.yml +++ b/.github/workflows/nightly.yml @@ -464,3 +464,50 @@ jobs: -d opcache.enable_cli=1 - name: Verify generated files are up to date uses: ./.github/actions/verify-generated-files + LIBMYSQLCLIENT: + needs: GENERATE_MATRIX + if: ${{ needs.GENERATE_MATRIX.outputs.branches != '[]' }} + strategy: + fail-fast: false + matrix: + branch: ${{ fromJson(needs.GENERATE_MATRIX.outputs.branches) }} + name: "${{ matrix.branch.name }}_LIBMYSQLCLIENT" + runs-on: ubuntu-20.04 + steps: + - name: git checkout + uses: actions/checkout@v2 + with: + ref: ${{ matrix.branch.ref }} + - name: apt + run: | + sudo apt-get update -y | true + sudo apt install bison re2c + - name: Setup + run: | + sudo service mysql start + mysql -uroot -proot -e "CREATE DATABASE IF NOT EXISTS test" + # Ensure local_infile tests can run. + mysql -uroot -proot -e "SET GLOBAL local_infile = true" + # Does not support caching_sha2_auth :( + # - name: Build mysql-5.6 + # uses: ./.github/actions/build-libmysqlclient + # with: + # libmysql: mysql-5.6.49-linux-glibc2.12-x86_64.tar.gz + # - name: Test mysql-5.6 + # uses: ./.github/actions/test-libmysqlclient + - name: Build mysql-5.7 + uses: ./.github/actions/build-libmysqlclient + with: + libmysql: mysql-5.7.38-linux-glibc2.12-x86_64.tar.gz + - name: Test mysql-5.7 + uses: ./.github/actions/test-libmysqlclient + - name: Build mysql-8.0 + uses: ./.github/actions/build-libmysqlclient + with: + # FIXME: There are new warnings + # configurationParameters: --enable-werror + libmysql: mysql-8.0.30-linux-glibc2.12-x86_64.tar.xz + - name: Test mysql-8.0 + uses: ./.github/actions/test-libmysqlclient + - name: Verify generated files are up to date + uses: ./.github/actions/verify-generated-files diff --git a/azure-pipelines.yml b/azure-pipelines.yml index 472a754099d..ac4dbdbe6e2 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -46,7 +46,3 @@ jobs: parameters: configurationName: I386_RELEASE_ZTS configurationParameters: '--disable-debug --enable-zts' - - template: azure/libmysqlclient_job.yml - parameters: - configurationName: LIBMYSQLCLIENT_DEBUG_NTS - configurationParameters: '--enable-debug --disable-zts' diff --git a/azure/libmysqlclient_job.yml b/azure/libmysqlclient_job.yml deleted file mode 100644 index b44eb625f95..00000000000 --- a/azure/libmysqlclient_job.yml +++ /dev/null @@ -1,37 +0,0 @@ -parameters: - configurationName: '' - configurationParameters: '' - runTestsParameters: '' - timeoutInMinutes: 60 - -jobs: - - job: ${{ parameters.configurationName }} - timeoutInMinutes: ${{ parameters.timeoutInMinutes }} - pool: - vmImage: 'ubuntu-20.04' - steps: - - script: | - sudo apt-get update -y | true - sudo apt install bison re2c - displayName: 'APT' - - script: | - set -o - sudo service mysql start - mysql -uroot -proot -e "CREATE DATABASE IF NOT EXISTS test" - # Ensure local_infile tests can run. - mysql -uroot -proot -e "SET GLOBAL local_infile = true" - displayName: 'Setup MySQL server' - # Does not support caching_sha2_auth :( - #- template: libmysqlclient_test.yml - # parameters: - # configurationName: ${{ parameters.configurationName }} - MySQL 5.6.49 - # libmysql: mysql-5.6.49-linux-glibc2.12-x86_64.tar.gz - - template: libmysqlclient_test.yml - parameters: - configurationName: ${{ parameters.configurationName }} - MySQL 5.7.38 - libmysql: mysql-5.7.38-linux-glibc2.12-x86_64.tar.gz - - template: libmysqlclient_test.yml - parameters: - configurationName: ${{ parameters.configurationName }} - MySQL 8.0.30 - libmysql: mysql-8.0.30-linux-glibc2.12-x86_64.tar.xz - configurationParameters: ${{ parameters.configurationParameters }} --enable-werror diff --git a/azure/libmysqlclient_test.yml b/azure/libmysqlclient_test.yml deleted file mode 100644 index 34b091cee19..00000000000 --- a/azure/libmysqlclient_test.yml +++ /dev/null @@ -1,50 +0,0 @@ -parameters: - configurationName: '' - configurationParameters: '' - libmysql: '' - -steps: - - script: | - set -e - LIBMYSQL=${{ parameters.libmysql }} - MYSQL_BASE=${LIBMYSQL%%-linux-*} - MYSQL_VERSION=${MYSQL_BASE#*-} - MYSQL_DIR=$HOME/$MYSQL_BASE - mkdir -p $MYSQL_DIR - URL=https://cdn.mysql.com/Downloads/MySQL-${MYSQL_VERSION%.*}/$LIBMYSQL - wget -nv $URL - tar -xf $LIBMYSQL --strip-components=1 -C $MYSQL_DIR - PDO_MYSQL=${MYSQL_DIR} - ./buildconf --force - ./configure ${{ parameters.configurationParameters }} \ - --enable-option-checking=fatal \ - --disable-all \ - --enable-pdo \ - --with-pdo-mysql=${PDO_MYSQL} - make clean - make -j$(/usr/bin/nproc) >/dev/null - displayName: 'Build ${{ parameters.configurationName }}' - condition: or(succeeded(), failed()) - - script: | - export PDO_MYSQL_TEST_DSN="mysql:host=127.0.0.1;dbname=test" - export PDO_MYSQL_TEST_HOST=127.0.0.1 - export PDO_MYSQL_TEST_USER=root - export PDO_MYSQL_TEST_PASS=root - export TEST_PHP_JUNIT=junit.xml - export REPORT_EXIT_STATUS=no - rm -rf junit.xml | true - sapi/cli/php run-tests.php -P -q \ - -g FAIL,BORK,LEAK,XLEAK \ - --no-progress \ - --offline --show-diff --show-slow 1000 --set-timeout 120 \ - ext/pdo_mysql - displayName: 'Test ${{ parameters.configurationName }}' - condition: or(succeeded(), failed()) - - task: PublishTestResults@2 - inputs: - testResultsFormat: 'JUnit' - testResultsFiles: junit.xml - testRunTitle: '${{ parameters.configurationName }}' - failTaskOnFailedTests: true - displayName: 'Export ${{ parameters.configurationName }} Results' - condition: or(succeeded(), failed())