|
| 1 | +parameters: |
| 2 | + configurationName: '' |
| 3 | + configurationParameters: '' |
| 4 | + libmysql: '' |
| 5 | + |
| 6 | +steps: |
| 7 | + - script: | |
| 8 | + set -e |
| 9 | + LIBMYSQL=${{ parameters.libmysql }} |
| 10 | + MYSQL_BASE=${LIBMYSQL%%-linux-*} |
| 11 | + MYSQL_VERSION=${MYSQL_BASE#*-} |
| 12 | + MYSQL_DIR=$HOME/$MYSQL_BASE |
| 13 | + mkdir -p $MYSQL_DIR |
| 14 | + URL=https://cdn.mysql.com/Downloads/MySQL-${MYSQL_VERSION%.*}/$LIBMYSQL |
| 15 | + wget -nv $URL |
| 16 | + tar -xf $LIBMYSQL --strip-components=1 -C $MYSQL_DIR |
| 17 | + PDO_MYSQL=${MYSQL_DIR} |
| 18 | + MYSQLI=${MYSQL_DIR}/bin/mysql_config |
| 19 | + ./buildconf --force |
| 20 | + ./configure ${{ parameters.configurationParameters }} \ |
| 21 | + --enable-option-checking=fatal \ |
| 22 | + --disable-all \ |
| 23 | + --enable-pdo \ |
| 24 | + --with-pdo-mysql=${PDO_MYSQL} \ |
| 25 | + --with-mysqli=${MYSQLI} |
| 26 | + make clean |
| 27 | + make -j$(/usr/bin/nproc) >/dev/null |
| 28 | + displayName: 'Build ${{ parameters.configurationName }}' |
| 29 | + condition: or(succeeded(), failed()) |
| 30 | + - script: | |
| 31 | + export MYSQL_TEST_USER=root |
| 32 | + export MYSQL_TEST_PASSWD=root |
| 33 | + export PDO_MYSQL_TEST_DSN="mysql:host=127.0.0.1;dbname=test" |
| 34 | + export PDO_MYSQL_TEST_HOST=127.0.0.1 |
| 35 | + export PDO_MYSQL_TEST_USER=root |
| 36 | + export PDO_MYSQL_TEST_PASS=root |
| 37 | + export TEST_PHP_JUNIT=junit.xml |
| 38 | + export REPORT_EXIT_STATUS=no |
| 39 | + rm -rf junit.xml | true |
| 40 | + sapi/cli/php run-tests.php -P -q \ |
| 41 | + -g FAIL,XFAIL,BORK,WARN,LEAK,XLEAK,SKIP \ |
| 42 | + --offline --show-diff --show-slow 1000 --set-timeout 120 \ |
| 43 | + ext/pdo_mysql |
| 44 | + displayName: 'Test ${{ parameters.configurationName }}' |
| 45 | + condition: or(succeeded(), failed()) |
| 46 | + - task: PublishTestResults@2 |
| 47 | + inputs: |
| 48 | + testResultsFormat: 'JUnit' |
| 49 | + testResultsFiles: junit.xml |
| 50 | + testRunTitle: '${{ parameters.configurationName }}' |
| 51 | + failTaskOnFailedTests: true |
| 52 | + displayName: 'Export ${{ parameters.configurationName }} Results' |
| 53 | + condition: or(succeeded(), failed()) |
0 commit comments