mirror of
https://github.com/php/pecl-database-pdo_oci.git
synced 2026-03-23 23:12:16 +01:00
setup-php now supports using master as the php-version, so we do not need to have branch separately. Also, we can use include to add oracle 11 just for PHP 8.3 instead of excluding it for other PHP versions
140 lines
5.0 KiB
YAML
140 lines
5.0 KiB
YAML
name: CI
|
|
|
|
on:
|
|
push:
|
|
pull_request:
|
|
workflow_dispatch:
|
|
release:
|
|
types: [created]
|
|
|
|
jobs:
|
|
linux:
|
|
strategy:
|
|
fail-fast: false
|
|
matrix:
|
|
version: [8.3, 8.4, 8.5, master]
|
|
oracle: [18, 21, 23]
|
|
include:
|
|
# Test Oracle 11 with PHP 8.3 only
|
|
# https://github.com/php/php-src/pull/18734
|
|
# https://github.com/php/pecl-database-pdo_oci/pull/16#discussion_r2119810891
|
|
- version: 8.3
|
|
oracle: 11
|
|
image: wnameless/oracle-xe-11g-r2
|
|
port: 1511
|
|
options: --name=oci
|
|
- oracle: 18
|
|
image: gvenzl/oracle-xe:18-slim-faststart
|
|
port: 1518
|
|
options: --health-cmd healthcheck.sh --health-interval 10s --health-timeout 5s --health-retries 10
|
|
- oracle: 21
|
|
image: gvenzl/oracle-xe:21-slim-faststart
|
|
port: 1521
|
|
options: --health-cmd healthcheck.sh --health-interval 10s --health-timeout 5s --health-retries 10
|
|
- oracle: 23
|
|
image: gvenzl/oracle-free:23-slim
|
|
port: 1523
|
|
options: --health-cmd healthcheck.sh --health-interval 10s --health-timeout 5s --health-retries 10
|
|
|
|
services:
|
|
oracle:
|
|
image: ${{ matrix.image }}
|
|
ports:
|
|
- ${{ matrix.port }}:1521
|
|
env:
|
|
ORACLE_ALLOW_REMOTE: true
|
|
ORACLE_PASSWORD: oracle
|
|
options: ${{ matrix.options }}
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- name: Setup dependencies
|
|
run: |
|
|
mkdir -p /opt/oracle
|
|
for pkg in sdk basiclite; do
|
|
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 -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
|
|
- name: Checkout
|
|
uses: actions/checkout@v6
|
|
- name: Checkout php-src
|
|
uses: actions/checkout@v6
|
|
with:
|
|
repository: php/php-src
|
|
ref: ${{ matrix.version == 'master' && 'master' || format('PHP-{0}', matrix.version) }}
|
|
path: php-src
|
|
- name: Setup PHP
|
|
id: setup-php
|
|
uses: shivammathur/setup-php@v2
|
|
with:
|
|
php-version: ${{matrix.version}}
|
|
- name: Build
|
|
run: |
|
|
phpize
|
|
./configure --with-php-config=$(command -v php-config) --with-pdo-oci=instantclient,/opt/oracle/instantclient
|
|
make -j$(nproc)
|
|
sudo make install
|
|
version=$(php-config --version | cut -d. -f1,2)
|
|
echo 'extension=pdo_oci.so' | sudo tee "/etc/php/$version/mods-available/pdo_oci.ini"
|
|
sudo phpenmod -v "$version" pdo_oci
|
|
php --ri pdo_oci
|
|
- name: Remove unsupported php-src tests
|
|
run: |
|
|
# Test gh20553.phpt is not compatible with Oracle.
|
|
# SELECT <literals> without a FROM clause is not supported in Oracle (ORA-00923).
|
|
rm -rf php-src/ext/pdo/tests/gh20553.phpt
|
|
- name: Run tests /w Oracle ${{ matrix.oracle }}
|
|
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:${{ matrix.port }}/${{ matrix.oracle == 23 && 'FREEPDB1' || 'XE' }};charset=AL32UTF8
|
|
|
|
windows-matrix:
|
|
runs-on: ubuntu-latest
|
|
outputs:
|
|
matrix: ${{ steps.extension-matrix.outputs.matrix }}
|
|
steps:
|
|
- name: Checkout
|
|
uses: actions/checkout@v6
|
|
- name: Create matrix
|
|
id: extension-matrix
|
|
uses: php/php-windows-builder/extension-matrix@v1
|
|
with:
|
|
php-version-list: '8.3, 8.4, 8.5'
|
|
|
|
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@v6
|
|
- name: Build
|
|
uses: php/php-windows-builder/extension@v1
|
|
with:
|
|
php-version: ${{ matrix.php-version }}
|
|
arch: ${{ matrix.arch }}
|
|
ts: ${{ matrix.ts }}
|
|
libs: instantclient
|
|
|
|
windows-release:
|
|
runs-on: ubuntu-latest
|
|
needs: windows
|
|
if: ${{ github.event_name == 'release' }}
|
|
steps:
|
|
- name: Upload release artifact
|
|
uses: php/php-windows-builder/release@v1
|
|
with:
|
|
release: ${{ github.event.release.tag_name }}
|
|
token: ${{ secrets.GITHUB_TOKEN }}
|