name: Test
inputs:
  runTestsParameters:
    default: ''
    required: false
runs:
  using: composite
  steps:
    - shell: bash
      run: |
        set -x
        export MYSQL_TEST_USER=root
        export MYSQL_TEST_PASSWD=root
        if [[ -z "$PDO_MYSQL_TEST_DSN" ]]; then
          export PDO_MYSQL_TEST_DSN="mysql:host=localhost;dbname=test"
        fi
        export PDO_MYSQL_TEST_USER=root
        export PDO_MYSQL_TEST_PASS=root
        export PDO_DBLIB_TEST_DSN="dblib:host=127.0.0.1;dbname=master;version=7.0"
        export PDO_DBLIB_TEST_USER="pdo_test"
        export PDO_DBLIB_TEST_PASS="password"
        export PHP_OCI8_TEST_USER="system"
        export PHP_OCI8_TEST_PASS="pass"
        export PHP_OCI8_TEST_DB="localhost/XEPDB1"
        export PDO_OCI_TEST_USER="system"
        export PDO_OCI_TEST_PASS="pass"
        export PDO_OCI_TEST_DSN="oci:dbname=localhost/XEPDB1;charset=AL32UTF8"
        export SKIP_IO_CAPTURE_TESTS=1
        sapi/cli/php run-tests.php -P -q ${{ inputs.runTestsParameters }} \
          -j$(/usr/bin/nproc) \
          -g FAIL,XFAIL,BORK,WARN,LEAK,XLEAK,SKIP \
          --offline \
          --show-diff \
          --show-slow 1000 \
          --set-timeout 120
