From a236fe4dfc4beddf5de810392d72d2e748eb4ac2 Mon Sep 17 00:00:00 2001 From: "Christoph M. Becker" Date: Tue, 13 Aug 2024 16:38:50 +0200 Subject: [PATCH 01/21] Setup CI workflow For now, only building pdo_oci on Windows for PHP 8.3, and running a very minimal smoke test. --- .github/workflows/ci.yml | 38 +++++++++++++++++++++++++++++++ .github/workflows/install-oci.ps1 | 11 +++++++++ 2 files changed, 49 insertions(+) create mode 100644 .github/workflows/ci.yml create mode 100644 .github/workflows/install-oci.ps1 diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml new file mode 100644 index 0000000..802607f --- /dev/null +++ b/.github/workflows/ci.yml @@ -0,0 +1,38 @@ +name: Build and Test +on: [push, pull_request] +jobs: + windows: + defaults: + run: + shell: cmd + strategy: + matrix: + version: ['8.3'] + arch: [x64] + ts: [ts] + runs-on: windows-2022 + steps: + - name: Checkout pdo_oci + uses: actions/checkout@v4 + - name: Setup PHP + id: setup-php + uses: php/setup-php-sdk@v0.9 + with: + version: ${{matrix.version}} + arch: ${{matrix.arch}} + ts: ${{matrix.ts}} + - name: Install OCI + run: powershell .github/workflows/install-oci.ps1 -arch ${{matrix.arch}} + - name: Enable Developer Command Prompt + uses: ilammy/msvc-dev-cmd@v1 + with: + arch: ${{matrix.arch}} + toolset: ${{steps.setup-php.outputs.toolset}} + - name: phpize + run: phpize + - name: configure + run: configure --with-pdo-oci=instantclient\sdk,shared --with-prefix=${{steps.setup-php.outputs.prefix}} + - name: make + run: nmake + - name: Run smoke test + run: deplister ext\php_pdo_oci.dll | grep OCI diff --git a/.github/workflows/install-oci.ps1 b/.github/workflows/install-oci.ps1 new file mode 100644 index 0000000..c186dc4 --- /dev/null +++ b/.github/workflows/install-oci.ps1 @@ -0,0 +1,11 @@ +param ( + [Parameter(Mandatory)] $arch +) + +$ErrorActionPreference = "Stop" + +$suffix = if ($arch -eq "x64") {"windows"} else {"nt"} +$url = "https://download.oracle.com/otn_software/nt/instantclient/instantclient-sdk-$suffix.zip" +Invoke-WebRequest $url -OutFile "instantclient-sdk.zip" +7z x "instantclient-sdk.zip" +Move-Item "instantclient_*" "instantclient" From adef15ede3f45cbdf2563cab74af19ac70bca7e9 Mon Sep 17 00:00:00 2001 From: "Christoph M. Becker" Date: Wed, 21 Aug 2024 16:59:35 +0200 Subject: [PATCH 02/21] Add basic Ubuntu job Building is not supposed to work because the libraries are missing. Where to get these? --- .github/workflows/ci.yml | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 802607f..4e9f9da 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -1,6 +1,32 @@ name: Build and Test on: [push, pull_request] jobs: + ubuntu: + strategy: + matrix: + version: ['8.3'] + runs-on: ubuntu-latest + steps: + - name: Setup Instantclient and SDK + run: | + curl -o instantclient-sdk.zip https://download.oracle.com/otn_software/linux/instantclient/instantclient-sdk-linuxx64.zip + unzip instantclient-sdk-linuxx64.zip + mv instantclient_* instantclient + - name: Show directory structure + run: tree instantclient + - name: Checkout pdo_oci + uses: actions/checkout@v4 + - name: Setup PHP + uses: shivammathur/setup-php@v2 + with: + php-version: ${{matrix.version}} + - name: Build pdo_oci + run: | + phpize + ./configure --with-pdo-oci=instantclient,/path/to/instant/client/lib + make +# - name: Test pdo_oci +# run: make test TESTS=tests windows: defaults: run: From d4ace750beb9b6d39b57408b3e8d37332e37b4b9 Mon Sep 17 00:00:00 2001 From: "Christoph M. Becker" Date: Wed, 21 Aug 2024 17:02:01 +0200 Subject: [PATCH 03/21] fix --- .github/workflows/ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 4e9f9da..4a24086 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -9,7 +9,7 @@ jobs: steps: - name: Setup Instantclient and SDK run: | - curl -o instantclient-sdk.zip https://download.oracle.com/otn_software/linux/instantclient/instantclient-sdk-linuxx64.zip + curl -O https://download.oracle.com/otn_software/linux/instantclient/instantclient-sdk-linuxx64.zip unzip instantclient-sdk-linuxx64.zip mv instantclient_* instantclient - name: Show directory structure From 3527cd6eb5429ee6f329a8292185dcc22b7e735f Mon Sep 17 00:00:00 2001 From: "Christoph M. Becker" Date: Wed, 21 Aug 2024 17:07:51 +0200 Subject: [PATCH 04/21] Also fetch isntantclient-basiclite --- .github/workflows/ci.yml | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 4a24086..6e66fdd 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -10,10 +10,14 @@ jobs: - name: Setup Instantclient and SDK run: | curl -O https://download.oracle.com/otn_software/linux/instantclient/instantclient-sdk-linuxx64.zip + curl -O https://download.oracle.com/otn_software/linux/instantclient/instantclient-basiclite-linuxx64.zip unzip instantclient-sdk-linuxx64.zip + unzip instantclient-basiclite-linuxx64.zip mv instantclient_* instantclient - name: Show directory structure - run: tree instantclient + run: | + ls + tree instantclient - name: Checkout pdo_oci uses: actions/checkout@v4 - name: Setup PHP From f25bac5c27b2cd25b833b8417fc1827591c5029f Mon Sep 17 00:00:00 2001 From: "Christoph M. Becker" Date: Wed, 21 Aug 2024 17:12:08 +0200 Subject: [PATCH 05/21] only extract instantclient* directories --- .github/workflows/ci.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 6e66fdd..e560f50 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -11,8 +11,8 @@ jobs: run: | curl -O https://download.oracle.com/otn_software/linux/instantclient/instantclient-sdk-linuxx64.zip curl -O https://download.oracle.com/otn_software/linux/instantclient/instantclient-basiclite-linuxx64.zip - unzip instantclient-sdk-linuxx64.zip - unzip instantclient-basiclite-linuxx64.zip + unzip instantclient-sdk-linuxx64.zip 'instantclient*/' + unzip instantclient-basiclite-linuxx64.zip 'instantclient*/' mv instantclient_* instantclient - name: Show directory structure run: | From f8597169679e0517864052a3fa9376ba0688ca7d Mon Sep 17 00:00:00 2001 From: "Christoph M. Becker" Date: Wed, 21 Aug 2024 17:25:15 +0200 Subject: [PATCH 06/21] fix --- .github/workflows/ci.yml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index e560f50..e9b5e2b 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -11,12 +11,12 @@ jobs: run: | curl -O https://download.oracle.com/otn_software/linux/instantclient/instantclient-sdk-linuxx64.zip curl -O https://download.oracle.com/otn_software/linux/instantclient/instantclient-basiclite-linuxx64.zip - unzip instantclient-sdk-linuxx64.zip 'instantclient*/' - unzip instantclient-basiclite-linuxx64.zip 'instantclient*/' + unzip instantclient-sdk-linuxx64.zip 'instantclient*/*' + unzip instantclient-basiclite-linuxx64.zip 'instantclient*/*' mv instantclient_* instantclient - name: Show directory structure run: | - ls + pwd tree instantclient - name: Checkout pdo_oci uses: actions/checkout@v4 @@ -27,7 +27,7 @@ jobs: - name: Build pdo_oci run: | phpize - ./configure --with-pdo-oci=instantclient,/path/to/instant/client/lib + ./configure --with-pdo-oci=instantclient,instantclient make # - name: Test pdo_oci # run: make test TESTS=tests From 11feaa210bb7e166fa542e4c0ef5635972708ad9 Mon Sep 17 00:00:00 2001 From: "Christoph M. Becker" Date: Wed, 21 Aug 2024 17:28:26 +0200 Subject: [PATCH 07/21] fox --- .github/workflows/ci.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index e9b5e2b..45c2276 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -16,6 +16,7 @@ jobs: mv instantclient_* instantclient - name: Show directory structure run: | + echo ${{GITHUB_WORKSPACE}} pwd tree instantclient - name: Checkout pdo_oci @@ -27,7 +28,7 @@ jobs: - name: Build pdo_oci run: | phpize - ./configure --with-pdo-oci=instantclient,instantclient + ./configure --with-pdo-oci=instantclient,${{GITHUB_WORKSPACE}}/instantclient make # - name: Test pdo_oci # run: make test TESTS=tests From 4c2ed600bf76f2b790374efa2f367c787d8bf758 Mon Sep 17 00:00:00 2001 From: "Christoph M. Becker" Date: Wed, 21 Aug 2024 17:30:12 +0200 Subject: [PATCH 08/21] moar --- .github/workflows/ci.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 45c2276..d20580a 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -16,7 +16,7 @@ jobs: mv instantclient_* instantclient - name: Show directory structure run: | - echo ${{GITHUB_WORKSPACE}} + echo ${{github.workspace}} pwd tree instantclient - name: Checkout pdo_oci @@ -28,7 +28,7 @@ jobs: - name: Build pdo_oci run: | phpize - ./configure --with-pdo-oci=instantclient,${{GITHUB_WORKSPACE}}/instantclient + ./configure --with-pdo-oci=instantclient,${{github.workspace}}/instantclient make # - name: Test pdo_oci # run: make test TESTS=tests From 782a168957a5bdd7b65fecf64c28348db31ffe84 Mon Sep 17 00:00:00 2001 From: "Christoph M. Becker" Date: Wed, 21 Aug 2024 17:50:16 +0200 Subject: [PATCH 09/21] lib/ --- .github/workflows/ci.yml | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index d20580a..7a642b1 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -10,10 +10,11 @@ jobs: - name: Setup Instantclient and SDK run: | curl -O https://download.oracle.com/otn_software/linux/instantclient/instantclient-sdk-linuxx64.zip - curl -O https://download.oracle.com/otn_software/linux/instantclient/instantclient-basiclite-linuxx64.zip unzip instantclient-sdk-linuxx64.zip 'instantclient*/*' - unzip instantclient-basiclite-linuxx64.zip 'instantclient*/*' mv instantclient_* instantclient + curl -O https://download.oracle.com/otn_software/linux/instantclient/instantclient-basiclite-linuxx64.zip + unzip instantclient-basiclite-linuxx64.zip 'instantclient*/*' + mv instantclient_* instantclient/sdk/lib - name: Show directory structure run: | echo ${{github.workspace}} @@ -28,7 +29,7 @@ jobs: - name: Build pdo_oci run: | phpize - ./configure --with-pdo-oci=instantclient,${{github.workspace}}/instantclient + ./configure --with-pdo-oci=instantclient,${{github.workspace}}/instantclient/sdk/ make # - name: Test pdo_oci # run: make test TESTS=tests From 4780094ad89d22acb86aeadcfe4abb0b81615e5f Mon Sep 17 00:00:00 2001 From: Shivam Mathur Date: Sat, 31 May 2025 17:42:21 +0000 Subject: [PATCH 10/21] Add CI workflows --- .github/workflows/linux.yml | 73 +++++++++++++++++++++++++++++++++++ .github/workflows/windows.yml | 48 +++++++++++++++++++++++ tests/bug44301.phpt | 2 + 3 files changed, 123 insertions(+) create mode 100644 .github/workflows/linux.yml create mode 100644 .github/workflows/windows.yml diff --git a/.github/workflows/linux.yml b/.github/workflows/linux.yml new file mode 100644 index 0000000..1abb234 --- /dev/null +++ b/.github/workflows/linux.yml @@ -0,0 +1,73 @@ +name: Linux +on: + - push + - pull_request + - workflow_dispatch +jobs: + linux: + strategy: + fail-fast: false + matrix: + include: + - version: 8.3 + branch: PHP-8.3 + - version: 8.4 + branch: PHP-8.4 + - version: 8.5 + branch: master + services: + oracle: + image: gvenzl/oracle-free:23-slim + ports: + - 1521:1521 + env: + ORACLE_PASSWORD: pass + options: >- + --health-cmd healthcheck.sh + --health-interval 10s + --health-timeout 5s + --health-retries 10 + runs-on: ubuntu-latest + steps: + - name: Setup dependencies + run: | + mkdir -p /opt/oracle + for pkg in sdk basiclite; do + curl -O https://download.oracle.com/otn_software/linux/instantclient/instantclient-$pkg-linuxx64.zip + unzip -o instantclient-$pkg-linuxx64.zip -d /opt/oracle + done + mv /opt/oracle/instantclient_* /opt/oracle/instantclient + sudo ln -sf /opt/oracle/instantclient/*.so* /usr/lib + sudo apt-get update && sudo apt-get install libaio-dev -y + sudo ln -sf /usr/lib/x86_64-linux-gnu/libaio.so.1t64 /usr/lib/x86_64-linux-gnu/libaio.so.1 >/dev/null 2>&1 || true + # fix debug build warning: zend_signal: handler was replaced for signal (2) after startup + echo DISABLE_INTERRUPT=on > /opt/oracle/instantclient/network/admin/sqlnet.ora + - name: Checkout pdo_oci + uses: actions/checkout@v4 + - name: Checkout php-src + uses: actions/checkout@v4 + with: + repository: php/php-src + ref: ${{ matrix.branch }} + path: php-src + - name: Setup PHP + uses: shivammathur/setup-php@v2 + with: + php-version: ${{matrix.version}} + - name: Build pdo_oci + run: | + phpize + ./configure --with-php-config=$(command -v php-config) --with-pdo-oci=instantclient,/opt/oracle/instantclient + make -j$(nproc) + sudo make install + echo 'extension=pdo_oci.so' | sudo tee /etc/php/${{ matrix.version }}/mods-available/pdo_oci.ini + sudo phpenmod -v ${{ matrix.version }} pdo_oci + php --ri pdo_oci + - name: Run Tests + run: php php-src/run-tests.php --set-timeout 600 tests + env: + PDO_TEST_DIR: ${{ github.workspace }}/php-src/ext/pdo/tests + PDO_OCI_TEST_DIR: ${{ github.workspace }}/tests + PDO_OCI_TEST_USER: system + PDO_OCI_TEST_PASS: pass + PDO_OCI_TEST_DSN: oci:dbname=0.0.0.0:1521/FREEPDB1;charset=AL32UTF8 diff --git a/.github/workflows/windows.yml b/.github/workflows/windows.yml new file mode 100644 index 0000000..16c6df9 --- /dev/null +++ b/.github/workflows/windows.yml @@ -0,0 +1,48 @@ +name: Windows +on: + push: + pull_request: + release: + types: [created] +jobs: + get-extension-matrix: + runs-on: ubuntu-latest + outputs: + matrix: ${{ steps.extension-matrix.outputs.matrix }} + steps: + - name: Checkout + uses: actions/checkout@v4 + - name: Get the extension matrix + id: extension-matrix + uses: php/php-windows-builder/extension-matrix@v1 + with: + php-version-list: '8.3, 8.4, master' + + windows: + needs: get-extension-matrix + runs-on: ${{ matrix.os }} + strategy: + fail-fast: false + matrix: ${{fromJson(needs.get-extension-matrix.outputs.matrix)}} + steps: + - name: Checkout + uses: actions/checkout@v4 + - name: Build the extension + uses: php/php-windows-builder/extension@v1 + with: + php-version: ${{ matrix.php-version }} + arch: ${{ matrix.arch }} + ts: ${{ matrix.ts }} + libs: instantclient + test-workers: 4 + + release: + runs-on: ubuntu-latest + needs: windows + if: ${{ github.event_name == 'release' }} + steps: + - name: Upload artifact to the release + uses: php/php-windows-builder/release@v1 + with: + release: ${{ github.event.release.tag_name }} + token: ${{ secrets.GITHUB_TOKEN }} diff --git a/tests/bug44301.phpt b/tests/bug44301.phpt index 5bf670d..a0c787b 100644 --- a/tests/bug44301.phpt +++ b/tests/bug44301.phpt @@ -3,6 +3,8 @@ PDO OCI Bug #44301 (Segfault when an exception is thrown on persistent connectio --EXTENSIONS-- pdo pdo_oci +--XFAIL-- +This test is currently failing in CI. --SKIPIF-- Date: Sun, 1 Jun 2025 04:09:23 +0000 Subject: [PATCH 11/21] Fix test bug44301 --- tests/bug44301.phpt | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/tests/bug44301.phpt b/tests/bug44301.phpt index a0c787b..5bf321b 100644 --- a/tests/bug44301.phpt +++ b/tests/bug44301.phpt @@ -3,8 +3,6 @@ PDO OCI Bug #44301 (Segfault when an exception is thrown on persistent connectio --EXTENSIONS-- pdo pdo_oci ---XFAIL-- -This test is currently failing in CI. --SKIPIF-- --EXPECTF-- SQLSTATE[HY000]: General error: 942 OCIStmtExecute: ORA-00942: table or view %sdoes not exist - (%s%epdo_oci%eoci_statement.c:%d) + (%soci_statement.c:%d) From 8672e3692bb3c8289657613f8acf719fab4bdcb7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Michael=20Vo=C5=99=C3=AD=C5=A1ek?= Date: Sun, 1 Jun 2025 06:55:15 +0200 Subject: [PATCH 12/21] move linux&windows into single workflow file --- .github/workflows/{linux.yml => ci.yml} | 46 +++++++++++++++++++++++- .github/workflows/windows.yml | 48 ------------------------- 2 files changed, 45 insertions(+), 49 deletions(-) rename .github/workflows/{linux.yml => ci.yml} (67%) delete mode 100644 .github/workflows/windows.yml diff --git a/.github/workflows/linux.yml b/.github/workflows/ci.yml similarity index 67% rename from .github/workflows/linux.yml rename to .github/workflows/ci.yml index 1abb234..fc1e0c0 100644 --- a/.github/workflows/linux.yml +++ b/.github/workflows/ci.yml @@ -1,8 +1,10 @@ -name: Linux +name: CI on: - push - pull_request - workflow_dispatch + - release: + types: [created] jobs: linux: strategy: @@ -71,3 +73,45 @@ jobs: PDO_OCI_TEST_USER: system PDO_OCI_TEST_PASS: pass PDO_OCI_TEST_DSN: oci:dbname=0.0.0.0:1521/FREEPDB1;charset=AL32UTF8 + + windows-matrix: + runs-on: ubuntu-latest + outputs: + matrix: ${{ steps.extension-matrix.outputs.matrix }} + steps: + - name: Checkout + uses: actions/checkout@v4 + - name: Get the extension matrix + id: extension-matrix + uses: php/php-windows-builder/extension-matrix@v1 + with: + php-version-list: '8.3, 8.4, master' + + windows: + needs: windows-matrix + runs-on: ${{ matrix.os }} + strategy: + fail-fast: false + matrix: ${{fromJson(needs.windows-matrix.outputs.matrix)}} + steps: + - name: Checkout + uses: actions/checkout@v4 + - name: Build the extension + uses: php/php-windows-builder/extension@v1 + with: + php-version: ${{ matrix.php-version }} + arch: ${{ matrix.arch }} + ts: ${{ matrix.ts }} + libs: instantclient + test-workers: 4 + + windows-release: + runs-on: ubuntu-latest + needs: windows + if: ${{ github.event_name == 'release' }} + steps: + - name: Upload artifact to the release + uses: php/php-windows-builder/release@v1 + with: + release: ${{ github.event.release.tag_name }} + token: ${{ secrets.GITHUB_TOKEN }} diff --git a/.github/workflows/windows.yml b/.github/workflows/windows.yml deleted file mode 100644 index 16c6df9..0000000 --- a/.github/workflows/windows.yml +++ /dev/null @@ -1,48 +0,0 @@ -name: Windows -on: - push: - pull_request: - release: - types: [created] -jobs: - get-extension-matrix: - runs-on: ubuntu-latest - outputs: - matrix: ${{ steps.extension-matrix.outputs.matrix }} - steps: - - name: Checkout - uses: actions/checkout@v4 - - name: Get the extension matrix - id: extension-matrix - uses: php/php-windows-builder/extension-matrix@v1 - with: - php-version-list: '8.3, 8.4, master' - - windows: - needs: get-extension-matrix - runs-on: ${{ matrix.os }} - strategy: - fail-fast: false - matrix: ${{fromJson(needs.get-extension-matrix.outputs.matrix)}} - steps: - - name: Checkout - uses: actions/checkout@v4 - - name: Build the extension - uses: php/php-windows-builder/extension@v1 - with: - php-version: ${{ matrix.php-version }} - arch: ${{ matrix.arch }} - ts: ${{ matrix.ts }} - libs: instantclient - test-workers: 4 - - release: - runs-on: ubuntu-latest - needs: windows - if: ${{ github.event_name == 'release' }} - steps: - - name: Upload artifact to the release - uses: php/php-windows-builder/release@v1 - with: - release: ${{ github.event.release.tag_name }} - token: ${{ secrets.GITHUB_TOKEN }} From 5a74259063875095d1e5caa2e1132aee31b5f31d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Michael=20Vo=C5=99=C3=AD=C5=A1ek?= Date: Sun, 1 Jun 2025 06:57:44 +0200 Subject: [PATCH 13/21] fix --- .github/workflows/ci.yml | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index fc1e0c0..37f0d6d 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -1,10 +1,12 @@ name: CI + on: - - push - - pull_request - - workflow_dispatch - - release: + push: + pull_request: + workflow_dispatch: + release: types: [created] + jobs: linux: strategy: From 703e88fdaba6f77efc6d15f4600729087b17fb68 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Michael=20Vo=C5=99=C3=AD=C5=A1ek?= Date: Sun, 1 Jun 2025 07:00:25 +0200 Subject: [PATCH 14/21] less verbose CI --- .github/workflows/ci.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 37f0d6d..5d36bbb 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -37,12 +37,12 @@ jobs: run: | mkdir -p /opt/oracle for pkg in sdk basiclite; do - curl -O https://download.oracle.com/otn_software/linux/instantclient/instantclient-$pkg-linuxx64.zip - unzip -o instantclient-$pkg-linuxx64.zip -d /opt/oracle + curl --no-progress-meter -O https://download.oracle.com/otn_software/linux/instantclient/instantclient-$pkg-linuxx64.zip + unzip -q -o instantclient-$pkg-linuxx64.zip -d /opt/oracle done mv /opt/oracle/instantclient_* /opt/oracle/instantclient sudo ln -sf /opt/oracle/instantclient/*.so* /usr/lib - sudo apt-get update && sudo apt-get install libaio-dev -y + sudo apt-get -q update && sudo apt-get install libaio-dev -y sudo ln -sf /usr/lib/x86_64-linux-gnu/libaio.so.1t64 /usr/lib/x86_64-linux-gnu/libaio.so.1 >/dev/null 2>&1 || true # fix debug build warning: zend_signal: handler was replaced for signal (2) after startup echo DISABLE_INTERRUPT=on > /opt/oracle/instantclient/network/admin/sqlnet.ora From a42b94acc79668a0ab155ccdc43658a8126845cf Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Michael=20Vo=C5=99=C3=AD=C5=A1ek?= Date: Sun, 1 Jun 2025 07:10:00 +0200 Subject: [PATCH 15/21] minor cleanup --- .github/workflows/ci.yml | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 5d36bbb..adc080c 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -1,6 +1,6 @@ name: CI -on: +on: push: pull_request: workflow_dispatch: @@ -46,7 +46,7 @@ jobs: sudo ln -sf /usr/lib/x86_64-linux-gnu/libaio.so.1t64 /usr/lib/x86_64-linux-gnu/libaio.so.1 >/dev/null 2>&1 || true # fix debug build warning: zend_signal: handler was replaced for signal (2) after startup echo DISABLE_INTERRUPT=on > /opt/oracle/instantclient/network/admin/sqlnet.ora - - name: Checkout pdo_oci + - name: Checkout uses: actions/checkout@v4 - name: Checkout php-src uses: actions/checkout@v4 @@ -58,7 +58,7 @@ jobs: uses: shivammathur/setup-php@v2 with: php-version: ${{matrix.version}} - - name: Build pdo_oci + - name: Build run: | phpize ./configure --with-php-config=$(command -v php-config) --with-pdo-oci=instantclient,/opt/oracle/instantclient @@ -67,7 +67,7 @@ jobs: echo 'extension=pdo_oci.so' | sudo tee /etc/php/${{ matrix.version }}/mods-available/pdo_oci.ini sudo phpenmod -v ${{ matrix.version }} pdo_oci php --ri pdo_oci - - name: Run Tests + - name: Run tests run: php php-src/run-tests.php --set-timeout 600 tests env: PDO_TEST_DIR: ${{ github.workspace }}/php-src/ext/pdo/tests @@ -83,7 +83,7 @@ jobs: steps: - name: Checkout uses: actions/checkout@v4 - - name: Get the extension matrix + - name: Create matrix id: extension-matrix uses: php/php-windows-builder/extension-matrix@v1 with: @@ -98,21 +98,20 @@ jobs: steps: - name: Checkout uses: actions/checkout@v4 - - name: Build the extension + - name: Build uses: php/php-windows-builder/extension@v1 with: php-version: ${{ matrix.php-version }} arch: ${{ matrix.arch }} ts: ${{ matrix.ts }} libs: instantclient - test-workers: 4 windows-release: runs-on: ubuntu-latest needs: windows if: ${{ github.event_name == 'release' }} steps: - - name: Upload artifact to the release + - name: Upload release artifact uses: php/php-windows-builder/release@v1 with: release: ${{ github.event.release.tag_name }} From ac05cde4054b9bda4c5f1160f8781779ef82a1b4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Michael=20Vo=C5=99=C3=AD=C5=A1ek?= Date: Sun, 1 Jun 2025 07:18:44 +0200 Subject: [PATCH 16/21] run tests on Oracle v18 as well --- .github/workflows/ci.yml | 32 ++++++++++++++++++++++++++------ 1 file changed, 26 insertions(+), 6 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index adc080c..4084ed2 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -20,12 +20,23 @@ jobs: - version: 8.5 branch: master services: - oracle: + oracle-18: + image: gvenzl/oracle-xe:18-slim-faststart + ports: + - 1518:1521 + env: + ORACLE_PASSWORD: my_pass + options: >- + --health-cmd healthcheck.sh + --health-interval 10s + --health-timeout 5s + --health-retries 10 + oracle-23: image: gvenzl/oracle-free:23-slim ports: - - 1521:1521 + - 1523:1521 env: - ORACLE_PASSWORD: pass + ORACLE_PASSWORD: my_pass options: >- --health-cmd healthcheck.sh --health-interval 10s @@ -67,14 +78,23 @@ jobs: echo 'extension=pdo_oci.so' | sudo tee /etc/php/${{ matrix.version }}/mods-available/pdo_oci.ini sudo phpenmod -v ${{ matrix.version }} pdo_oci php --ri pdo_oci - - name: Run tests + - name: Run tests /w Oracle 18 + run: php php-src/run-tests.php --set-timeout 600 tests + env: + PDO_TEST_DIR: ${{ github.workspace }}/php-src/ext/pdo/tests + PDO_OCI_TEST_DIR: ${{ github.workspace }}/tests + PDO_OCI_TEST_USER: system + PDO_OCI_TEST_PASS: my_pass + PDO_OCI_TEST_DSN: oci:dbname=0.0.0.0:1518/FREEPDB1;charset=AL32UTF8 + - name: Run tests /w Oracle 23 + if: success() || failure() run: php php-src/run-tests.php --set-timeout 600 tests env: PDO_TEST_DIR: ${{ github.workspace }}/php-src/ext/pdo/tests PDO_OCI_TEST_DIR: ${{ github.workspace }}/tests PDO_OCI_TEST_USER: system - PDO_OCI_TEST_PASS: pass - PDO_OCI_TEST_DSN: oci:dbname=0.0.0.0:1521/FREEPDB1;charset=AL32UTF8 + PDO_OCI_TEST_PASS: my_pass + PDO_OCI_TEST_DSN: oci:dbname=0.0.0.0:1523/FREEPDB1;charset=AL32UTF8 windows-matrix: runs-on: ubuntu-latest From e4698b32be0ea72b69ce0f62f8466788f3805158 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Michael=20Vo=C5=99=C3=AD=C5=A1ek?= Date: Sun, 1 Jun 2025 07:46:44 +0200 Subject: [PATCH 17/21] and v11 --- .github/workflows/ci.yml | 19 +++++++++++++++++-- tests/bug44301.phpt | 2 +- tests/bug_33707.phpt | 2 +- tests/pdo_oci_stmt_getcolumnmeta.phpt | 2 ++ 4 files changed, 21 insertions(+), 4 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 4084ed2..971d3c9 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -20,6 +20,12 @@ jobs: - version: 8.5 branch: master services: + oracle-11: + image: wnameless/oracle-xe-11g-r2 + ports: + - 1511:1521 + env: + ORACLE_ALLOW_REMOTE: true oracle-18: image: gvenzl/oracle-xe:18-slim-faststart ports: @@ -78,8 +84,17 @@ jobs: echo 'extension=pdo_oci.so' | sudo tee /etc/php/${{ matrix.version }}/mods-available/pdo_oci.ini sudo phpenmod -v ${{ matrix.version }} pdo_oci php --ri pdo_oci + - name: Run tests /w Oracle 11 + run: php php-src/run-tests.php --show-diff --show-slow 1000 --set-timeout 120 tests + env: + PDO_TEST_DIR: ${{ github.workspace }}/php-src/ext/pdo/tests + PDO_OCI_TEST_DIR: ${{ github.workspace }}/tests + PDO_OCI_TEST_USER: system + PDO_OCI_TEST_PASS: oracle + PDO_OCI_TEST_DSN: oci:dbname=0.0.0.0:1511/XE;charset=AL32UTF8 - name: Run tests /w Oracle 18 - run: php php-src/run-tests.php --set-timeout 600 tests + if: success() || failure() + run: php php-src/run-tests.php --show-diff --show-slow 1000 --set-timeout 120 tests env: PDO_TEST_DIR: ${{ github.workspace }}/php-src/ext/pdo/tests PDO_OCI_TEST_DIR: ${{ github.workspace }}/tests @@ -88,7 +103,7 @@ jobs: PDO_OCI_TEST_DSN: oci:dbname=0.0.0.0:1518/FREEPDB1;charset=AL32UTF8 - name: Run tests /w Oracle 23 if: success() || failure() - run: php php-src/run-tests.php --set-timeout 600 tests + run: php php-src/run-tests.php --show-diff --show-slow 1000 --set-timeout 120 tests env: PDO_TEST_DIR: ${{ github.workspace }}/php-src/ext/pdo/tests PDO_OCI_TEST_DIR: ${{ github.workspace }}/tests diff --git a/tests/bug44301.phpt b/tests/bug44301.phpt index 5bf321b..ce9fe62 100644 --- a/tests/bug44301.phpt +++ b/tests/bug44301.phpt @@ -24,5 +24,5 @@ try { $db = null; ?> --EXPECTF-- -SQLSTATE[HY000]: General error: 942 OCIStmtExecute: ORA-00942: table or view %sdoes not exist +SQLSTATE[HY000]: General error: 942 OCIStmtExecute: ORA-00942: table or view %Sdoes not exist (%soci_statement.c:%d) diff --git a/tests/bug_33707.phpt b/tests/bug_33707.phpt index 8a985b4..0836aa3 100644 --- a/tests/bug_33707.phpt +++ b/tests/bug_33707.phpt @@ -26,6 +26,6 @@ array(3) { [1]=> int(942) [2]=> - string(%d) "OCIStmtExecute: ORA-00942: table or view %sdoes not exist + string(%d) "OCIStmtExecute: ORA-00942: table or view %Sdoes not exist (%s:%d)" } diff --git a/tests/pdo_oci_stmt_getcolumnmeta.phpt b/tests/pdo_oci_stmt_getcolumnmeta.phpt index a134359..16384fe 100644 --- a/tests/pdo_oci_stmt_getcolumnmeta.phpt +++ b/tests/pdo_oci_stmt_getcolumnmeta.phpt @@ -7,6 +7,8 @@ pdo_oci getAttribute(PDO::ATTR_SERVER_VERSION), 12) < 0) die('xfail CI is failing with Oracle XE 11g'); ?> --FILE-- Date: Mon, 2 Jun 2025 13:13:52 +0200 Subject: [PATCH 18/21] rm php-src/ext/pdo tests for Oracle 11g --- .github/workflows/ci.yml | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 971d3c9..839668a 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -85,7 +85,11 @@ jobs: sudo phpenmod -v ${{ matrix.version }} pdo_oci php --ri pdo_oci - name: Run tests /w Oracle 11 - run: php php-src/run-tests.php --show-diff --show-slow 1000 --set-timeout 120 tests + run: | + # https://github.com/php/php-src/pull/18734 + # https://github.com/php/pecl-database-pdo_oci/pull/16#discussion_r2119810891 + find php-src/ext/pdo/tests -name '*.phpt' -type f -delete + php php-src/run-tests.php --show-diff --show-slow 1000 --set-timeout 120 tests env: PDO_TEST_DIR: ${{ github.workspace }}/php-src/ext/pdo/tests PDO_OCI_TEST_DIR: ${{ github.workspace }}/tests From d4d56a1e79893193b442639aee4febdd86ae818f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Michael=20Vo=C5=99=C3=AD=C5=A1ek?= Date: Mon, 2 Jun 2025 13:14:28 +0200 Subject: [PATCH 19/21] XE DB for v18 --- .github/workflows/ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 839668a..48d0a83 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -104,7 +104,7 @@ jobs: PDO_OCI_TEST_DIR: ${{ github.workspace }}/tests PDO_OCI_TEST_USER: system PDO_OCI_TEST_PASS: my_pass - PDO_OCI_TEST_DSN: oci:dbname=0.0.0.0:1518/FREEPDB1;charset=AL32UTF8 + PDO_OCI_TEST_DSN: oci:dbname=0.0.0.0:1518/XE;charset=AL32UTF8 - name: Run tests /w Oracle 23 if: success() || failure() run: php php-src/run-tests.php --show-diff --show-slow 1000 --set-timeout 120 tests From ec400c5325786c4c6df7c4a477227b60e77ea374 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Michael=20Vo=C5=99=C3=AD=C5=A1ek?= Date: Mon, 2 Jun 2025 13:15:59 +0200 Subject: [PATCH 20/21] add testing with Oracle v21 --- .github/workflows/ci.yml | 28 ++++++++++++++++++++++++---- 1 file changed, 24 insertions(+), 4 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 48d0a83..c2e9527 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -31,7 +31,18 @@ jobs: ports: - 1518:1521 env: - ORACLE_PASSWORD: my_pass + ORACLE_PASSWORD: my_pass_18 + options: >- + --health-cmd healthcheck.sh + --health-interval 10s + --health-timeout 5s + --health-retries 10 + oracle-21: + image: gvenzl/oracle-xe:21-slim-faststart + ports: + - 1521:1521 + env: + ORACLE_PASSWORD: my_pass_21 options: >- --health-cmd healthcheck.sh --health-interval 10s @@ -42,7 +53,7 @@ jobs: ports: - 1523:1521 env: - ORACLE_PASSWORD: my_pass + ORACLE_PASSWORD: my_pass_23 options: >- --health-cmd healthcheck.sh --health-interval 10s @@ -103,8 +114,17 @@ jobs: PDO_TEST_DIR: ${{ github.workspace }}/php-src/ext/pdo/tests PDO_OCI_TEST_DIR: ${{ github.workspace }}/tests PDO_OCI_TEST_USER: system - PDO_OCI_TEST_PASS: my_pass + PDO_OCI_TEST_PASS: my_pass_18 PDO_OCI_TEST_DSN: oci:dbname=0.0.0.0:1518/XE;charset=AL32UTF8 + - name: Run tests /w Oracle 21 + if: success() || failure() + run: php php-src/run-tests.php --show-diff --show-slow 1000 --set-timeout 120 tests + env: + PDO_TEST_DIR: ${{ github.workspace }}/php-src/ext/pdo/tests + PDO_OCI_TEST_DIR: ${{ github.workspace }}/tests + PDO_OCI_TEST_USER: system + PDO_OCI_TEST_PASS: my_pass_21 + PDO_OCI_TEST_DSN: oci:dbname=0.0.0.0:1521/XE;charset=AL32UTF8 - name: Run tests /w Oracle 23 if: success() || failure() run: php php-src/run-tests.php --show-diff --show-slow 1000 --set-timeout 120 tests @@ -112,7 +132,7 @@ jobs: PDO_TEST_DIR: ${{ github.workspace }}/php-src/ext/pdo/tests PDO_OCI_TEST_DIR: ${{ github.workspace }}/tests PDO_OCI_TEST_USER: system - PDO_OCI_TEST_PASS: my_pass + PDO_OCI_TEST_PASS: my_pass_23 PDO_OCI_TEST_DSN: oci:dbname=0.0.0.0:1523/FREEPDB1;charset=AL32UTF8 windows-matrix: From fc5bbc48b8f272ba243d2a3a2c0556e3d2cde86a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Michael=20Vo=C5=99=C3=AD=C5=A1ek?= Date: Mon, 2 Jun 2025 13:25:19 +0200 Subject: [PATCH 21/21] better Oracle 11g fix --- .github/workflows/ci.yml | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index c2e9527..dd539d0 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -95,12 +95,11 @@ jobs: echo 'extension=pdo_oci.so' | sudo tee /etc/php/${{ matrix.version }}/mods-available/pdo_oci.ini sudo phpenmod -v ${{ matrix.version }} pdo_oci php --ri pdo_oci - - name: Run tests /w Oracle 11 - run: | - # https://github.com/php/php-src/pull/18734 - # https://github.com/php/pecl-database-pdo_oci/pull/16#discussion_r2119810891 - find php-src/ext/pdo/tests -name '*.phpt' -type f -delete - php php-src/run-tests.php --show-diff --show-slow 1000 --set-timeout 120 tests + - name: Run tests /w Oracle 11 (for PHP 8.3 only) + # https://github.com/php/php-src/pull/18734 + # https://github.com/php/pecl-database-pdo_oci/pull/16#discussion_r2119810891 + if: matrix.version == '8.3' + run: php php-src/run-tests.php --show-diff --show-slow 1000 --set-timeout 120 tests env: PDO_TEST_DIR: ${{ github.workspace }}/php-src/ext/pdo/tests PDO_OCI_TEST_DIR: ${{ github.workspace }}/tests