From a236fe4dfc4beddf5de810392d72d2e748eb4ac2 Mon Sep 17 00:00:00 2001 From: "Christoph M. Becker" Date: Tue, 13 Aug 2024 16:38:50 +0200 Subject: [PATCH 1/9] 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 2/9] 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 3/9] 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 4/9] 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 5/9] 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 6/9] 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 7/9] 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 8/9] 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 9/9] 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