1
0
mirror of https://github.com/php/php-src.git synced 2026-03-24 00:02:20 +01:00

Merge branch 'PHP-8.1' into PHP-8.2

* PHP-8.1:
  Migrate libmysqlclient job to GitHub actions
This commit is contained in:
Ilija Tovilo
2022-09-25 16:40:35 +02:00
6 changed files with 99 additions and 91 deletions

View File

@@ -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

View File

@@ -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

View File

@@ -461,3 +461,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

View File

@@ -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'

View File

@@ -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

View File

@@ -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())