NETTİM
← Kod Sonuçlarına Dön
YAML MariaDB SQL sorguları Veritabanı bağlantıları Dosya yükleme Görsel işlemleri Veri dönüştürme Ağ işlemleri Yapılandırma dosyaları Lisans: MIT

YAML — tests.yml

YAML MariaDB entegrasyonlu — SQL sorguları, Veritabanı bağlantıları, Dosya yükleme. SQL sorgusu içerir.
.github/workflows/tests.yml • YAML
name: Tests

on:
  push:
  pull_request:

jobs:
  phpstan:
    name: PHPStan Static Analysis (PHP ${{ matrix.php }})
    runs-on: ubuntu-latest
    strategy:
      fail-fast: false
      matrix:
        php: ['8.4', '8.5']
    steps:
      - uses: actions/checkout@v4
      - uses: shivammathur/setup-php@v2
        with:
          php-version: ${{ matrix.php }}
          extensions: pdo, pdo_mysql, pdo_pgsql, pdo_sqlite, pdo_oci
          coverage: none
      - run: composer validate --strict --no-check-publish
      - run: composer pdodb:check-doc-links
      - run: composer install --no-interaction --prefer-dist
      - run: vendor/bin/phpstan diagnose
      - run: composer pdodb:phpstan
      - run: composer pdodb:cs-check
        if: matrix.php == '8.4'
      - run: composer pdodb:api-surface
        if: matrix.php == '8.4'

  mysql:
    name: MySQL Tests (PHP ${{ matrix.php }})
    runs-on: ubuntu-latest
    strategy:
      fail-fast: false
      matrix:
        php: ['8.4', '8.5']
    services:
      mysql:
        image: mysql:8.0
        env:
          MYSQL_DATABASE: testdb
          MYSQL_USER: testuser
          MYSQL_PASSWORD: testpass
          MYSQL_ROOT_PASSWORD: root
        ports:
          - 3306:3306
        options: >-
          --health-cmd="mysqladmin ping -h 127.0.0.1 -uroot -proot"
          --health-interval=10s
          --health-timeout=5s
          --health-retries=3
      redis:
        image: redis:7-alpine
        ports:
          - 6379:6379
        options: >-
          --health-cmd "redis-cli ping"
          --health-interval 10s
          --health-timeout 5s
          --health-retries 5
      memcached:
        image: memcached:1.6-alpine
        ports:
          - 11211:11211
        options: >-
          --health-cmd "echo 'stats' | nc localhost 11211"
          --health-interval 10s
          --health-timeout 5s
          --health-retries 5
    steps:
      - uses: actions/checkout@v4
      - uses: shivammathur/setup-php@v2
        with:
          php-version: ${{ matrix.php }}
          extensions: pdo_mysql, simplexml, xmlreader, redis, memcached, apcu
          coverage: xdebug
      - run: composer install --no-interaction --prefer-dist
      - name: Enable MySQL local_infile and triggers for a non-SUPER user
        run: |
          mysql -h 127.0.0.1 -uroot -proot -e "SET GLOBAL local_infile=1; SET GLOBAL log_bin_trust_function_creators=1;"
      - run: |
          PDODB_DSN="mysql:host=127.0.0.1;port=3306;dbname=testdb;charset=utf8mb4" \
          PDODB_USERNAME="testuser" \
          PDODB_PASSWORD="testpass" \
          vendor/bin/phpunit --testsuite="MySQL Tests" --coverage-clover coverage-mysql.xml
      - name: Test MySQL integration and dialect regressions
        run: |
          vendor/bin/phpunit --testsuite="Integration Tests" --no-coverage --filter '/^(?!.*with data set ).*$|with data set "mysql"/'
          php scripts/test-dialect-regressions.php mysql
      - name: Test MySQL Examples
        run: ./scripts/test-examples.sh --verbose
      - name: Upload MySQL coverage to Codecov
        if: matrix.php == '8.4'
        uses: codecov/codecov-action@v4
        with:
          token: ${{ secrets.CODECOV_TOKEN }}
          files: ./coverage-mysql.xml
          flags: mysql
          name: mysql-coverage

  mariadb:
    name: MariaDB Tests (PHP ${{ matrix.php }})
    runs-on: ubuntu-latest
    strategy:
      fail-fast: false
      matrix:
        php: ['8.4', '8.5']
    services:
      mariadb:
        image: mariadb:11.2
        env:
          MYSQL_DATABASE: testdb
          MYSQL_USER: testuser
          MYSQL_PASSWORD: testpass
          MYSQL_ROOT_PASSWORD: root
        ports:
          - 3305:3306
        options: >-
          --health-cmd="healthcheck.sh --connect --innodb_initialized"
          --health-interval=5s
          --health-timeout=10s
          --health-retries=20
          --health-start-period=40s
      redis:
        image: redis:7-alpine
        ports:
          - 6379:6379
        options: >-
          --health-cmd "redis-cli ping"
          --health-interval 10s
          --health-timeout 5s
          --health-retries 5
      memcached:
        image: memcached:1.6-alpine
        ports:
          - 11211:11211
        options: >-
          --health-cmd "echo 'stats' | nc localhost 11211"
          --health-interval 10s
          --health-timeout 5s
          --health-retries 5
    steps:
      - uses: actions/checkout@v4
      - uses: shivammathur/setup-php@v2
        with:
          php-version: ${{ matrix.php }}
          extensions: pdo_mysql, simplexml, xmlreader, redis, memcached, apcu
          coverage: xdebug
      - run: composer install --no-interaction --prefer-dist
      - run: |
          PDODB_DSN="mariadb:host=127.0.0.1;port=3305;dbname=testdb;charset=utf8mb4" \
          PDODB_USERNAME="testuser" \
          PDODB_PASSWORD="testpass" \
          vendor/bin/phpunit --testsuite="MariaDB Tests" --coverage-clover coverage-mariadb.xml
      - name: Test MariaDB integration and dialect regressions
        run: |
          vendor/bin/phpunit --testsuite="Integration Tests" --no-coverage --filter '/^(?!.*with data set ).*$|with data set "mariadb"/'
          php scripts/test-dialect-regressions.php mariadb
      - name: Test MariaDB Examples
        run: |
          export PDODB_DRIVER=mariadb
          export PDODB_USERNAME="testuser"
          export PDODB_PASSWORD="testpass"
          export PDODB_HOST="127.0.0.1"
          export PDODB_PORT="3305"
          export PDODB_DATABASE="testdb"
          ./scripts/test-examples.sh --verbose
      - name: Upload MariaDB coverage to Codecov
        if: matrix.php == '8.4'
        uses: codecov/codecov-action@v4
        with:
          token: ${{ secrets.CODECOV_TOKEN }}
          files: ./coverage-mariadb.xml
          flags: mariadb
          name: mariadb-coverage

  postgres:
    name: PostgreSQL Tests (PHP ${{ matrix.php }})
    runs-on: ubuntu-latest
    strategy:
      fail-fast: false
      matrix:
        php: ['8.4', '8.5']
    services:
      postgres:
        image: postgres:16
        env:
          POSTGRES_DB: testdb
          POSTGRES_USER: postgres
          POSTGRES_PASSWORD: postgres
        ports:
          - 5433:5432
        options: >-
          --health-cmd="pg_isready -U postgres -d testdb"
          --health-interval=10s
          --health-timeout=5s
          --health-retries=5
      redis:
        image: redis:7-alpine
        ports:
          - 6379:6379
        options: >-
          --health-cmd "redis-cli ping"
          --health-interval 10s
          --health-timeout 5s
          --health-retries 5
      memcached:
        image: memcached:1.6-alpine
        ports:
          - 11211:11211
        options: >-
          --health-cmd "echo 'stats' | nc localhost 11211"
          --health-interval 10s
          --health-timeout 5s
          --health-retries 5
    steps:
      - uses: actions/checkout@v4
      - uses: shivammathur/setup-php@v2
        with:
          php-version: ${{ matrix.php }}
          extensions: pdo_pgsql, simplexml, xmlreader, redis, memcached, apcu
          coverage: xdebug
      - run: composer install --no-interaction --prefer-dist
      - name: Setup PostgreSQL test user
        run: |
          PGPASSWORD=postgres psql -h localhost -p 5433 -U postgres -d testdb -c "CREATE USER testuser WITH PASSWORD 'testpass';"
          PGPASSWORD=postgres psql -h localhost -p 5433 -U postgres -d testdb -c "GRANT ALL PRIVILEGES ON DATABASE testdb TO testuser;"
          PGPASSWORD=postgres psql -h localhost -p 5433 -U postgres -d testdb -c "GRANT ALL ON SCHEMA public TO testuser;"
      - run: |
          PDODB_DSN="pgsql:host=localhost;port=5433;dbname=testdb" \
          PDODB_USERNAME="testuser" \
          PDODB_PASSWORD="testpass" \
          vendor/bin/phpunit --testsuite="PostgreSQL Tests" --coverage-clover coverage-postgres.xml
      - name: Test PostgreSQL integration and dialect regressions
        run: |
          vendor/bin/phpunit --testsuite="Integration Tests" --no-coverage --filter '/^(?!.*with data set ).*$|with data set "postgresql"/'
          php scripts/test-dialect-regressions.php postgresql
      - name: Test PostgreSQL Examples
        run: ./scripts/test-examples.sh --verbose
      - name: Upload PostgreSQL coverage to Codecov
        if: matrix.php == '8.4'
        uses: codecov/codecov-action@v4
        with:
          token: ${{ secrets.CODECOV_TOKEN }}
          files: ./coverage-postgres.xml
          flags: postgres
          name: postgres-coverage

  sqlite:
    name: SQLite Tests (PHP ${{ matrix.php }})
    runs-on: ubuntu-latest
    strategy:
      fail-fast: false
      matrix:
        php: ['8.4', '8.5']
    services:
      redis:
        image: redis:7-alpine
        ports:
          - 6379:6379
        options: >-
          --health-cmd "redis-cli ping"
          --health-interval 10s
          --health-timeout 5s
          --health-retries 5
      memcached:
        image: memcached:1.6-alpine
        ports:
          - 11211:11211
        options: >-
          --health-cmd "echo 'stats' | nc localhost 11211"
          --health-interval 10s
          --health-timeout 5s
          --health-retries 5
    steps:
      - uses: actions/checkout@v4
      - uses: shivammathur/setup-php@v2
        with:
          php-version: ${{ matrix.php }}
          extensions: pdo_sqlite, redis, memcached, apcu
          coverage: xdebug
      - run: composer install --no-interaction --prefer-dist
      - run: |
          PDODB_DSN="sqlite::memory:" \
          vendor/bin/phpunit --testsuite="SQLite Tests" --coverage-clover coverage-sqlite.xml
      - name: Test SQLite integration and dialect regressions
        run: |
          vendor/bin/phpunit --testsuite="Integration Tests" --no-coverage --filter '/^(?!.*with data set ).*$|with data set "sqlite"/'
          php scripts/test-dialect-regressions.php sqlite
      - name: Test SQLite Examples
        run: ./scripts/test-examples.sh  --verbose
      - name: Upload SQLite coverage to Codecov
        if: matrix.php == '8.4'
        uses: codecov/codecov-action@v4
        with:
          token: ${{ secrets.CODECOV_TOKEN }}
          files: ./coverage-sqlite.xml
          flags: sqlite
          name: sqlite-coverage

  php85:
    name: PHP 8.5 shared tests
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v4
      - uses: shivammathur/setup-php@v2
        with:
          php-version: '8.5'
          extensions: pdo_sqlite, apcu
          coverage: none
      - run: composer install --no-interaction --prefer-dist
      - run: vendor/bin/phpunit --testsuite="Shared Tests"

  mssql:
    name: MSSQL Tests (PHP ${{ matrix.php }})
    runs-on: ubuntu-latest
    continue-on-error: ${{ matrix.experimental }}
    strategy:
      fail-fast: false
      matrix:
        include:
          - php: '8.4'
            experimental: false
          # the pecl builds of pdo_sqlsrv and pdo_oci used below are not known to support 8.5 yet: reported, not blocking
          - php: '8.5'
            experimental: true
    services:
      mssql:
        image: mcr.microsoft.com/mssql/server:2022-latest
        env:
          ACCEPT_EULA: Y
          MSSQL_SA_PASSWORD: Test123!@#
          MSSQL_PID: Developer
        ports:
          - 1433:1433
      redis:
        image: redis:7-alpine
        ports:
          - 6379:6379
        options: >-
          --health-cmd "redis-cli ping"
          --health-interval 10s
          --health-timeout 5s
          --health-retries 5
      memcached:
        image: memcached:1.6-alpine
        ports:
          - 11211:11211
        options: >-
          --health-cmd "echo 'stats' | nc localhost 11211"
          --health-interval 10s
          --health-timeout 5s
          --health-retries 5
    steps:
      - uses: actions/checkout@v4
      - uses: shivammathur/setup-php@v2
        with:
          php-version: ${{ matrix.php }}
          extensions: pdo, pdo_odbc, odbc, redis, memcached, apcu
          coverage: xdebug
      - name: Install Microsoft ODBC Driver and SQL Server Tools
        run: |
          # apt-key is gone from Ubuntu 24.04: the Microsoft package installs the signing key and the repository
          curl -sSL -o /tmp/packages-microsoft-prod.deb "https://packages.microsoft.com/config/ubuntu/$(lsb_release -rs)/packages-microsoft-prod.deb"
          sudo dpkg -i /tmp/packages-microsoft-prod.deb
          sudo apt-get update
          sudo ACCEPT_EULA=Y apt-get install -y msodbcsql18 unixodbc-dev mssql-tools18
          echo 'export PATH="$PATH:/opt/mssql-tools18/bin"' >> ~/.bashrc
          export PATH="$PATH:/opt/mssql-tools18/bin"
      - name: Install pdo_sqlsrv extension
        run: |
          if ! php -m | grep -q pdo_sqlsrv; then
            sudo pecl install pdo_sqlsrv-5.11.1 || sudo pecl install -f pdo_sqlsrv-5.11.1
            echo "extension=pdo_sqlsrv.so" | sudo tee "$(php -r 'echo PHP_CONFIG_FILE_SCAN_DIR;')/pdo_sqlsrv.ini"
          fi
          php -m | grep -q pdo_sqlsrv || { echo "pdo_sqlsrv extension is not loaded"; exit 1; }
      - name: Wait for MSSQL to be ready
        run: |
          export PATH="$PATH:/opt/mssql-tools18/bin"
          echo "Waiting for MSSQL to be ready..."
          for i in {1..120}; do
            if sqlcmd -S localhost -U sa -P 'Test123!@#' -C -Q 'SELECT 1' -b > /dev/null 2>&1; then
              echo "MSSQL is ready!"
              sqlcmd -S localhost -U sa -P 'Test123!@#' -C -Q 'SELECT @@VERSION' -b
              break
            fi
            if [ $i -eq 120 ]; then
              echo "MSSQL failed to start after 240 seconds"
              exit 1
            fi
            echo "Waiting for MSSQL... ($i/120)"
            sleep 2
          done
      - name: Create database
        run: |
          export PATH="$PATH:/opt/mssql-tools18/bin"
          # Create database (ignore error if exists)
          sqlcmd -S localhost -U sa -P 'Test123!@#' -C -Q "IF NOT EXISTS (SELECT * FROM sys.databases WHERE name = 'testdb') CREATE DATABASE testdb;" || true
          echo "Database 'testdb' ready"
      - run: composer install --no-interaction --prefer-dist
      - run: |
          PDODB_DSN="sqlsrv:Server=localhost,1433;Database=testdb;TrustServerCertificate=yes" \
          PDODB_USERNAME="sa" \
          PDODB_PASSWORD="Test123!@#" \
          vendor/bin/phpunit --testsuite="MSSQL Tests" --coverage-clover coverage-mssql.xml
      - name: Test MSSQL integration and dialect regressions
        env:
          PDODB_USERNAME: sa
          PDODB_PASSWORD: "Test123!@#"
        run: |
          vendor/bin/phpunit --testsuite="Integration Tests" --no-coverage --filter '/^(?!.*with data set ).*$|with data set "mssql"/'
          php scripts/test-dialect-regressions.php mssql
      - name: Test MSSQL Examples
        run: |
          export PDODB_DRIVER=sqlsrv
          export PDODB_USERNAME="sa"
          export PDODB_PASSWORD="Test123!@#"
          export PDODB_HOST="localhost"
          export PDODB_PORT="1433"
          export PDODB_DATABASE="testdb"
          ./scripts/test-examples.sh --verbose
      - name: Upload MSSQL coverage to Codecov
        if: matrix.php == '8.4'
        uses: codecov/codecov-action@v4
        with:
          token: ${{ secrets.CODECOV_TOKEN }}
          files: ./coverage-mssql.xml
          flags: mssql
          name: mssql-coverage

  oracle:
    name: Oracle Tests (PHP ${{ matrix.php }})
    runs-on: ubuntu-latest
    continue-on-error: ${{ matrix.experimental }}
    strategy:
      fail-fast: false
      matrix:
        include:
          - php: '8.4'
            experimental: false
          # the pecl builds of pdo_sqlsrv and pdo_oci used below are not known to support 8.5 yet: reported, not blocking
          - php: '8.5'
            experimental: true
    services:
      oracle:
        image: gvenzl/oracle-xe:21-slim
        env:
          ORACLE_PASSWORD: System123456
        ports:
          - 1521:1521
          - 5500:5500
        options: >-
          --health-cmd="healthcheck.sh"
          --health-interval=30s
          --health-timeout=10s
          --health-retries=10
          --health-start-period=5m
      redis:
        image: redis:7-alpine
        ports:
          - 6379:6379
        options: >-
          --health-cmd "redis-cli ping"
          --health-interval 10s
          --health-timeout 5s
          --health-retries 5
      memcached:
        image: memcached:1.6-alpine
        ports:
          - 11211:11211
        options: >-
          --health-cmd "echo 'stats' | nc localhost 11211"
          --health-interval 10s
          --health-timeout 5s
          --health-retries 5
    steps:
      - uses: actions/checkout@v4
      - uses: shivammathur/setup-php@v2
        with:
          php-version: ${{ matrix.php }}
          extensions: pdo, redis, memcached, apcu, bz2
          coverage: xdebug
      - name: Install Oracle dependencies
        run: |
          # Check if packages are already installed (common in GitHub Actions runners)
          if ! command -v wget >/dev/null 2>&1; then
            sudo apt-get update && sudo apt-get install -y wget
          fi
          if ! command -v unzip >/dev/null 2>&1; then
            sudo apt-get update && sudo apt-get install -y unzip
          fi
          # Install libaio only if not installed
          if ! dpkg-query -W -f='${Status}' libaio1t64 2>/dev/null | grep -q "install ok installed"; then
            if ! dpkg-query -W -f='${Status}' libaio1 2>/dev/null | grep -q "install ok installed"; then
              sudo apt-get update && (sudo apt-get install -y libaio1t64 || sudo apt-get install -y libaio1)
            fi
          fi
          # Create symlink for compatibility with Oracle Instant Client (Ubuntu 24.04+)
          if [ -f /usr/lib/x86_64-linux-gnu/libaio.so.1t64 ] && [ ! -L /usr/lib/x86_64-linux-gnu/libaio.so.1 ]; then
            sudo ln -sf /usr/lib/x86_64-linux-gnu/libaio.so.1t64 /usr/lib/x86_64-linux-gnu/libaio.so.1
          fi
      - name: Install Oracle Instant Client
        run: |
          cd /tmp
          # Download Oracle Instant Client Basic (libraries)
          ORACLE_BASIC_URL="https://download.oracle.com/otn_software/linux/instantclient/2326000/instantclient-basic-linux.x64-23.26.0.0.0.zip"
          echo "Downloading Oracle Instant Client Basic from: $ORACLE_BASIC_URL"
          wget --timeout=30 --tries=3 --progress=bar:force "$ORACLE_BASIC_URL"
          unzip -o -q instantclient-basic-linux.x64-23.26.0.0.0.zip
          
          # Download Oracle Instant Client SDK (headers needed for pdo_oci compilation)
          ORACLE_SDK_URL="https://download.oracle.com/otn_software/linux/instantclient/2326000/instantclient-sdk-linux.x64-23.26.0.0.0.zip"
          echo "Downloading Oracle Instant Client SDK from: $ORACLE_SDK_URL"
          wget --timeout=30 --tries=3 --progress=bar:force "$ORACLE_SDK_URL"
          unzip -o -q instantclient-sdk-linux.x64-23.26.0.0.0.zip
          
          # Install to /usr/lib/oracle/23/client64
          sudo mkdir -p /usr/lib/oracle/23/client64
          sudo mv instantclient_23_26/* /usr/lib/oracle/23/client64/
          
          echo '/usr/lib/oracle/23/client64' | sudo tee /etc/ld.so.conf.d/oracle-instantclient.conf
          sudo ldconfig
          
          if [ ! -f /usr/lib/oracle/23/client64/libclntsh.so ] || [ ! -f /usr/lib/oracle/23/client64/sdk/include/oci.h ]; then
            exit 1
          fi
      - name: Install oci8 and pdo_oci extensions
        run: |
          export ORACLE_HOME=/usr/lib/oracle/23/client64
          export LD_LIBRARY_PATH=$ORACLE_HOME:$LD_LIBRARY_PATH
          export C_INCLUDE_PATH=$ORACLE_HOME/sdk/include:$C_INCLUDE_PATH
          export CPPFLAGS="-I$ORACLE_HOME/sdk/include"
          export LDFLAGS="-L$ORACLE_HOME -Wl,-rpath,$ORACLE_HOME"
          
          sudo ldconfig
          
          # php --ini prints the paths in quotes since PHP 8.5, so take the scan directory from PHP itself
          PHP_INI_DIR=$(dirname "$(php -r 'echo PHP_CONFIG_FILE_SCAN_DIR;')")
          sudo mkdir -p "$PHP_INI_DIR/conf.d"
          
          if ! php -m | grep -qi '^oci8$'; then
            echo "instantclient,$ORACLE_HOME" | sudo -E env C_INCLUDE_PATH="$C_INCLUDE_PATH" CPPFLAGS="$CPPFLAGS" LDFLAGS="$LDFLAGS" LD_LIBRARY_PATH="$LD_LIBRARY_PATH" pecl install oci8 || echo "instantclient,$ORACLE_HOME" | sudo -E env C_INCLUDE_PATH="$C_INCLUDE_PATH" CPPFLAGS="$CPPFLAGS" LDFLAGS="$LDFLAGS" LD_LIBRARY_PATH="$LD_LIBRARY_PATH" pecl install -f oci8
            echo "extension=oci8.so" | sudo tee "$PHP_INI_DIR/conf.d/oci8.ini" > /dev/null
            sudo ldconfig
          fi
          
          if ! php -m | grep -qi '^pdo_oci$'; then
            echo "instantclient,$ORACLE_HOME" | sudo -E env C_INCLUDE_PATH="$C_INCLUDE_PATH" CPPFLAGS="$CPPFLAGS" LDFLAGS="$LDFLAGS" LD_LIBRARY_PATH="$LD_LIBRARY_PATH" pecl install pdo_oci || echo "instantclient,$ORACLE_HOME" | sudo -E env C_INCLUDE_PATH="$C_INCLUDE_PATH" CPPFLAGS="$CPPFLAGS" LDFLAGS="$LDFLAGS" LD_LIBRARY_PATH="$LD_LIBRARY_PATH" pecl install -f pdo_oci
            echo "extension=pdo_oci.so" | sudo tee "$PHP_INI_DIR/conf.d/pdo_oci.ini" > /dev/null
            sudo ldconfig
          fi
          
          if ! php -m | grep -qi '^pdo_oci$'; then
            echo "pdo_oci extension is not loaded"
            php --ini
            ls -l "$PHP_INI_DIR/conf.d" | grep -i -E "oci|pdo" || true
            EXT_DIR=$(php -r 'echo ini_get("extension_dir");')
            ls -l "$EXT_DIR" | grep -i -E "oci|pdo" || true
            ldd "$EXT_DIR/pdo_oci.so" | grep "not found" || echo "all libraries of pdo_oci.so resolve"
            php -d display_errors=stderr -d display_startup_errors=1 -d extension=pdo_oci.so -r 'echo "loaded\n";' 2>&1 | head -5
            exit 1
          fi
      - name: Wait for Oracle to be ready
        run: |
          export ORACLE_HOME=/usr/lib/oracle/23/client64
          export LD_LIBRARY_PATH=$ORACLE_HOME:$LD_LIBRARY_PATH
          export PATH=$ORACLE_HOME:$PATH
          echo "Waiting for Oracle to be ready..."
          # Install sqlplus for health check
          cd /tmp
          wget -q https://download.oracle.com/otn_software/linux/instantclient/2326000/instantclient-sqlplus-linux.x64-23.26.0.0.0.zip
          unzip -o -q instantclient-sqlplus-linux.x64-23.26.0.0.0.zip
          sudo mv instantclient_23_26/sqlplus /usr/local/bin/
          sudo mv instantclient_23_26/* $ORACLE_HOME/
          sudo ldconfig
          for i in {1..120}; do
            if echo "SELECT 1 FROM DUAL;" | sqlplus -S system/System123456@localhost:1521/XEPDB1 2>&1 | grep -q "1"; then
              echo "Oracle is ready!"
              echo "SELECT * FROM v\$version;" | sqlplus -S system/System123456@localhost:1521/XEPDB1 2>&1 | head -5
              break
            fi
            if [ $i -eq 120 ]; then
              echo "Oracle failed to start after 240 seconds"
              exit 1
            fi
            echo "Waiting for Oracle... ($i/120)"
            sleep 2
          done
      - name: Setup Oracle test user
        run: |
          export ORACLE_HOME=/usr/lib/oracle/23/client64
          export LD_LIBRARY_PATH=$ORACLE_HOME:$LD_LIBRARY_PATH
          export PATH=$ORACLE_HOME:$PATH
          # Connect to XEPDB1 PDB and create testuser
          sqlplus -S system/System123456@localhost:1521/XEPDB1 <<EOF
          ALTER SESSION SET CONTAINER=XEPDB1;
          -- Drop user if exists (ignore errors)
          BEGIN
            EXECUTE IMMEDIATE 'DROP USER testuser CASCADE';
          EXCEPTION
            WHEN OTHERS THEN NULL;
          END;
          /
          -- Create user
          CREATE USER testuser IDENTIFIED BY testpass;
          GRANT CONNECT, RESOURCE TO testuser;
          ALTER USER testuser QUOTA UNLIMITED ON USERS;
          EXIT;
          EOF
          echo "Oracle user 'testuser' created successfully"
      - run: composer install --no-interaction --prefer-dist
      - run: |
          export ORACLE_HOME=/usr/lib/oracle/23/client64
          export LD_LIBRARY_PATH=$ORACLE_HOME:$LD_LIBRARY_PATH
          export PDODB_DRIVER=oci
          export PDODB_HOST=localhost
          export PDODB_PORT=1521
          export PDODB_USERNAME=testuser
          export PDODB_PASSWORD=testpass
          export PDODB_SERVICE_NAME=XEPDB1
          vendor/bin/phpunit --testsuite="Oracle Tests" --coverage-clover coverage-oracle.xml
      - name: Test Oracle integration and dialect regressions
        env:
          ORACLE_HOME: /usr/lib/oracle/23/client64
          LD_LIBRARY_PATH: /usr/lib/oracle/23/client64
          PDODB_HOST: localhost
          PDODB_PORT: "1521"
          PDODB_USERNAME: testuser
          PDODB_PASSWORD: testpass
          PDODB_SERVICE_NAME: XEPDB1
        run: |
          vendor/bin/phpunit --testsuite="Integration Tests" --no-coverage --filter '/^(?!.*with data set ).*$|with data set "oracle"/'
          php scripts/test-dialect-regressions.php oracle
      - name: Test Oracle Examples
        run: |
          export ORACLE_HOME=/usr/lib/oracle/23/client64
          export LD_LIBRARY_PATH=$ORACLE_HOME:$LD_LIBRARY_PATH
          export PDODB_DRIVER=oci
          export PDODB_USERNAME="testuser"
          export PDODB_PASSWORD="testpass"
          export PDODB_HOST="localhost"
          export PDODB_PORT="1521"
          export PDODB_SERVICE_NAME="XEPDB1"
          ./scripts/test-examples.sh --verbose
      - name: Upload Oracle coverage to Codecov
        if: matrix.php == '8.4'
        uses: codecov/codecov-action@v4
        with:
          token: ${{ secrets.CODECOV_TOKEN }}
          files: ./coverage-oracle.xml
          flags: oracle
          name: oracle-coverage

  shared-coverage:
    name: Shared Coverage Tests
    runs-on: ubuntu-latest
    services:
      redis:
        image: redis:7-alpine
        ports:
          - 6379:6379
        options: >-
          --health-cmd "redis-cli ping"
          --health-interval 10s
          --health-timeout 5s
          --health-retries 5
      memcached:
        image: memcached:1.6-alpine
        ports:
          - 11211:11211
        options: >-
          --health-cmd "echo 'stats' | nc localhost 11211"
          --health-interval 10s
          --health-timeout 5s
          --health-retries 5
    steps:
      - uses: actions/checkout@v4
      - uses: shivammathur/setup-php@v2
        with:
          php-version: '8.4'
          extensions: pdo_sqlite, redis, memcached, apcu
          coverage: xdebug
      - run: composer install --no-interaction --prefer-dist
      - run: vendor/bin/phpunit --testsuite="Shared Tests" --coverage-clover coverage-shared.xml
      - name: Upload Shared coverage to Codecov
        uses: codecov/codecov-action@v4
        with:
          token: ${{ secrets.CODECOV_TOKEN }}
          files: ./coverage-shared.xml
          flags: shared
          name: shared-coverage

Tespit Edilen SQL Sorguları

with data set ).*$|with data set
with data set ).*$|with data set
WITH PASSWORD 'testpass'
with data set ).*$|with data set
with data set ).*$|with data set
SELECT 1' -b > /dev/null 2>&1
SELECT @@VERSION' -b
SELECT * FROM sys.databases WHERE name = 'testdb') CREATE DATABASE testdb

Benzer Kod Örnekleri

YAML — feature_request.yml
YAML • SQL sorguları
YAML — config.yml
YAML • SQL sorguları
YAML — bug_report.yml
YAML • SQL sorguları
YAML — .gitlab-ci.yml
YAML • SQL sorguları