name: Test
inputs:
  runTestsParameters:
    default: ''
    required: false
  jitType:
    default: 'disable'
    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 PGSQL_TEST_CONNSTR="host=localhost dbname=test port=5432 user=postgres password=postgres"
        if [[ -z "$PDO_PGSQL_TEST_DSN" ]]; then
          export PDO_PGSQL_TEST_DSN="pgsql:host=localhost port=5432 dbname=test user=postgres password=postgres"
        fi
        export SKIP_IO_CAPTURE_TESTS=1
        sapi/cli/php run-tests.php -P -q ${{ inputs.runTestsParameters }} \
          -d opcache.jit=${{ inputs.jitType }} \
          -d opcache.jit_buffer_size=16M \
          -j$(/usr/bin/nproc) \
          -g FAIL,XFAIL,BORK,WARN,LEAK,XLEAK,SKIP \
          --offline \
          --show-diff \
          --show-slow 1000 \
          --set-timeout 120
